Accessing C variables from c4gl
Posted in 1991
Path: emory!sol.ctr.columbia.edu!hamblin.math.byu.edu!hellgate.utah.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cmcl2!psinntp!psinntp!uunet!ispd-newsserver!kodak!static!amiano From: amiano@static.Kodak.Com (Mitch C. Amiano) Newsgroups: comp.databases.informix Message-ID: <1991Oct18.133715.11629@kodak.kodak.com> Date: 18 Oct 91 13:37:15 GMT Sender: amiano@static (Mitch Amiano) Organization: Eastman Kodak Co., Rochester, NY Informed Informix Users, Got a Question. How do I gain read access to a variable that was declared in a C or ESQL/C file. We have an application with both ESQL/C and 4GL modules, which will need to operate under one of two units of measure depending upon where it gets installed. We want to have access to the C variables rather than writing and maintaining library functions to do it. Ex: in C file: #define GU_METRIC 1 #define GU_ENGLISH 2 int fgl_gu_english = GU_ENGLISH; int fgl_gu_metric = GU_METRIC; int fgl_what_measure(); /* returns GU_METRIC or GU_ENGLISH, depending */ /* on a UNIX shell variable. */ in 4gl file: Function myfunc() # Do something specific for Metric, something else for English [stuff...] if fgl_what_measure() = fgl_gu_metric then [some other stuff...] end if End Function We would prefer to maintain only one file of constants and corresponding functions. If we have to, we'll write functions, but thats not as clean to maintain. Thanx in advance -- -- -- -- -- -- -- -- - --- -- -- -- -- -- -- -- --- -- -- -- -- -- -- -- Mitch C. Amiano, Software Contractor Rochester, NY 716-226-2024 Disclaimer: My employer doesn't even know I work her. And all other std disclaimers.