How to recover the current sage x3 folder name: nomap ()
We have already seen how to recover the basic path of a folder.
To find the name of the current folder, use the instruction:
nomap(NUMBER)
In detail, if the current folder is the third level file:
- nomap(0) returns the current folder (example “SAGEDEV”)
- nomap(1) returns the parent folder (example “DX”)
- nomap(2) returns the root folder(example “X3”)
Note that there is a correspondence between adxmother (I) and nomap (I + 1).
Nomap() is very useful to parameterize file paths inserting the Folder like a variable.
So you can isolate the test environments from the production environment.
Example
We calculate a path where to export files:
PATH= “c:\directory\”+nomap(0)+”\export\”
If we are working in the production folder the path involved will be:
“c:\directory\SAGEDEV\export\”
If instead we are working in the test Folder we will have used the path:
“c:\directory\SAGEDEVTEST\export\”