I need to know how to delete from the end of a variable.
ex: calc = 3432 to calc = 343, get it? :rolleyes:
Printable View
I need to know how to delete from the end of a variable.
ex: calc = 3432 to calc = 343, get it? :rolleyes:
calc=left(calc,len(calc)-1)
oops, just notice that was a numeric variable ... try this:
calc = Left(CStr(calc), Len(CStr(calc)) - 1)
If you need to retain the data type, I think you may need to do this...
calc = cint(Left(CStr(calc), Len(CStr(calc)) - 1))
EDIT: No, muddy's right, I had assumed that CSTR converts it to a string type
sir frog,Quote:
Originally posted by mendhak
If you need to retain the data type, I think you may need to do this...
calc = cint(Left(CStr(calc), Len(CStr(calc)) - 1))
EDIT: No, muddy's right, I had assumed that CSTR converts it to a string type
I think it depends on the declared type of calc. if calc is integer then the calculation will be coerced (is that the right techy jargon?) to integer.