Welcome! Log In Create A New Profile

Advanced

Parser issue ?

Posted by damato68 
Parser issue ?
November 29, 2012 02:37PM
Writing the code I've found some problem with the language parser:
1) Sometime the parser truncate the line in the function definition line even if the line is less than 80chars

2)The following code give a problem when upload the module (terminal) giving "Timeout waiting for ACK"

function SPRS232_ReceiveSOP(Typeptr,Firstptr,Lastptr,RCptr,TotalTout)
    dim State,Byte,Timeout,NbErr,Status
    @Typeptr = 0xff
    @Firstptr = 0xff
    @Lastptr = 0xff
    @RCptr = 0xff
    
    Byte = 0xff
    State = 0
    Timeout = TotalTout
    while(State<>4)
    wend
    return 0;
endf

Changing the code in:
function SPRS232_ReceiveSOP(Typeptr,Firstptr,Lastptr,RCptr,TotalTout)
    dim State,Byte,Timeout,NbErr,Status
    @Typeptr = 0xff
    @Firstptr = 0xff
    @Lastptr = 0xff
    @RCptr = 0xff
    
    Byte = 0xff
    State = 0
    Timeout = TotalTout
    while(State=4)
    wend
    return 0;
endf
the board upload the module.

The difference is in the while expression....
Obviously I've no workarounds.
(Ps: I've removed the while / wend contenents to simplify...)
3) The language don't give a "NOT" operator ?
Thanks for any info about
Davide



Edited 3 time(s). Last edit at 11/29/2012 02:40PM by damato68.
Re: Parser issue ?
November 29, 2012 02:57PM
It seem that when used the "<>" can't use the parenthesis

give timeout when uploaded
if (Status <> 0)
.....

seem ok
if Status <> 0
....
Re: Parser issue ?
November 29, 2012 03:29PM
This timeout is caused by a syntax error in your code:
while(state=4)
should be:
while state = 4
There is no parenthesis for decision statements. It should report a syntax error but doesn’t. PS the dim problem has been fixed and will be due out in the next few hours.
Sorry, you do not have permission to post/reply in this forum.