DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current directory and enviroment variables

Solved!
Go to solution

Hello, 

 

   1.- Is there a global variable to get the actual (project, where is DSB and DSQ files) directory? 

 

   2.- Is there a way to get User directory like reading enviroment variables from Operative System? 

 

Thanks in advance.

 

PD: I'm using Dasylab12

0 Kudos
Message 1 of 5
(6,928 Views)
Solution
Accepted by topic author molavec

Yes, use System Strings

 

For example, ${DATA_FOLDER}.

 

The easiest way to get the list is to right click and select Global Strings. The bottom half of the dialog box lists system strings, including date, time, the name of the worksheet, with or without path, the DEFAULT folders for worksheet, data, other, black box, etc. 

 

2013_08_13_PrintScreen_0001.png

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 5
(6,926 Views)

Thanks for your quick response CJ_Butler. I guess that is a good solution to put default files in my program.

Playing with DasyLab (I use version 11, not 12, sorry for the mistake). when I try to join string to get a Path with the ${VAR1} + "\" +  ${VAR2} symbol Dasy Lab send me a error:

 

 "Error in expression: Unexpected end" 

 

and when I use ${VAR1} + "\\" +  ${VAR2} it put two "\\":

C:\MY_PROYECT\\DIRECTORY

Any idea how to solve this.

Thanks in advance again.

 

0 Kudos
Message 3 of 5
(6,923 Views)

Sorry I join them worng 

VAR1=C:\MY_PROYECT\

VAR2=SESSION\

 

 

jOin: 

 

${VAR1} + "\\" + ${VAR2}

0 Kudos
Message 4 of 5
(6,919 Views)

You do not need to add a backslash, because the content of VAR1 has already one backslash at its end.

 

VAR1=C:\MY_PROJECT\ <-- !

VAR2=SESSION\

 

JOINED=C:\MY_PROJECT\SESSION\ <== ${VAR1}+${VAR2}

M.Sc. Holger Wons | measX GmbH&Co. KG, Mönchengladbach, Germany | DASYLab, DIAdem, LabView --- Support, Projects, Training | Platinum NI Alliance Partner | www.measx.com
0 Kudos
Message 5 of 5
(6,902 Views)