Internet PLC Forum
General => Technical support => Topic started by: garysdickinson on June 15, 2017, 11:42:25 AM
-
I noticed that the parsing of ":" as a delimiter is very inconsistent.
This is the documented example of the use of ":" as a delimiter:
IF A >B:C=D*5:ELSE:C=D/5:ENDIF
The sample leads one to believe that the delimiter is exactly ":" with no additional whitespace requirements. However, in some cases the parser requires " :" or " : " to be recognized as a delimiter.
This is my test sample that came up with my observed results. The first line of code uses exactly ":" as a delimiter. Each successive line I added white space until the parser was happy. The last line will compile and please note that ":" is not always recognized as a delimiter:
a#=0.0:call StrFmt:PRINT #8 A$;"\09ProductGpmGoal" ' Error:Unknown Keyword: "all"
a#=0.0 :call StrFmt:PRINT #8 A$;"\09ProductGpmGoal" ' Error:Unknown Keyword: "all"
a#=0.0: call StrFmt:PRINT #8 A$;"\09ProductGpmGoal" ' Error:Undefined Custom Function Label:: "StrFmt:PRINT"
a#=0.0: call StrFmt :PRINT #8 A$;"\09ProductGpmGoal" ' Error:Unknown Keyword: "RINT"
a#=0.0: call StrFmt :PRINT #8 A$;"\09ProductGpmGoal" ' Error:Unknown Keyword: "RINT"
a#=0.0: call StrFmt: PRINT #8 A$;"\09ProductGpmGoal" ' Error:Undefined Custom Function Label:: "StrFmt:"
a#=0.0: call StrFmt : PRINT #8 A$;"\09ProductGpmGoal" ' Compiles
I know that this is not the biggest problem on the face of the earth, but it is just plain messy and very inconsistent.
Best regards,
Gary D*ckinson
-
Thank you for your report. The problem occurred because ':' was also used as an acceptable character for names due to the clock pulses using it as part of the name (e.g. "Clk:.01s", "Clk:1.0s" etc). Hence the compiler treated it as part of the string that form the name. By introducing a space the ambiguity was resolved and allows the program to be compiled.
We have fixed this bug and this will be included in the next release of the i-TRiLOGI software.
Thank you.