Summary
This article presents an updated string indexing example.
Synopsis
This article contains an InstallScript sample that will show how you can index a string variable.
NOTE: The example will remove any leading zero characters in a given string variable.
Discussion
A string variable is an array of Unicode characters with a null terminator. You can reference individual characters within a string by specifying the string name followed by an index value within square brackets. Note that the first character in a string is in position 0.
In the example below, the function BlankLeadingZeros() uses the string indexing technique to replace leading zeros in the string representation of a number with blank characters.
//-----------------------------------------------------------
prototype BlankLeadingZeros(BYREF STRING);
...
function BlankLeadingZeros(szString)
INT iVal, iLength;
begin
iVal = 0;
iLength = StrLengthChars (szString);
while (iVal < iLength) && (szString[iVal] = "0")
szString[iVal] = " ";
iVal++;
endwhile;
end;
//-----------------------------------------------------------
Additional Information
For more information on the data types used in this function, you can look at the online help document Data Types and Predefined Structures.
Related Articles
'SQLException: Incorrect string value' error thrown during FlexNet Code Insight scan 6Number of Views Some Localized Strings are Replaced by their String IDs on InstallShield 2016 8Number of Views Basic Example of Steps to Merge Reports From Different Universes 8Number of Views Example of lc_feat_list 16Number of Views FlexNet Publisher C# Sharp Example Instructions 13Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add additional feedback (optional)
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
|
FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513
(toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367
(toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895
2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago