Information générale
Catégorie:
Codage, syntaxe et commandes
>That's the type of comparison I'm imagining anyway:
>
>FoxPro Visual Basic
>
>IIF(,,) IIF(,,)
>+ (string op) & (string op)
>
>
>BTW, I was very surprised to see that VB would let me write:
>
>"Summary report at the " & CONTROL.nLevel & " level"
>
>(where CONTROL.nLevel is a numeric field)
>
>Are there some consistent syntax rules in VB that allows this kind of type mixing or is it more hodge-podge?
You can use above syntax in VB without any doubt. As the first operand is string.
If you use,
ab = 'Hi Friends'
cd = 12
if you use
ab + cd ----> No problem .
ab & cd ----> No problem, Preferable for string concatenation.
If by chance AB gets a numeric value (say 23) , then
ab + cd ----> 25, not '1223'
ab & cd ----> '1223' as you want.
Very simple, if you think.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement