Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loopin a variable length array
Message
From
20/02/1999 18:16:06
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00189697
Message ID:
00189710
Views:
19
Hi Ed,

I tried an approach very close to this very early in development. The problem I found is that when you save the name of a control as a string, you when have to EVALUATE() the string to get a reference to the control object so you can have access to the object's methods. The EVALUATE() process actually takes a significant amount of time and it is faster to store the control object by reference -- even at the risk of an orphan object hanging up the form.

Thanks, though, for the idea. I have another place where it should work very well,

regards,

JME

- snip -

>An approach that might work for you would be to use a string as a singly linked list; when the string is empty, you've finished. Your code might look something like:
>
>
cListToProcess = ""
>#DEFINE cSepChar  '~'
>cListToProcess = STR(nFirstElementToRecalc)
>* add as many items as you want with AddElement(@cListToProcess, nRecalcItem)
>DO WHILE LEN(cListTOProcess) > 0
>   ReCalcElement(VAL(cListToProcess))  && and other parms, probably including
>                                       && cListToProcess by reference if it
>                                       && might be extended during recalc
>   nSepAt = AT(cSepChar, cListToProcess)
>   IF nSepAt = 0
>      cListTOProcess = ''
>   ELSE
>      cListToProcess = SUBST(cListToProcess, nSepAt + 1)
>   ENDIF
>ENDDO
>*
>*
>*
>FUNCTION AddElement
>LPARAMETERS cList, nThingToAdd
>cList = cList + cSepChar + STR(nThingToAdd)
>RETURN
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform