>I'm creating a VFP COM server that passes a HTML table with input controls back to asp based on the fields in a data object. The problem is when I use :
>
>SCATTER NAME faxkey,type,faxno,datesent,covernotes,addnotes NAME loFAxAddEdit
>
>The fields in the Object seem to be automatically put in alphabetic order. Is it possible to alter this ? I am taking the fields in the object and building a Input Control based on the field name and generating the HTML for the control on the fly. I use amembers to find out what is in the object and build a row for each field (Caption from DBGET Prop, Field value in the app. control based on the field). The Methods are written generically to build a table for any data objects that it has the field infomation for.
>
>Thanks
>
>
>Scott
Scott,
You could match the amembers() order to your desired order. A simple way would be to select them into a cursor first :
scatter name "oData"
lnMembers = amembers(laScatter, oData, 1)
for jx = 1 to fcount()
for ix = 1 to lnMembers
if upper(laScatter[ix,1]) == fields(jx)
laScatter[ix,2] = jx
exit
endif
endfor
endfor
asort(laScatter,2)
amembers(,,1) creates it with extra "sorting" column (which is all "property" initially) ;)
Cetin