converting a string 2 an integer
-
- Posts: 274
- Joined: Oct 13, 2005 2:05
- Contact:
converting a string 2 an integer
can some one show me how to convert a string in to an integer? please?
-
- Posts: 612
- Joined: Jun 15, 2005 13:22
- Location: Upstate NY
- Contact:
Hi ShadowDust
Try
Try
Code: Select all
DIM IntegerValue AS INTEGER
IntegerValue = VAL("3423")
PRINT IntegerValue
-
- Posts: 334
- Joined: May 29, 2005 1:45
- Location: At my Computer
- Contact:
Example with a string variable:
;)
Code: Select all
Strng$ = "100"
Num = VAL(Strng$)
PRINT Num
"&h" is only for literal expressions, like &h40, or &h24. Internally, the computer only knows numbers (well, technically, binary). So if you do this:
It's the exact same as doing this:
HOWEVER, colors are a little simpler if you forgo the HTML convention and use the RGB macro:
Code: Select all
x = &h40
There's literally no difference. So you can do this:x = 64
Code: Select all
c = &h30
Circle (x, y), z, c
Code: Select all
Circle(x, y), z, Rgb(255, 128, 0)