Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax for passing array causes compile error
Message
From
29/06/1999 18:35:33
 
 
To
29/06/1999 18:24:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00235565
Message ID:
00235581
Views:
23
>>>I have a form that passes an entire array by reference as follows:
>>>THISFORM.PrintReport(@laNewInvoices)
>>>
>>>Then inside of the PrintReport() method I call a .prg and again pass the entire array as follows:
>>>DO (oapp.csyspath+'reports\rpsojour.prg') WITH laNewInvoices
>>>
>>>It took me awhile to figure out that I had to pass the array in the DO command without the @ (i.e. DO whatever.prg WITH @laNewInvoices results in syntax error).
>>>
>>>I receive the array in my rpsojour.prg just fine as follows:
>>>LPARAMETERS aNewInvoices
>>>
>>>I don't understand how I'm recieving the entire array without the @, and having UDFPARMS set to VALUE, but it works. The problem is, whenever I compile my .exe I get the following error:
>>>
>>>Program c:\majdata\reports\rpsojour.prg has the following errors:
>>> Unknown ANEWINVOICES - Undefined
>>>
>>>why is anewinvoices undefined and how do I get around it? I've been ignoring the compile error until I've had a chance to figure this out. My code is working as desired.
>>
>>Ok, now I know why my array gets passed by reference thanks (Eric M. and Jim B. on Thread #235291 Message #235373) since arrays are always passed by reference with the DO command. Too bad the search function doesn't work on current messages in the Queue, didn't see this thread until it was too late.
>>
>>Now I'm still left wondering about the compile error....
>
>Ok, here's some more clarification, the actual code that is causing the compile error is not the array declarations/passing, but a reference to the array in rpsojour.prg:
>
>IF TYPE('aNewInvoices[lni]') == 'N'
>
>How do I get around this?

figured out that I would just declare another array locally, use ACOPY() to copy my passed array, and then just reference the new array instead of the passed one. Seems like it should be unecessary, but it works.

How bout a prize for the longest thread carried on by one person?

(straight jacket perhaps...)
Previous
Reply
Map
View

Click here to load this message in the networking platform