Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String formula
Message
From
18/09/2001 09:35:34
 
 
To
18/09/2001 09:00:03
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00557739
Message ID:
00557782
Views:
8
The "evil type coercion" problem. I would suggest the use of conversion functions (CStr(), CInt(), etc.) whenever you need to convert data types. They will be easier to read and easier to debug. For example, your implicit conversion code below could be replaced with:
x = CStr(xx + (100 * 2))
Now isn't that more explicit and self-explanatory?

HTH

>I want to process for getting some result of the formula, but there is funny result occurs, does any body can help me please..
>
>option explicit
>Private Sub Command1_Click()
>Dim x As String
>Dim xx As Integer
>xx = 2
>x = "xx+(100*2)"
>MsgBox x ' This should be 202 --> but it shown the xx+(100*2)
>End Sub
>
>Thanks in advance for any idea or suggestion ..
>
>
>Best regards
>Winan
Previous
Reply
Map
View

Click here to load this message in the networking platform