Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Dictionary from declare programs
Message
De
17/01/2004 15:57:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Data Dictionary from declare programs
Divers
Thread ID:
00867835
Message ID:
00867835
Vues:
61
I am in the process of converting FPD26 screens to VFP forms and I have successfully created a procedure that steps through each control on the form, checks its control source (or value) and looks for a corresponding field name in a table and if found takes field information to create the maxlength, format and input mask for me programmatically. In some cases, these tables already exist. However, the majority of screens used variables and arrays in the screen controls and the values were permanently stored in a character field like so:

field: de_data
values stored: mvh_year (char 1-4), mvh_make (char 5-15), mvh_model etc.
example field: 1999FORD.....PINTO (periods denote what are actually spaces)

I would like to create a data dictionary dbf from some prgs that contain the variable declarations. The problem I have is that the variables are not always created the same so I'm running into problems reading the entries from the file correctly.

Here is an example:
*--mo_decl.prg                      && this prg just shown for gp
PARAMETERS paction
IF paction
    PUBLIC mo_year,;
       mo_length
ELSE
    RELEASE mo_year,;
        mo_length
*etc
ENDIF

*this prg is example of file I need to read to create a table of vars 
*their type, etc

*--mo_blnk.prg
STORE '           ' TO mo_name      && character
STORE SPACE(5)      TO mo_chbo      && char
STORE REPL(' ',10)  TO mo_bidl      && char
STORE .T. TO mo_owner               && logical
mo_year    = 0                      && numeric, 1999, 1986, 2001...
mo_length  = "      "               && char
mo_width   = "      "
mo_man     = REPL(" ",15)
mo_serial  = REPL(" ",15)
mo_price   = REPL(" ",8)
mo_pdate   = { }                    && date field
mo_limit10 = SPACE(9)     
mo_limit11 = '         '
mo_limit12 = REPL(" ",9)
mo_limit13 = REPL(" ",9)
mo_limit14 = REPL(" ",9)
mo_limit15 = REPL(" ",9)
mo_prem1   = 0
mo_prem2   = 0
mo_type    = ' '
mo_total   = mpo_prem(policynumber)  && numeric, mpo_prem is already declared
I have a table that I want to populate from the variable declaration program that has the below fields for example:
FIELD                    VALUE

varname                  mo_type
vartype                  char
format                   !
length                   10
inputmask                XXXXXXXXXX
defaultvalue             '          '
etc...
Any ideas how to step through the prg and correctly determine the values when it could be space(5), REPL(" ",5), or ' ' or even STORE is used instead of =?

TIA,
Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform