|
-
Oct 27th, 2002, 12:20 AM
#1
Thread Starter
Junior Member
Deleting from a variable...
I need to know how to delete from the end of a variable.
ex: calc = 3432 to calc = 343, get it?
"If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?" - Steven Wright
-
Oct 27th, 2002, 12:33 AM
#2
PowerPoster
calc=left(calc,len(calc)-1)
-
Oct 27th, 2002, 12:36 AM
#3
PowerPoster
oops, just notice that was a numeric variable ... try this:
calc = Left(CStr(calc), Len(CStr(calc)) - 1)
-
Oct 27th, 2002, 12:56 AM
#4
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
-
Oct 27th, 2002, 01:01 AM
#5
PowerPoster
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
sir frog,
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|