Charles,
Would you elaborate a bit more on "&"
In the help file description for the address of operator "@" you state:
@ is similar to the & operator in C.
In the FuncPointers1.o2bas it appears & is used similar to a c++ reference?
"&" is also listed as a substitute for "and" in the O2 help file
I am enjoying going back through all the examples, many must be new since I last tried O2( Well that's not necessarily true my memory is getting a bit flaky) :)
I have encounter a few issues with the examples but I'll wait a bit and list them all later.
James
Hi James,
'&' can be used as a pointer, though my preferred symbol is '@'
I thoughtof 9 different uses for '&'. It is the most overused symbol in Basic, especially in o2 :)
'USES OF '&'
'
'print &h101 '257
'print &o101 '65
'print &b101 '5
'print "ok" & "ay" 'okay 'string concatenator
int a=15
'print a & 19 'bitwise and: 3
'print a && 19 'logical and: -1
'print (&a) 'address eg: 5844992
'int a& = 67 'name char suffix
'print a& '
'int a&b = 67 'name embedded character
'print a&b '
Quote'print "ok" & "ay" 'okay 'string concatenator
it is ok
but i prefer more logical to me
'print "ok" + "ay" 'okay 'string concatenator
Yes, there are alternatives for nearly all of the '&' symbol.
Only '&&' is required for logical 'and'
'print &h101 '257
'print 0o101 '65
'print 0b101 '5
'print "ok" + "ay" 'okay 'string concatenator
'int a=15
'print a and 19 'bitwise and: 3
'print a && 19 'logical and: -1
'print @a 'address eg: 5844992
Hallo Charles
I guess you should just copy that paragraph and put it into the help-file.
Hello,
I put these notes in the help file.
cheers.
http://www.jose.it-berater.org/smfforum/index.php?topic=5787.msg24565#msg24565