Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object vs. array?
Message
 
 
To
25/08/2009 05:28:52
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01420180
Message ID:
01420422
Views:
83
Hi Sergio,

>
>You can pass also entire cursors around. Have look at FAQ#29297 on UT which provides set of functions for doing so.
>Down the line scenario is to store cursor into object properties (arrays) and then pass this around.
>It might be handy in these kind of situations, especially when parsing smaller cursors between BO's which are based on session
>(between datasessions)
>Version in FAQ is limited to smaller cursors, whereas I can email you newer VFP9 version which has no limit (as arrays got unlimited in size) except for memory limits.
>
>* * *
>
>Also there is possibility of copying cursors to temporary free table and then passing table name around
>It works very fast and with little bit of wrapping up it can be also made to be generic.
>For instance you can copy free table to win temp folder with unique name generated by using let say
>
>local cPassFileName
>cPassFileName = Sys(2015) &&random string
>select myCursor
>copy to (Sys(2023) +'\'+ cPassFileName)
>&& Now pass this variable to your BO anywhere
>
>
>
>On the the other side you open free table, consume data and consecutively clean up temp folder.
>
>
>lparameters cPassFileName
>if file(Sys(2023) +'\'+ cPassFileName)
>  use (Sys(2023) +'\'+ cPassFileName) in 0 alias myData
>  && do something with it 
>  select myData
>  use
>  erase (Sys(2023) +'\'+ cPassFileName)
>endif
>
>(Untested. Tune to your satisfaction.)
>
>
>Cursors & tables is what FoxPro is good with. Why not use it :)
>

Thank you for your suggestions and sample code. Please also see my reply to Christof for how I am choosing to deal with data being passed around.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform