Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System wide constant or Public Variable
Message
From
16/03/2005 11:26:22
 
 
To
16/03/2005 10:57:59
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00996355
Message ID:
00996373
Views:
21
This message has been marked as the solution to the initial question of the thread.
I have a table with a record for each value I want to be 'public'. I then scan this table, and use _screeen.addproperty. This way I can use the syntax this.value=_screen.companyaddress
The table has this strucure:
VARIABLE Character 25
DATA Character 50
DATATYPE Character 1
Scan
  If Empty(Eval(Field(1)))
    Loop
  Endif
  xData=Eval(Field(2))
  If Type(Field(2))='C'
    xData=Alltrim(xData)
    If Fcount()>2 And Len(Eval(Field(3)))=1
      cDatatype=Eval(Field(3))
      Do Case
        Case Upper(cDatatype)='L'
          If xData='.'
            xData=Substr(xData,2,1)
          Else
            xData=Left(xData,1)
          Endif
          xData=Inlist(Upper(xData),'T','J','Y','1')
        Case Upper(cDatatype)='N'
          xData=Val(Left(xData,16))
      Endcase
    Endif
  Endif
  _Screen.AddProperty(Alltrim(Eval(Field(1))),xData)
Endscan
>I want to define a constant that is usable anywhere in any program in the project.
>
>Something like My_company_Name = “ABC Inc.” It is like a public variable but comes from the dot H file which can be different for different locations of the program.
>
>I thought a #INCLUDE my_vals..H in the first program of the project with values in the dot H like #Define My_company_name “ABC Inc.” would do that, but it does not seem to.
>
>I guess the best way would be to have a public variable and then read the value from a small single record dbf or even a MEM file.
>
>Obviously I am just trying to set the basic default parameters of the application depending on where it is running.
>
>My DEV version will always use Dev data and dev Names and when it Quits, it actually returns to the command screen (not quit).
>
>My production version will go to different data files and screen colors and the Quit program will function differently.
>
>Any suggestions?
Previous
Reply
Map
View

Click here to load this message in the networking platform