Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong Type of Variable
Message
From
17/12/2004 03:30:14
 
 
To
17/12/2004 01:29:47
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969940
Message ID:
00969962
Views:
15
This message has been marked as the solution to the initial question of the thread.
_TALLY is NEVER empty, AFAIK, but it is 0 when you don't find any records.
And TRANSFORM is very flexible in converting any data into a string.
LnTotal = IIF(_TALLY=0, 0, LaTemp(1))
LcMessage = "Amount of it is " + TRANSFORM(LnTotal,'@B 99999')
>In this command:
>
>SELECT SUM(JN6.nJN6_3) FROM FORCE JN6, JN5, JN2, JN1 WHERE JN6.nJN6_8 = JN5.nJN5_1 AND ;
>JN5.nJN5_2 = JN2.nJN2_1 AND JN2.nJN2_3 = JN1.nJN1_1 AND JN1.nJN1_1 = LnCurentCompany AND ;
>JN6.nJN6_1 = GnYear AND JN6.nJN6_2 = GnMount INTO ARRAY LaTemp
>LnTotal = IIF(EMPTY(_TALLY), 0, LaTemp(1))
>
>Variable LnTotal have a value as 0 because SUM(JN6.nJN6_3) is 0.
>
>I want to change type of LnTotal from Number to String by STR() function but value of ALLTRIM(STR(LnTotal)) is 0 (No "0") and I can not add it to a string. For example:
>LcMessage = "Amount of it is " + ALLTRIM(STR(LnTotal))
>Value of LcMessage is 0
>But when SET ENGINEBEHAVIOR 80 it works correct! And value of LcMessage is "Amount of it is 0"
>I can not change type of LnTotal and every variables that makes as LnTotal!
>I want to have SET ENGINEBEHAVIOR 90 but I can do this.
>Please help me.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform