Hello ...
GC Basic is not CASE sensitive, but it is SPACE sensitive !
An error appears if :
- The keyword "If" is directly followed by an opening parenthesis (without space between), for example in case of evaluation of a complex logical expression with priorities : the compiler sees the IF as a "non-declared Array".
- A space is put between a label and the following colon.
Are they bugs, or normal features ? The fist time it's a little bit surprising ...
Last edit: Anobium 2018-05-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Meanwhile the code as grown to over 280 lines, I considered and corrected these "features" ... I think You can test it with any example like :
"If(test=0) then"
or
"TestLabel :"
Those examples should give You the error message ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Joke : Maybe I am a "cursed programmer" who always finds new "features" in programs ! In 1976 (!) I "succeeded" (!) in crashing a Univac 1110 system by doing a thing that nobody tried before me, and the operators answered that for this reason the (operating) system was not (yet) protected against this operation.
:)
Last edit: Bertrand BAROTH 2018-03-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Bertrand. I have a fix for the IF( error. But, can you confirm that your are programming an Atmel microcontroller? I am not seeing the error with a PIC.
Cheers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you please update your system and test? Use the attachment and place in the ..\GCB@Syn\G+Stools folder. This preprocessor will resovle the issue until we move the main compiler.
In fact, I am programming for the ATmega8.
Now there is an error message :
Controle.gcb (92): Error: If( not permitted. Please insert a space after the IF
And a new error appears ; in order to put a comment I used following syntax :
Case 0 : ' Comment (etc)
Now the space between the value 0 and the colon causes an error.
For Your information, I run Windows 7 professional 64 bits with an I5 quadricore.
Last edit: Bertrand BAROTH 2018-03-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Still the same with "IF(" , the error with the space after the constant in the "case" disappeared again, but the issue with the space between a label and the colon is still here ... It went back to the initial state (excepted that the error message for the "IF(" is now more explicit)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK. Thank you. I will remove the test preprocessor. I will have to move these tests to the main compiler.
The if( is a generic error.
The label error only happens on Atmel microcontrollers.
Test code is:
#chip mega328p
If(test=0) then
End if
' Or
'This label with a space
TestLabel : 'This is a label
Testcode=0 : testcode=1: testcode=3:
select case testl
case 0 : 'testcase
end select
Anobium
Last edit: Anobium 2018-03-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[RESOLVED] in version v0.98.02 May 2018
Hello ...
GC Basic is not CASE sensitive, but it is SPACE sensitive !
An error appears if :
- The keyword "If" is directly followed by an opening parenthesis (without space between), for example in case of evaluation of a complex logical expression with priorities : the compiler sees the IF as a "non-declared Array".
- A space is put between a label and the following colon.
Are they bugs, or normal features ? The fist time it's a little bit surprising ...
Last edit: Anobium 2018-05-23
Can you share the explicit example of the code please ?
Meanwhile the code as grown to over 280 lines, I considered and corrected these "features" ... I think You can test it with any example like :
"If(test=0) then"
or
"TestLabel :"
Those examples should give You the error message ...
May I check. What version of the compiler ?
The version is 0.98.01 date 2017-10-27, SynWrite version 6.22.2290
Thank you. Features are now on the to do list to be resolved.
:'-)
Joke : Maybe I am a "cursed programmer" who always finds new "features" in programs ! In 1976 (!) I "succeeded" (!) in crashing a Univac 1110 system by doing a thing that nobody tried before me, and the operators answered that for this reason the (operating) system was not (yet) protected against this operation.
:)
Last edit: Bertrand BAROTH 2018-03-06
@Bertrand. I have a fix for the IF( error. But, can you confirm that your are programming an Atmel microcontroller? I am not seeing the error with a PIC.
Cheers.
@Bertrand.
Can you please update your system and test? Use the attachment and place in the ..\GCB@Syn\G+Stools folder. This preprocessor will resovle the issue until we move the main compiler.
Let me know the result.
Anobium
In fact, I am programming for the ATmega8.
Now there is an error message :
Controle.gcb (92): Error: If( not permitted. Please insert a space after the IF
And a new error appears ; in order to put a comment I used following syntax :
Case 0 : ' Comment (etc)
Now the space between the value 0 and the colon causes an error.
For Your information, I run Windows 7 professional 64 bits with an I5 quadricore.
Last edit: Bertrand BAROTH 2018-03-11
Revised preprocessor. Please test. Let me know the results.
Note: Test program has been removed.,
Last edit: Anobium 2018-03-12
Still the same with "IF(" , the error with the space after the constant in the "case" disappeared again, but the issue with the space between a label and the colon is still here ... It went back to the initial state (excepted that the error message for the "IF(" is now more explicit)
OK. Thank you. I will remove the test preprocessor. I will have to move these tests to the main compiler.
Test code is:
Anobium
Last edit: Anobium 2018-03-12
I don't know if it is important and changes anything, but I use #option explicit ... Sometimes such details have unexpected effects !
You never know... but, this time I think that #option explicit will make little difference but will check.
FIXED in version v0.98.02 May 2018
Thanks, it works ...
[RESOLVED]