home *** CD-ROM | disk | FTP | other *** search
- /*
- Test script for ISVM (Interscript Variables Manager)
- */
-
- /* Set Variables */
-
- testvariable1=1;
- testvariable2="This is a test variable!";
-
- print("Testvariable1 initialised with ", testvariable1);
- print("Testvariable2 initialised with [", testvariable2, "]");
-
- /*
- The values of the variables passed to the ISVM
- should be valid Scripter variables so that they
- are the same to call. The names should be as
- meaningful as possible so that there are no unwanted
- outcomes if each running script uses "a" or "i".
- */
-
- print("Return SetVar 1: ", ISVM.SetVar("testvariable1", testvariable1));
- print("Return SetVar 2: ", ISVM.SetVar("testvariable2", testvariable2));
-
- /* "Destroy" variables values */
-
- testvariable1=42;
- testvariable2="MagiC PC";
-
- print("Contents from destroyed Testvariable1: ", testvariable1);
- print("Contents from destroyed Testvariable2: ", testvariable2);
-
- /* Restore the contents of the variables,
- this could be used in other scripts too. */
-
- testvariable1=ISVM.GetVar("testvariable1");
- testvariable2=ISVM.GetVar("testvariable2");
-
- /* Print the contents of the variables */
- print("Restored contents from Testvariable1: ", testvariable1);
- print("Restored contents from Testvariable2: ", testvariable2);
-
- print("Delete test variables:");
- print("Return DelVar 1: ", ISVM.DelVar("testvariable1"));
- print("Return DelVar 2: ", ISVM.DelVar("testvariable2"));
-
- print("Deleted contents from Testvariable1: ", ISVM.GetVar("testvariable1"));
- print("Deleted contents from Testvariable2: ", ISVM.GetVar("testvariable2"));
-
- /* Display value if our permanent test variable already exists */
-
- if (ISVM.GetVar("PermanentTest")!=0)
- {
- print("Permanent test variable found!");
- /* Permanent variable is there -> output and then delete */
- print(ISVM.GetVar("PermanentTest"));
- print("Deleted...");
- ISVM.DelVar("PermanentTest");
- }
- else
- {
- print("Permanent test variable is not found, about to be set!");
- ISVM.SetVar("PermanentTest", "I am a permanent value. :-)", 1);
- }