Passing variables across scripts

Bishy

New member
Is it possible to pass a variable from one script to another script?
I want to write a modularised sort of script with different plug and play elements that i can customise easily without having to rewrite the entire script.
 

illarion

Member
Not exactly, but you can set pseudo-variables in your preferences file with:
Code:
set_property(string propertyname, string value);
e.g.:
Code:
set_property("MyName", "Illarion");

You would read that with:

Code:
MyString = get_property("MyName");
 

Veracity

Developer
Staff member
Perhaps all you need is to divide up your functions into different "packages" and have different main scripts that "import" the appropriate packages and call the appropriate functions with different arguments.

You can import a file of functions into your ASH script by putting directives like:

import <filename>;

at the top of your script. Yes, the "<" and ">" are necessary.
 
Top