Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCATTER in a COM Object
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00834954
Message ID:
00835784
Views:
22
>Larry,
>
>Not totally sure I understand. Could you elaborate a bit?
>
>Thanks

Kevin,
Basically the return object would look something like this:
define class cusReturn as custom
dimension apropnames[1]
apropnames[1] = (space(0))
npropnum = 0

procedure AddFieldProps
lparameter tcfieldname, tufieldvalue

if THIS.AddProperty(tcfieldname, tufieldvalue) then
   if empty(THIS.apropnames[1]) then
      THIS.apropnames[1] = tcfieldname
   else
      local narrlen
      narrlen = THIS.npropnum+1
      dimension THIS.apropnames[narrlen]
      THIS.apropnames[narrlen] = tcfieldname
   endif
endif

endproc

procedure npropnum_access
return alen(THIS.apropnames,1)
endproc
enddefine
On the outside, you could access the array like this:
local lox, lcproperty, luvalue
lox = * get return object *
for lxx = 1 to lox.npropnum
   lcproperty = 'lox.' + lox.apropnames[lxx]
   luvalue = evaluate(lcproperty)
endfor
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform