About the SELECT statement:
Several basic compilers allow the use of this instruction with multiple variables on the same line.
Example:
SELECT CASE GOOFY
CASE A
.........
CASE B, F, T
........
END SELECT
Why has this function not been implemented?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Because unlike Computer Implementations of BASIC, Microcontrollers are RAM constrained.
In addition to that the RAM in PIC Microcontrollers is segmented.
As a result variable /RAM use is the largest constraints on what gets implemented.
In fact I am often surprised at the fact that such an extensive set of commands are available and yet Great Cow BASIC still compiles to efficient machine code, unlike the other versions of basic for PIC that are not true compilers and offer only a fixed set of variables.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"unlike the other versions of basic for PIC that are not true compilers and offer only a fixed set of variables."
b0-b55 ? :)
;
What's the difference between using case var and using if var then do code : goto end test (to skip following if var= tests, in speed and memory comparison.
I ask because originally basic was interpreted and slow so I used "tricks" to speed it up..
like use if var1=val then if var2=val then , instead of if var1 and var2=val then. (so if var1 <> val it will skip 2nd if then so faster than and which is 2 tests)
Looking at gcb asm output would mean little to me so don't know what is faster code.
I like to play with glcds and that's were you can see code speed differences.
Is reading data from a table faster than reading from a variable( array)?
Is this worth opening a topic on? ie write faster code with gcb.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About the SELECT statement:
Several basic compilers allow the use of this instruction with multiple variables on the same line.
Example:
SELECT CASE GOOFY
CASE A
.........
CASE B, F, T
........
END SELECT
Why has this function not been implemented?
Because unlike Computer Implementations of BASIC, Microcontrollers are RAM constrained.
In addition to that the RAM in PIC Microcontrollers is segmented.
As a result variable /RAM use is the largest constraints on what gets implemented.
In fact I am often surprised at the fact that such an extensive set of commands are available and yet Great Cow BASIC still compiles to efficient machine code, unlike the other versions of basic for PIC that are not true compilers and offer only a fixed set of variables.
Improvements to select case were added at v0.97.01 change 400. The Help shows these new capabilities.
So, are you asking for an enhancement? Chris makes the case very well. We need to think every time we extended.
"unlike the other versions of basic for PIC that are not true compilers and offer only a fixed set of variables."
b0-b55 ? :)
;
What's the difference between using case var and using if var then do code : goto end test (to skip following if var= tests, in speed and memory comparison.
I ask because originally basic was interpreted and slow so I used "tricks" to speed it up..
like use if var1=val then if var2=val then , instead of if var1 and var2=val then. (so if var1 <> val it will skip 2nd if then so faster than and which is 2 tests)
Looking at gcb asm output would mean little to me so don't know what is faster code.
I like to play with glcds and that's were you can see code speed differences.
Is reading data from a table faster than reading from a variable( array)?
Is this worth opening a topic on? ie write faster code with gcb.