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
- :
- Re: StrPutTokens() not returning null delimited string in IS2011
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 03, 2010
01:39 AM
StrPutTokens() not returning null delimited string in IS2011
Using StrPutTokens() to create a string with null seperator. This used to work fine in IS2010, we have recently upgraded to IS2011 and StrPutTokens() is failing. The list has 7 items and StrPutTokens() is returning only the first item. Following is my code. Is this a bug in 2011?
if (StrGetTokens (listItem, svData, ";") < 0) then
// Report the error.
endif;
svData = "";
StrPutTokens( listItem, svData, "", TRUE)
if (StrGetTokens (listItem, svData, ";") < 0) then
// Report the error.
endif;
svData = "";
StrPutTokens( listItem, svData, "", TRUE)
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 03, 2010
03:14 PM
I haven't been able to reproduce any issues with StrPutTokens with a null delimited string. Here is some test code I tried:
This produces the output shown in the attached screenshot. Notice that all the strings are delimited with nulls in the final output.
What are you testing that indicates StrPutTokens is not working?
function OnBegin()
LIST listStrings;
STRING testString, originalString, displayString;
NUMBER i, j, size1;
begin
testString = "one;two;three;four";
originalString = testString;
listStrings = ListCreate(STRINGLIST);
StrGetTokens(listStrings, testString, ";");
testString = "";
StrPutTokens(listStrings, testString, "", TRUE);
ListDestroy(listStrings);
size1 = SizeOf(testString);
i = 0;
j = 0;
while(i < size1)
if(testString != 0) then
displayString= testString;
j = j + 1;
else
displayString = displayString + "";
j = j + 6;
endif;
i = i + 1;
endwhile;
MessageBox("Original: " + originalString + "\nNew: " + displayString, 0);
end;
This produces the output shown in the attached screenshot. Notice that all the strings are delimited with nulls in the final output.
What are you testing that indicates StrPutTokens is not working?