|
-
Jan 27th, 2000, 08:52 AM
#1
Thread Starter
Hyperactive Member
In the MSDN files, it says that you can convert a string to an integer if the string is in an integer format. Here is what it says you can do:
Code:
strprice = "100.00"
intprice = strprice
This code works, but I need something different. What I need to do is something more like this:
Code:
For i = 0 to 5
strprice = MSHFlexgrid.TextMatrix(i, 4)
intprice = strprice
Next i
However, when I do that, it gives me an error because the datatypes are different. What can I do to fix this problem?
------------------
Ryan
-
Jan 27th, 2000, 09:48 AM
#2
Hyperactive Member
Why don't you just convert it into an integer the good ol' fashioned way (Cint(String Expression)) and then use the format function to convert it to whatever (in this case, Format(Cint(String Expression), "####0.00").
-
Jan 27th, 2000, 11:34 AM
#3
So Unbanned
ACTUALLY the 'good 'ol fashion way' would be simply this:
Val(String)
Simple ain't it!
And a integer to a string?
Str(Integer)
Just as simple!
------------------
DiGiTaIErRoR
VB, QBasic, Iptscrae, HTML
Quote: There are no stupid questions, just stupid people.
-
Jan 28th, 2000, 01:02 AM
#4
Thread Starter
Hyperactive Member
Thanks, it works great now!
------------------
Ryan
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
|