Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Stefan Weideneder — — source: Informix-list mailing list archive (1991-1998)
Bruce McDougald wrote:
>
> I want to write 4gl code that will grab the database name from an env.
> variable at compile time. My problem is that the compiler is choking on
> my variable definitions. Is there a way around this?
>
> EX:
> main
> call init()
> call process()
> end main
>
> function init()
> define dbname
> let dbname = fgl_getenv("DBNAME")
>
> database dbname
> end function
>
> function process()
> define l_var like table.column ## Compiler will choke here
> .....
> end function
You forgot to write the database definition at the top of your
program.
DATABASE compilerdatabase # this database will be used by the compiler
MAIN
define
dbname char(80)
let dbname = fgl_getenv( "DBNAME" )
DATABASE dbname # this database will ne used during runtime
END MAIN
Bye
Stefan Weideneder
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.