gtBASIC
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: gtBASIC
Is command INT(x) implemented in this version of basic ?
Re: gtBASIC
Is command INT(x) implemented in this version of basic ?
Re: gtBASIC
I have found issues with comparative logic in IF..THEN statements
IF (A=15 AND O<>20 AND O<>1) OR (A=29 AND O<>16) OR O>C3 THEN...
This gives error 'syntax error in number literal'
IF (A=15 AND O<>20 AND O<>1) OR (A=29 AND O<>16) OR O>C3 THEN...
This gives error 'syntax error in number literal'
Re: gtBASIC
Replace that line with this for now:
Code: Select all
IF ((A=15) AND (O<>20) AND (O<>1)) OR ((A=29) AND (O<>16)) OR O>C3 THEN
Re: gtBASIC
Have an issue with the compile now when it gets to the ASM stage.
- Attachments
-
- issue.jpg (166.86 KiB) Viewed 2827 times
Re: gtBASIC
SORRY !!!! Stand alone this code worked. In the middle of my application it isn't. I will do more testing around that new knowledge
I have found an issue with the VAL function
AAA$ = "7This is a test"
NNN$=LEFT$(AAA$,1)
PRINT NNN$
N = VAL(NNN$)
PRINT N
Result:
7
0
IF I do VAL("7") it works
The ASM looks correct when in the program but it prints 0
LDWI 0x75a0
StringCopy ; NNN$=LEFT$(AAA$,1)
LDWI 0x75a1
IntegerStr
STW _N ; N = VAL(NNN$)
LDW _N
PrintAcInt16
NewLine ; PRINT N
I have found an issue with the VAL function
AAA$ = "7This is a test"
NNN$=LEFT$(AAA$,1)
PRINT NNN$
N = VAL(NNN$)
PRINT N
Result:
7
0
IF I do VAL("7") it works
The ASM looks correct when in the program but it prints 0
LDWI 0x75a0
StringCopy ; NNN$=LEFT$(AAA$,1)
LDWI 0x75a1
IntegerStr
STW _N ; N = VAL(NNN$)
LDW _N
PrintAcInt16
NewLine ; PRINT N
Re: gtBASIC
This was a design choice, I coded that particular function in the runtime so that if there are any non-alpha chars, (apart from the -ve symbol), in the string then it would return 0. This function would be 2x or maybe even 3x bigger to handle all cases properly and I deemed it not worth the waste of RAM.
One of the critical design choices was to make the runtime as small, fast and efficient as possible, as well as no runtime function being over 96bytes in length, (except for critical one such as INPUT/etc that use _ext subs), so that 32K RAM users would not lose their >96 byte segments and pages to the runtime, i.e. the runtime always tries and fits into the offscreen 96 byte segments, (unless you specify otherwise).
If you'd like to change it to work the way you want, then head on over to runtime\numeric*.i and modify the integerStr function.
One of the critical design choices was to make the runtime as small, fast and efficient as possible, as well as no runtime function being over 96bytes in length, (except for critical one such as INPUT/etc that use _ext subs), so that 32K RAM users would not lose their >96 byte segments and pages to the runtime, i.e. the runtime always tries and fits into the offscreen 96 byte segments, (unless you specify otherwise).
If you'd like to change it to work the way you want, then head on over to runtime\numeric*.i and modify the integerStr function.
Re: gtBASIC
UPPER$ says 'unknown symbol UPPER$'
used as
K$=UPPER$(K$)
used as
K$=UPPER$(K$)