When I fold certain functions I get the following error when I compile....
C:\DOCUME~1\Dad\LOCALS~1\Temp\glbasic\gpc_temp1.cpp:212: error: stray '\8' in program
Unfolding, then compiling, removes the error?
Yes, you need to unfold all functions before compiling...
paste the function. Works for me when quickly testing.
I would have to post the whole program Gernot as the function uses custom types extensively.
There are no erroneous control characters etc, I checked the file with a hex editor.
This code...
tot% = tot% + rand%
in GLBasic
...creates this code in "gpc_temp1.cpp"...
tot = tot + rand;
EDIT: (I removed the code block as the CHR( 8 ) character shows without it within my browser)
There is a CHR( 8 ) added before the ";"?
This ONLY happens when this particular function is folded?
attach the file, please.
I just stopped using code folding for the present.
I can't post the whole program Gernot, its part of a commercial product so I will cut out the function and its types, then mail it to you Gernot.
Cheers,
Ian
I notice when you fold code, it replaces all [CR][LF] pairs with [BS][FF] (ascii 08 & 12).
Looks like a bug in the 'folding' / 'unfolding' code and is two characters off somewhere.
(does the line end with [CR][LF] when NOT folded? may be saved in a different format somehow?)
Does the compile error happen if you have a comment at the end? (ie. push the problem to the right more)
Is it the same error if you remove the % from rand? (it may insert the [BS] character in another position then).
And why not use 'INC tot%, rand%'. (not as pretty, I guess, but I assume it converts to 'tot += rand' in c++.)
(just nit-picking, ignore this!! ha)
Code folding issue discussed here: http://www.glbasic.com/forum/index.php?topic=4499.0 (http://www.glbasic.com/forum/index.php?topic=4499.0)
Gernot I PM'ed you the code regard this error.
Cheers,
Ian
OK, fixed next update. Thanks.