The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Howto read environment variables?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
letay@ise.1 Posted - 08/14/2002 : 11:02:23 AM
Is there any possibility to get the contents of a system environment variable
for example the %temp% variable into a labtalk variable?

Thanks in advance

Gergoe

P.S.: I am using Origin 6.1 on Win 2000
3   L A T E S T    R E P L I E S    (Newest First)
letay@ise.1 Posted - 09/12/2002 : 10:18:11 AM
Greate, thanks that helped

:g)
Mike Buess Posted - 08/14/2002 : 1:11:20 PM
You can access system environment variables from Origin using the run -e command to create an INI file containing those variables and then accessing them with the INI object.

## Create INI file. %A depends on your OS
## %A=command.com; // If OS is Win9x (or WinMe? not sure)
## %A=cmd.exe; // if OS is NT4, Win2k or WinXP
run -e %A /C echo [Variables]>%Ywin.ini; // Create file and section header
sec -p 0.1; // Give the command time to complete before continuing
run -e %A /C set >> %Ywin.ini; // Copy environment variables to file
sec -p 0.1; // Pause again

## Variables can now be treated as INI keys
ini.file$=%Ywin.ini;
%A=ini.Variables.windir$;
%A=; // get windows directory, for example

Hope that helps.

Mike Buess
Origin WebRing Member
greg Posted - 08/14/2002 : 12:23:20 PM
There is no access to system environment variables, except for the one you mention specifically : %TEMP%.
You can get this variable with:
system.path.findtemp(L);
which puts the %TEMP% environment variable in the %L LabTalk string variable.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000