Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
#DEFINE problem
Message
From
12/02/2007 16:48:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01194874
Message ID:
01194900
Views:
15
You're welcome. Yes, it's very slick in deed. I now use almost no memvars, only a few memvat objects.

>>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform