environment variable in cspro

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
muhaliraza
Posts: 44
Joined: February 1st, 2018, 9:00 am

environment variable in cspro

Post by muhaliraza »

I define the variable PCNUM as environment variable. I want to call it in cspro. Kindly guide me how can i do this in cspro.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: environment variable in cspro

Post by Gregory Martin »

The CSPro language does not have a way to access environment variables directly. However, you can create a DOS batch file with the following contents:
echo %PCNUM% > pcnum.txt
You can execute that batch file with execsystem, and then you can use the setfile/fileread functions to read that file, pcnum.txt, to get the contents of the environment variable.
Post Reply