Loading
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.

  • 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 .

Loading
String parse error