Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I permanently remove aliases from GETEXPR
Message
De
01/10/2000 01:11:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00422941
Message ID:
00423218
Vues:
12
Bharat,

>when I use:
> GETEXPR to X
>
>in the get expression dialog box, I can click on the OPTIONS button and select "NEVER ADD AN ALIAS".
>
>How do I set this programmatically ?

First, those options are stored in a record in "foxuser.dbf" with ID="GETEXPR", assuming you have SET RESOURCE ON and the table is not marked READONLY. You can set up the options the way you want them and then set the table back to READONLY, or just that record's READONLY field to .t.

However, if you need to turn the option on and off inside your program, how about this:

1) first, in development mode set up a foxuser table with the GETEXPR options the way you want them.
SET RESOURCE OFF
USE foxuser  && might need a path
* create an empty resource file
COPY STRUCTURE TO myresource
USE
* now make it current
SET RESOURCE TO myresource
SET RESOURCE ON
GETEXPR TO x
* set the options the way you want them
SET RESOURCE OFF
SET RESOURCE TO WhatEverItWasBefore
2) now you have a "myresource" table with 1 record for the options you have set, and you can substitute that table at the proper place in your code to turn on those options.
* save existing state of resource file
cOldResource = SET("RESOURCE",1)
lWasOn = ( SET("RESOURCE")="ON" )
SET RESOURCE TO myresource
SET RESOURCE ON
GETEXPR TO x
* now put it back as before
SET RESOURCE TO (cOldResource)
IF NOT lWasOn
  SET RESOURCE OFF
ENDIF
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform