View Full Version : Simple question about hex values
Michael Clease
25-05-2007, 14:56
how do you use hex values ie.
mylong = &FF (255)
I know this sounds really lame but I havent used any form of basic for about 15 years but I am quite impressed with thinbasic seems quite easy to use.
I would like to see some more examples in the help file (or expand the ones already done).
ErosOlmi
25-05-2007, 15:54
&H...
examples:
%MINCHAR = &H80
%MAXCHAR = &H7F
%MINSHORT = &H8000
%MAXSHORT = &H7FFF
%MINLONG = &H80000000
%MAXBYTE = &HFF
%MAXWORD = &HFFFF
%MAXDWORD = &HFFFFFFFF
Regarding help, hard to bealive but we put more effort on it than in thinBasic itself.
Anyhow we will try to put more.
Thanks
Eros
Michael Clease
25-05-2007, 16:14
thanks i knew you answer it.
why not get people to post some short examples a cherry pick the good ones.
ErosOlmi
25-05-2007, 16:40
Good idea.
I will make a dedicated forum for that.
ErosOlmi
25-05-2007, 18:03
Here it is: http://community.thinbasic.com/index.php?board=108.0
sandyrepope
26-05-2007, 02:55
I would like to see some more examples in the help file (or expand the ones already done).
Did you have any examples in mind? I'm sure that if you tell others what exactly you would like then someone will be willing to do them.
Sandy
Update to my message: When I wrote this message I didn't understand exactly what was going on and what Abraxas said. (You were clear but I got the wrong idea on my own.) I really made a blunder with what I said! I realize now that I didn't have the right to make the suggestion about others on the forum. I'd like to say that I'm sorry for that. I'll be more careful about what I post in the future. Sandy
Michael Clease
26-05-2007, 09:08
I dont think i was clear, i didnt mean examples as per the "introducing thinbasic" section (but not a bad idea) i was thinking more along the line of each instruction.
take the SHIFT command in the CORE module has no example.
' Usage of the SHIFT Instruction example
'
' Binary Divide by 2 (no remainder)
DIM MyByte AS BYTE VALUE &h08 ' Initialise Byte to 8
DIM sMsg as String
sMsg += "Original Byte Value " & Hex$(MyByte,2) & $CRLF & $CRLF
SHIFT SIGNED RIGHT MyByte,1 ' Binary Divide by 2 probably quicker than a /
sMsg += " New Byte Value " & Hex$(MyByte,2) & $CRLF
msgbox 0, sMsg
Something along those lines, anything to flesh out the help file.
ErosOlmi
26-05-2007, 09:46
Perfect Abraxas. I will add to help file.
Hope it will be the first of a long "suggestion story" http://community.thinbasic.com/index.php?board=108.0
Thanks
Eros
ErosOlmi
26-05-2007, 10:09
I would like to see some more examples in the help file (or expand the ones already done).
Did you have any examples in mind? I'm sure that if you tell others what exactly you would like then someone will be willing to do them.
Sandy,
I think that from a user point of view Abraxas suggestion is valid and perfect. The problem is that we always fight between our real life time and our passions time. We think our help files are not so bad even if compared with many commercial products around but we agree we have to put more effort on it.
What Abraxas suggested was a community contribution to create little pieces of source code very specific to single keywords. Than we will bring those example adding to the help file under that specific keyword. We think this is a great opportunity for all. So we have created a specific forum where to collect all code contribution.
Ciao
Eros