Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.ini files
Message
De
31/10/1998 11:24:24
 
 
À
31/10/1998 11:14:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00150938
Message ID:
00153171
Vues:
34
>>>That's cool. It sounds like that would be good for general system variables, but I don't think it would be good for saving the grid settings. I don't want a bunch of variables for that.
>>>
>>>Thanks,
>>>
>>>-Michelle
>>
>>It doesn't seem like a bunch of variables if you have everything in an array. I'm convinced that a simple array would be enough to store all grid settings. For example:
*After user made his/her prefferences
>>DIMENSION gaGrid[1]
>>FOR i=1 TO Thisform.Grid.ColumnCount
>>   gaGrid[i] = Thisform.Grid.Columns(i).Width
>>ENDFOR
>>SAVE TO < UserID >.MEM ALL LIKE gaGrid*
>>********
>>* Grid.Init()
>>RESTORE FROM < UserID >.MEM
>>FOR i=1 TO This.ColumnCount
>>   This.Columns(i).Width = gaGrid[i]
>>ENDFOR
>
>Good point, but I tend to use SAVE TO MEMO for something like that; it allows you to have a table with user preferences. Rather than a .MEM file per user, you could have a table with grid preferences. A simple example; imagine a table GridPref with a UserID C(??), a GridID I, and a memo field GridSets. To take your example a step further. NB. This is greatly oversimplified.
>
>
>* Grid.Init()
>*
>SELECT GridPref
>LOCATE FOR UserID = cMyCurrentUserID AND GridID = this.iGridIDKey
>IF FOUND()
>   RESTORE FROM MEMO GridSets ADDITIVE
>   *  And use the restored arrays to set your grid;  all start with iaGrid
>   RELEASE ALL LIKE iaGrid*
>ELSE
>   *  The user never has been here, so he doesn't have a pref saved
>ENDIF
>
>*  Grid.Release()
>*
>SELECT GridPref
>LOCATE FOR UserID = cMyCurrentUserID AND GridID = this.iGridIDKey
>IF ! FOUND()
>   INSERT INTO GridPref VALUES (cMyCurrentUserID, this.iGridIDKey)
>ENDIF
>* Save your settings to arrays starting with iaGrid
>SAVE TO MEMO GridSets ALL LIKE iaGrid*
>
>
>This provides a starting point for a general mechanism for saving your preferences and restoring them, without having to save lots of individual files and coming up with a complex .MEM file naming scheme.

I totaly get your point, Ed. However, the whole point here as far as I'm concerned is to avoid use of tables to keep user prefferences. Michelle might do that in this particular case, as it's not that much, but I always assume that user's will desire more and more prefferences to be saved, and I'm usually right. Therefore I use a combination of .mem files and WinRegistry (specially this).
Danijel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform