Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scatter Name - Field Order in Object
Message
From
18/02/2000 10:47:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/02/2000 10:03:56
Scott Knight
Human Resources Development Canada
St. John's, Newfoundland, Canada
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00334040
Message ID:
00334078
Views:
21
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform