Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String formula
Message
De
18/09/2001 09:35:34
 
 
À
18/09/2001 09:00:03
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00557739
Message ID:
00557782
Vues:
7
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform