This from the help on Val(), implying that you can just do the conversion with one command.
BIG EDIT - this command works just as expected. In fact, it is not limited to hex, binary, octal or decimal. Try it in base 5, or whatever. Neat.
a$ ="20"
do
print(val(a$, 8))
print(val(a$, 10))
print(val(a$, 16))
print(val(a$, 5))
Sync()
loop
Quote: "
Val
Description
Converts a string into an integer value. For example Val("10") would return the value 10.
Definition
integer Val( str )
int agk::Val( const char* str )
integer Val( str, base )
int agk::Val( const char* str, int base )
Parameters
•str - The string to convert to an integer.
•base - The base that the string number is in.
"