| Extending the language / C-Extensions | |
While not recommended, you can share global variables declared in your program with a C module.
In order to share the global variables declared in your program, you must:
GLOBALS DEFINE g_name CHAR(100) END GLOBALS
fglcomp -G myglobals.4gl
This will produce two files named myglobals.h and myglobals.c.
#include <string.h>
#include "f2c/fglExt.h"
#include "myglobals.h"
int myfunc1(int c)
{
strcpy(g_name, "new name");
return 0;
}