Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50 - Saving the BROWSE field order
Message
From
08/04/1997 08:43:44
 
 
To
08/04/1997 05:12:47
Jean-Pierre Overbeek
New Limit Database Solutions
Amsterdam, Netherlands
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00027248
Message ID:
00027390
Views:
27
>>If I am using a browse in my program and when I am
>>viewing the browse, I want to put the fields in a different order, can I save this new order?
>
>Hello Robert,
>
>Here is my solution:
>Create a table GRID: Name C(20),Propertie C(20),SETTING M()
>And an index on Name+Propertie
>
>*** Add this to the INIT of your grid
>IF !SELECT("GRID")>0
> IF FILE("GRID.DBF")
> USE GRID IN 0 ORDER 1
> ENDIF
>ENDIF
>IF SELECT("GRID")>0
> SELECT GRID
> SET KEY TO LEFT(This.Name+SPACE(100),LEN(Grid.Name))
> GOTO TOP
> SCAN
> IF OCCURS("|",Grid.Setting)=This.ColumnCount
> h_setting=Grid.Setting
> FOR h_column=1 TO This.ColumnCount
> h_propertie="This.Columns("+ALLTRIM(STR(h_column))+")."+ALLTRIM(Grid.Propertie)
> h_val=LEFT(h_setting,AT("|",h_setting)-1)
> &h_Propertie=VAL(h_val)
> h_setting=SUBSTR(h_setting+" ",AT("|",h_setting)+1)
> NEXT
> ELSE
> h_propertie="This."+ALLTRIM(Grid.Propertie)
> &h_propertie=VAL(Grid.Setting)
> ENDIF
> ENDSCAN
>ENDIF
>
>*** Add this to the DESTROY of your grid
>IF SELECT("GRID")>0
> *** ColumnOrder
> h_setting=""
> FOR h_column=1 TO This.ColumnCount
> h_setting=h_setting+ALLTRIM(STR(This.Columns(h_column).ColumnOrder))+"|"
> NEXT
> IF !SEEK(LEFT(This.Name+SPACE(100),LEN(Grid.Name))+"ColumnOrder","Grid")
> INSERT INTO GRID (Name,Propertie,Setting) VALUES (This.Name,"ColumnOrder",h_setting)
> ELSE
> REPLACE Grid.Setting WITH h_setting
> ENDIF
>ENDIF
>
>This saves and restore the column order. You can add other properties also, but I think Column order is most essential.
>
>Greetings,
>Jean-Pierre

Hi Jean-Pierre... thanks for the code, I will try it...Rob
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform