Why Console_WriteLine don't accept negative values?
4th line is OK but 5th line says: "Error 262 - Invalid delimiter".
Why Console_WriteLine don't accept negative values?
4th line is OK but 5th line says: "Error 262 - Invalid delimiter".
my opinion:
the 1 considered by Console_WriteLine as string and not a number, the proof is
Console_WriteLine 1+1 will output 11 and not 2. while in the case of -1 the "-" is a mathematical operation forcing the 1 to be a number (negative number) which is not allowed by Console_WriteLine
but interestingly
will output -12 so it seems Console_WriteLine converts the contents of A to string so string -1 & string 2 = -12'---Load Console Module Uses "Console" Long A,B A=-1 B= 2 '---Print the magic words Console_WriteLine A+2 PrintL "Press a key to end program" '---Wait for a key press WaitKey
Ciao,
Console_WriteLn or PrintL (are the same function) before printing they go ahead in parsing trying to understand if next token is a start of a numeric or string expression. Based on that result, it evaluates string expression or numeric expression.
Evidently it does a poor determination.
To be always in the right track, use STR$() or TSTR$() or FORMAT$() or any function reading a numeric expression returning its value as a string to print out numeric expressions.
Thanks for letting me know. I will see if I can improve kind determination.
Ciao
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks