This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to find a string in Specific Position
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2015
09:32 AM
How to find a string in Specific Position
How to find a string in Specific Position
For eg.) MyStr = "Testing"
If I pass parameter 4 to some function, it should return 't'. Anyway it can be done in install script?
For eg.) MyStr = "Testing"
If I pass parameter 4 to some function, it should return 't'. Anyway it can be done in install script?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 10, 2015
01:04 PM
Rayner,
There are a lot of ways you could do it using InstallScript String Functions
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefString_functions.htm
Here is one example using CopyBytes
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefCopyBytes.htm
HTH
There are a lot of ways you could do it using InstallScript String Functions
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefString_functions.htm
Here is one example using CopyBytes
http:// helpnet.flexerasoftware.com/installshield21helplib/Subsystems/installshield21langref/helplibrary/LangrefCopyBytes.htm
//-------------------------------------------------------------------------
prototype STRING ExFn_CopyBytes( byval STRING, // szMyString
byval NUMBER ); // nPos
// szMyString = the string you are searching
// nPos = the position in the string that you want
function STRING ExFn_CopyBytes( szMyString, nPos )
STRING szFoundStr;
begin
// use 'number - 1' because CopyBytes is 0-based.
// passing "4" to find the "t" in "Testing" would actually be position 3
CopyBytes( szFoundStr, 0, szMyString, nPos - 1, 1 );
return szFoundStr;
end;
HTH