getting (DOS) environment variables 
Author Message
 getting (DOS) environment variables

Jeroen,

    Did a DejaNews search and came up with this (since it's an API call,
it should work - don't know if it's 16 or 32 bit though)...

    Regards,

    kurtt

{quote follows}

Subject:      Re: Read DOS Environment Variables ??

Date:         1996/07/23

Newsgroups:   comp.lang.clarion
[More Headers]
[Subscribe to comp.lang.clarion]

Quote:

>Hi All
>I have seen a number of messages regarding reading of DOS Environment

Variables

Quote:
>-------------------
>    Set FID=1234
>-------------------
>In CW1.5001 or/and CW2.0
>I need to be able to read in the value of the Envro Var FID
>This was easy with CPD2.1
>Anyone got the Answer to this little problem with windows ????
>Thanks for any suggestions
>Ray

Ray,
  I don't know of any Clarion verb that will get this information for
you.  You can use the API call GetDOSEnvironment to do this for you.
Here is the prototype.

GetDOSEnvironment(),LONG,Pascal,RAW

HTH's

Mike Gould



Tue, 31 Oct 2000 03:00:00 GMT  
 getting (DOS) environment variables

Hi Jeroen,

Quote:

>Does someone have a method for getting DOS environment variables (any) in
>CW4? I dont want to use a run statement due to performance. Any help will be
>appreciated.

You can do this with api:

In 16bit:

GetDosEnvironment

In 32bit

GetEnvironmentVariable

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com
UIN nr.: 2428601



Tue, 31 Oct 2000 03:00:00 GMT  
 getting (DOS) environment variables

Thanks Kurt and Arnor,

but how to use the GetDosEnvironment? It gives a long back but what
then?  Any example code will be helpful....

Thanks

Jeroen



Thu, 02 Nov 2000 03:00:00 GMT  
 getting (DOS) environment variables

Hi Jeroen:

You were given authoritative misinformation.
GetDosEnvironment (16 bit only) returns a pointer to the head of the
Environment Block.  The Environment Block contains all of the variables
in the format "name=value" with a null terminator after each entry.  The
end of the Environment Block is marked by two consecutive null
characters.

 Inside Clarion you will find a C API function that will search the
Environment Block and retrieve the "value" of a "name", if it exists.
Here is the Clarion prototype (works in both 16 and 32 bit):

        MODULE('Clarion C API')
GetEnv  FUNCTION(*CSTRING name),CSTRING,RAW,NAME('_getenv')
        END
where;

"name" is the label of an environment variable.

The CSTRING return will be the "value", if found, example:

NameStr     CSTRING(260)
PathStr     CSTRING(260)
  CODE
  NameStr = 'PATH'
  PathStr = GetEnv(NameStr)

Quote:

> Thanks Kurt and Arnor,

> but how to use the GetDosEnvironment? It gives a long back but what
> then?  Any example code will be helpful....

> Thanks

> Jeroen

--
 Randy Goodhew
 Thoroughbred Harmonica Co.
 =[oooooooooo]=


Thu, 02 Nov 2000 03:00:00 GMT  
 getting (DOS) environment variables

Thanks!! I'll give it a try..

Greetings,

Jeroen

===================================================================


Quote:
>Hi Jeroen:

>You were given authoritative misinformation.
>GetDosEnvironment (16 bit only) returns a pointer to the head of the
>Environment Block.  The Environment Block contains all of the variables
>in the format "name=value" with a null terminator after each entry.  The
>end of the Environment Block is marked by two consecutive null
>characters.

> Inside Clarion you will find a C API function that will search the
>Environment Block and retrieve the "value" of a "name", if it exists.
>Here is the Clarion prototype (works in both 16 and 32 bit):

>        MODULE('Clarion C API')
>GetEnv      FUNCTION(*CSTRING name),CSTRING,RAW,NAME('_getenv')
>        END
>where;

>"name" is the label of an environment variable.

>The CSTRING return will be the "value", if found, example:

>NameStr     CSTRING(260)
>PathStr     CSTRING(260)
>  CODE
>  NameStr = 'PATH'
>  PathStr = GetEnv(NameStr)


>> Thanks Kurt and Arnor,

>> but how to use the GetDosEnvironment? It gives a long back but what
>> then?  Any example code will be helpful....

>> Thanks

>> Jeroen



Thu, 02 Nov 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Getting DOS Environment

2. getting environment variables in haskell cgi

3. getting environment variables from f90

4. Geoip installed but not getting environment variables

5. getting environment variable values in 1.5.2

6. getting environment variables in CGI program

7. Getting Environment Variables

8. Using dos/windows environment variables in gawk script

9. Reading DOS environment variables from c4b

10. CW20 and DOS environment variables

11. DOS environment variables

12. CW + Dos environment variables

 

 
Powered by phpBB® Forum Software