Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generic object property reference
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01013029
Message ID:
01013161
Views:
22
sergey,

as i noted in the post, amembers only creates an array, that you can use as a pointer to part of an object. with repeated use of amembers on 1st rates, then the individual rate objects of wheelchair, ambulatory etc, i could build pointers to the various properties of each rate. but that wouldnt help with trying to directly address rates.xxx.description for example to test it for 'AM'.

i am looking for a way to say 'show me the value of this objects_itemno'1, 2, 3, 4, etc. thru the whole list of properties of that object without knowing the names of them. i thought for each might be what would be the 'name' of the thing i would be cycling. you cant say 'for each property, do thus and such.

i am beginning to believe there is no native way to address the items in an object w/o knowing its real name. the only thing approximating it is the amembers call.

thanks.

jim



>See AMEMEBERS() function.
>
>>there are commands in vfp for refering to the fields in a table, generically.
>>
>>2 would be fields(),fcount().
>>
>>i guess i am trying to find similar commands for an object.
>>
>>thru perversity rather than need, i am attempting to store a small table as an object and then use this in code in lieu of scanning thru the table looking things up.
>>
>>i can manage to find some of what i want with the amembers command and stick the properties in an array and use it to 'feed' my code, but geez, its seems like there would be something more specific.
>>
>>can someone suggest how i can take an object that would look like the following
>>
>> rates (ojbect)
>> ambulatory wheelchair buspass (object)
>> description description description (property)
>> billcode billcode billcode
>> billamount billamount billamount
>> company company company
>>
>>this is analagous to a table called rates, with rows of ambulatory, wheelchair, buspass, and fields of description, billcode,billamount, company
>>
>>in table code i would
>>use rates
>>scan
>>do case
>> case 'AM' $ description && dont NEED to know this is wheelchair or buspas
>> ** execute the billcode
>>endcase
>>endscan
>>
>>this works fine if i even add MORE rows, or have only 1.
>>
>>
>>
>>how can i 'scan' the rates object to do the same?
>>
>>i cant figure how to conquer pointing to the 'general' obj/obj/property
>>
>>for beginObjectPropertyList to endObjectPropertyList
>>do case
>> case 'AM' $ rates.xxxxx.description
>>endcase
>>endfor
>>
>>as i dont know how to refer to the .xxxxx.
>>
>>thats my problem.
>>
>>thanks.
>>
>>jim@sturtzs.com
jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform