Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE problem
Message
 
À
12/02/2007 16:24:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01194874
Message ID:
01194898
Vues:
21
>I use a memvar container object, it's "visble" to all the programs once it's initialized. It's really a simple and cool class, and extremely useful.
>define class ParameterX as custom
>  function This_Access(tcMember)
>    if type('This.' + tcMember) = 'U'
>      This.AddProperty(tcMember)
>    endif
>    return This
>  EndFunc
>  function AddVar(tcMember,tcData)
>      AddProperty(this,tcMember,tcData)
>    return This
>  endfunc
>EndDefine
>
>To use it:
>If Vartype(oMemvar)#'O'
>  Public oMemvat
>  oMemvar=CreateObject('parameterX')
>EndIf
>oMemvar.maxrxs=20
>oMemvar.myothervar='This text'
>oMemvar.myLogval=.T.
>In your case
>For y = 2 To oMemvar.maxrxs
>   blah blah blah
>Endfor
>
>

Very slick. I think I'll use this!

Thanks!

>
>>Hi Gang!
>>
>>Problem today is this.......
>>
>>I wanted to change some legacy code from this......
>>(which is in a Form)
>>
>>
>>For y = 2 To 20
>>   blah blah blah
>>Endfor
>>
>>To this
>>
>>For y = 2 To MAXRXS
>>   blah blah blah
>>Endfor
>>
>>
>>Using a #DEFINE statment....
>>(located in the MAIN.prg which calls the above Form)
>>
>>#DEFINE MAXRXS 20
>>
>>When I run the code, it bombs out with a "Variable MAXRXS not found".
>>
>>I recompile, rebuild...etc... but no luck.
>>
>>Where would you look?
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform