cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jchristman
Level 8

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.
Labels (1)
0 Kudos
(2) Replies
TheTraveler
Level 8

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.
0 Kudos
jchristman
Level 8

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.
0 Kudos