Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scatter Name - Field Order in Object
Message
De
18/02/2000 10:47:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/02/2000 10:03:56
Scott Knight
Human Resources Development Canada
St. John's, Terre-Neuve, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00334040
Message ID:
00334078
Vues:
20
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform