Page 1 of 2
not
Posted: Sun Oct 05, 2003 10:37 pm
by blueznl
#true = 1
#false = 0
a.l = true
if a
...
endif
if not a
...
endif
what more can i say?

Posted: Sun Oct 05, 2003 11:11 pm
by LCD
Good idea, it works fine in Sinclair BASIC, and this was written in 1982. Another good addition from Sinclair Basic would be the string handling
a$="Test"
res$=a$(2 TO 3)
gives "es" in res$.
There is also a bug in Text command. If I try to add a chr()<32 or >127, the added string has a length of 0.
Posted: Sun Oct 05, 2003 11:33 pm
by blueznl
a$(2 to 3) might confuse people with string arrays...
and there's mid(), isn't there
Posted: Mon Oct 06, 2003 4:02 pm
by GPI
LCD wrote:Good idea, it works fine in Sinclair BASIC, and this was written in 1982. Another good addition from Sinclair Basic would be the string handling
a$="Test"
res$=a$(2 TO 3)
gives "es" in res$.
The Basic-Version of the Atari XL/XE do something simulat
Res$=a$(2,3)
This Basic-Variant has also no arrays for strings....
I don't think, that this solution is a good idea. You have mid().
GPI
Posted: Mon Oct 06, 2003 4:20 pm
by blueznl
xl... damn, that brings back memories, got 2 400's, one 800, one 600xl with 256kB laying around here somewhere...
Posted: Tue Oct 07, 2003 6:54 pm
by LCD
blueznl wrote:a$(2 to 3) might confuse people with string arrays...
and there's mid(), isn't there
Sure, there is MID(), but MID uses a length operator for string length, and a$(2 to 3) uses non-relative position pointers, so they can co-exist.
I don't think this will confuse people, as in arrays there is no TO.
I just got now a Atari 800 XL and check this...
Posted: Tue Oct 07, 2003 7:29 pm
by blueznl
mmmm true but it wouldn't be a big gain imho, but heh, it's fred's call...
Posted: Tue Oct 07, 2003 7:45 pm
by GPI
;Sure, there is MID(), but MID uses a length operator for string length, and
;a$(2 to 3) uses non-relative position pointers, so they can co-exist.
I would prefer a new command:
MidPart(a$,start,end)
debug MidPart(a$,2,3)
is better then A$(2 to 3) because there is no confusion with dims. (also i think it is easier to add.)
GPI
Posted: Tue Oct 07, 2003 10:39 pm
by blueznl
yup
Posted: Wed Oct 08, 2003 10:57 am
by blueznl
i've been thinking about wishes for commands that are easily to emulate in code... there's little need for them, unless they make life a lot easier, but unfortunately it can't be solved all the time
see the following code:
#false = 0
#true = 1
Procedure not(expression)
If expression = false
ProcedureReturn true
Else
ProcedureReturn false
EndIf
EndProcedure
OpenConsole()
a.s="a"
b.s="b"
If not(a.s=b.s)
PrintN("<>")
EndIf
If a.s=b.s
PrintN("=")
EndIf
Repeat
Until Inkey()>""
Posted: Thu Jan 22, 2004 11:50 pm
by Dare2
A NOT operator would be more than nice.
Posted: Sat Jan 31, 2004 12:30 pm
by geoff
A NOT operator would be more than nice.
I agree.
Posted: Tue Feb 17, 2004 12:19 am
by Kris_a
Can't you just use ~ to get the compliment of the expression? That sounds (and works) just like 'not', AFAIK.
Edit: ah i see

nevermind
Posted: Tue Feb 17, 2004 12:27 am
by Pupil
It's not the same, and don't work the same, the only time it works the same is when the expression you use it on is False -then it produces the right result..
Example:
Code: Select all
a = 2 ; This will be interpreted as TRUE in a logical statement
b = ~a ; so this should then be FALSE??
if a
Debug "a: TRUE"
else
debug "a: FALSE"
endif
if b
Debug "b: TRUE"
else
Debug "b: FALSE"
endif
Posted: Tue Feb 17, 2004 1:05 am
by Dare2
Using ~ and adding 1 seems to be the same as multiplying by -1, that is, it appears to negate a value. Using ~ is like (val * -1) - 1
Whereas my understanding of NOT is that it returns the opposite of true and false:
Code: Select all
If a=0 ;OR a=#false
a=#true
else
a=#false
endif
I
think Psychophanta created an asm NOT routine for small fast NOTing.