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
- :
- String parse error
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
‎May 02, 2008
02:59 PM
String parse error
I am trying to go thru a string character by character. Here is the sample code
[CODE] nStrLength = StrLengthChars (svLine);
nX = 0;
nCnt = 0;
svTemp = "";
for nX = 1 to nStrLength
sTmp = svLine[nX];
svTemp = svTemp + sTmp;
if ( svLine[nX] = "\"") then
if (nCnt = 0) then
nCnt = 1;
else
svTemp = svTemp + " ";
nCnt = 0;
endif;
endif;
endfor;[/CODE]
Here is the error I get. svLine string value required on [CODE]sTmp=svLine[nX];[/CODE]
I am not for sure what I am doing wrong I am just trying to append each character to the end of a svTemp. I have removed all spaces from svLine and what I am doing is adding a space back into the string after the second double quote. If the string has 6 double quotes it will count 1 then on 2 add a space afterwards and reset the count until the line is completed.
[CODE] nStrLength = StrLengthChars (svLine);
nX = 0;
nCnt = 0;
svTemp = "";
for nX = 1 to nStrLength
sTmp = svLine[nX];
svTemp = svTemp + sTmp;
if ( svLine[nX] = "\"") then
if (nCnt = 0) then
nCnt = 1;
else
svTemp = svTemp + " ";
nCnt = 0;
endif;
endif;
endfor;[/CODE]
Here is the error I get. svLine string value required on [CODE]sTmp=svLine[nX];[/CODE]
I am not for sure what I am doing wrong I am just trying to append each character to the end of a svTemp. I have removed all spaces from svLine and what I am doing is adding a space back into the string after the second double quote. If the string has 6 double quotes it will count 1 then on 2 add a space afterwards and reset the count until the line is completed.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2008
03:43 PM
Hello,
The problem is that when you do this, "svLine[nX]", it is returning of datatype CHAR. Not string; I posted a reply to an later post that shows an example of this. Here is the link.
The problem is that when you do this, "svLine[nX]", it is returning of datatype CHAR. Not string; I posted a reply to an later post that shows an example of this. Here is the link.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2008
04:02 PM
yes, i was just going through the code to see what all was going on and found the example thank you for your assistance. It is greatly appreaciated.