Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro changes variable type
Message
From
08/02/2002 11:55:23
 
 
To
07/02/2002 15:01:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00616675
Message ID:
00617480
Views:
22
Make this change to THISFORMSET.acCommands[]:

save_FridgLabel(lcIndex, 20, 10)
save_FridgLabel(lcIndex, 20, 5)
save_FridgLabel(lcIndex, 10, 10)
etc.

And try this:
FOR i = THISFORMSET.nStart TO THISFORMSET.nEnd
	FOR lnPosCommands = 1 TO ALEN(THISFORMSET.acCommands)

		lcIndex = TRANSFORM(i) && <<<<<<<<<<< NEW

		EVALUATE(THISFORMSET.acCommands(lnPosCommands))
	ENDFOR
	=MESSAGEBOX(VARTYPE(i)) &&<= displays 'C'
	*i = Val(i)
ENDFOR
>>You don't need macro substitution:
>>
>>
>>FOR i = THISFORMSET.nStart TO THISFORMSET.nEnd
>>	FOR lnPosCommands = 1 TO ALEN(THISFORMSET.acCommands)
>>*		lcCommand = THISFORMSET.acCommands(lnPosCommands)
>>*		&lcCommand
>>		EVALUATE(THISFORMSET.acCommands(lnPosCommands))
>>	ENDFOR
>>	=MESSAGEBOX(VARTYPE(i)) &&<= displays 'C'
>>	*i = Val(i)
>>ENDFOR
>>
>>
>>Check THISFORMSET.acCommands[], may have "i = ALLTRIM(STR(i))"
>>
>>Is i being passed by reference to any of the functions?
>
>i is never passed by reference (no @) and all the commands in acCommands are basically the same function call with different parameters (only the last two change):
>
>save_FridgLabel(ALLTRIM(STR(i)), 20, 10)
>save_FridgLabel(ALLTRIM(STR(i)), 20, 5)
>save_FridgLabel(ALLTRIM(STR(i)), 10, 10)
>etc.
>
>The function save_FridgLabel is in a DLL and is defined as follows:
>
>extern "C" __declspec(dllexport) LONG save_FridgLabel(LPSTR, LONG, LONG);
>
>
>Is it because of the DLL function (even though the LPSTR seems appropriate)?
>
>Stephane.
>
>
>P.S. The first parameter of the function is never used a left operand in the C function.
Previous
Reply
Map
View

Click here to load this message in the networking platform