I normally set environment variables with the SYSTEM or EXECUTE SB command. Are you starting your CGI scripts using the scriba -c
command to tell SB that the script is CGI based?
CGI programs gain a great wealth of information from environment variables. This data is available to the ScriptBasic program via module functions. The CGI program is encouraged to use these functions instead of the function environ(). The reason to use these functions is that later versions of the CGI module may support ISAPI, NSAPI, FastCGI and other web server interface modes. Calling the function environ() to get the value of these variables will not work in that case, while calling the functions provided by the CGI module still works.
.htaccess files are reread upon every hit within that directory. In fact, the web server will look for these .htaccess files on every access to the web server.
If using Apache, you may be able to set your environment variable by creating a .htaccess file in the directory your script is running and add the following.
SetEnv HTMLDOC_NOCGI "1"