10-04-2012, 01:17 AM
1)
How can I check what type a variable is?
example
Macro Macro9
2)
I want to check if file names or folder names end with a number.
I have this code
Macro Macro8
whith this function
Function get_last_char
The problem is that the string "check_string" contains a string that ends with '0' (zero).
The 'val' command returns a zero if number is to big or it is not a number.
If I had a string that was "setup_v1.0" the "out x" would result in 0 in the output window.
But how do I know that zero is based on error or actually based on integer value zero?
How can I check what type a variable is?
example
Macro Macro9
2)
I want to check if file names or folder names end with a number.
I have this code
Macro Macro8
str check_string="test_name0"
get_last_char(check_string)
int x=val(check_string)
out x
whith this function
Function get_last_char
/
function str&check_string
str char
int q=len(check_string)
char.get(check_string q-1 1)
check_string=char
The problem is that the string "check_string" contains a string that ends with '0' (zero).
The 'val' command returns a zero if number is to big or it is not a number.
If I had a string that was "setup_v1.0" the "out x" would result in 0 in the output window.
But how do I know that zero is based on error or actually based on integer value zero?