ftp://foxincloud.com/ab/
to grab the whole package

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud
http://foxincloud.com/

Le 05/04/13 17:16, Dave Crozier a écrit :
Thierry,
Link to AB.H missing

Dave


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Thierry Nivelet
Sent: 05 April 2013 15:51
To: [email protected]
Subject: Re: Unbearable Lightness/Heaviness of Arrays

In ftp://foxincloud.com/ab/abArray.prg, you'll find free array functions:
aAdd
aAppend
aChars
aClear
aColDel
aColsDel
aColsDelim
aColsDelim_nColsSep
aColsIns
aDistinct
aFilter
aLinesCols
aLitteral
aLocate
aLookup
aPop
aPush
aReverse
aRowCopyIns
aRowDel
aRowMove
aSelect
aStrExtract
aSubstract
aVarType
laEmpty
laEqual
laOccurs

Thierry Nivelet
FoxInCloud
Give your VFP app a second life in the cloud http://foxincloud.com/

You can have the whole library for free by running FoxinCloud Adaptation 
Assistant or by ftp://foxincloud.com/ab/

Le 05/04/13 04:44, Ken Dibble a écrit :
This may be a question for Christof or someone with similar deep
knowledge of how VFP works.

I use arrays a LOT.

I DIMENSION, ASCAN(), ADEL(), and ASORT() them, and consult their
ALEN()s constantly. I iterate through them and perform actions on
their elements repeatedly. Sometimes I even AINS() them.

I'm thinking it would be wise to create a class that encapsulates this
stuff and clean out all my duplicated use of those commands and
functions. It certainly would put an end to unexpected "Array
dimensions invalid" errors when I forget to check an ALEN() somewhere.

I think the class would have an array property, and methods to carry
out those functions on it. Whenever I need an array I'd instanciate
the class, if necessary ADDOBJECTing it to another object.

I can easily see how to do this.

My question is, what is the "weight" of having potentially several
dozen instances of this array object hanging around in memory, even
if, for some of them, I will only need one or two of the object's
capabilities? Is this a bigger drain on resources than just
duplicating array manipulation code whenever I need it?

I'm thinking that I remember hearing that VFP only really stores one
instance of a class's structure in memory no matter how many times
it's instanciated in code, then uses reference counters and maybe some
kind of "diff" function to keep track of the values of the class
properties associated with each instance. If that's true, maybe this
isn't something to worry about.

I know that the answer is "Test it and find out." Writing a test of
this proposition will probably take longer than creating the class,
and creating the class will take a while, considering all the stuff I
want in it. So if it wouldn't take someone very long to answer this
question, I would sure appreciate it.

Thanks.

Yours in Keeping VFP Something to Talk About,

Ken Dibble
www.stic-cil.org




[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to