Page 1 of 1

Error while compiling script [SOLVED]

Posted: Mon Apr 07, 2014 1:19 pm
by atout66
Hi to all,

After a nice sunday, I come back with this problem syntax the code editor returns while compiling this:

Code: Select all

put char (IT+8) of ligneCourante  to the number of chars of ligneCourante into tTmp
put char IT+8 of ligneCourante to length(ligneCourante) into tTmp
The <ligneCourante> var exist and is declared as a string. ligneCourante means currentLine and is a piece of text
"Normally" (as far as I know!), the same lines do the same thing here.
However, I get this error message: < compilation error at line 201 (Commands: missing',') near "into", char 73 >
BTW, is there a way to see the char position in a script in the script editor ?
I don't see where is my error ?

Could you switch the light on for me please ? :wink:

Kind regards, Jean-Paul.

Re: Error while compiling script

Posted: Mon Apr 07, 2014 1:23 pm
by Dixie
try something like..

Code: Select all

put char 1 to 8 of line X into temp

Re: Error while compiling script

Posted: Mon Apr 07, 2014 1:27 pm
by Klaus
Bonjour Jean-Paul,

you first need to define the RANGE of chars and then the source of the range!
-> char X to Y of tSource...

Hint: Never use IT more than neccessary, use a variable instead!
...
## Bad:
## put char (IT+8) of ligneCourante to the number of chars of ligneCourante into tTmp

## Correct, but still clumsy:
## put char (IT+8) to (the number of chars of ligneCourante) of ligneCourante into tTmp

## Better use this:
put the num of chars of ligneCourante into tTotalChars
put char (IT+8) to tTotalChars of ligneCourante into tTmp
...

Best

Klaus

Re: Error while compiling script

Posted: Mon Apr 07, 2014 1:34 pm
by atout66
Arght ! Of course, it's much clearer like that.
I mixed up myself with the number of chars in a string <length()>, with the chars (themself) of that string!!!!!

Sorry, it's Monday, but I'm not sure this is enough to explain everything in my case :shock:

Thanks for your lights.