if I do not declare a variable or constant or mistakenly write the name of a function the compiler should not accept its use in the program.
It is right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if I write an expression like this
jojo=jojo
without having declared it "jojo" does not fail.
but if I create a function called "mostrar_01"
and I write "jojo = mostrar_o1" the compiler does not show errors
Correct Both are assignments.
What do you think should be happening?
if I do not declare a variable or constant or mistakenly write the name of a function the compiler should not accept its use in the program.
It is right?
This is correct. Great Cow BASIC creates byte variables automatically. A function typically returns a byte value. The typo simply creates a variable.
We are improving this operation but the current release does not fully support #option explicit.
the undeclared variable can be a variable typed wrongly.
This can be a disaster in monitoring long programs
dim palabra as Word
dim cadena as string
dim simply as Byte
' the variable "casoid" is not declared
palabra=casoid
casoid= palabra * 10
palabra= casoid
do forever
loop
for casoid =1 to 100
palabra=palabra+1
next casoid
end
Yes. Type very carefully. :-) You can inspect the generated ASM for variable surprises. In the example below CASOID is defined.
On a serious note. We are addressing this by adding #option explicit. Do try - but, do not post issues until we formally release the capability.
If I use #option explicit on your example. I get the correct warning.
ok
thank you