home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / ac13disk / plug_ins / isvmb2e / test.sic < prev   
Encoding:
Text File  |  1998-09-06  |  2.0 KB  |  63 lines

  1. /*
  2.     Test script for ISVM (Interscript Variables Manager)
  3. */
  4.  
  5. /* Set Variables */
  6.  
  7. testvariable1=1;
  8. testvariable2="This is a test variable!";
  9.  
  10. print("Testvariable1 initialised with ", testvariable1);
  11. print("Testvariable2 initialised with [", testvariable2, "]");
  12.  
  13. /*
  14.     The values of the variables passed to the ISVM
  15.     should be valid Scripter variables so that they
  16.     are the same to call. The names should be as
  17.     meaningful as possible so that there are no unwanted
  18.     outcomes if each running script uses "a" or "i".
  19. */
  20.  
  21. print("Return SetVar 1: ", ISVM.SetVar("testvariable1", testvariable1));
  22. print("Return SetVar 2: ", ISVM.SetVar("testvariable2", testvariable2));
  23.  
  24. /* "Destroy" variables values */
  25.  
  26. testvariable1=42;
  27. testvariable2="MagiC PC";
  28.  
  29. print("Contents from destroyed Testvariable1: ", testvariable1);
  30. print("Contents from destroyed Testvariable2: ", testvariable2);
  31.  
  32. /* Restore the contents of the variables, 
  33.    this could be used in other scripts too.     */
  34.  
  35. testvariable1=ISVM.GetVar("testvariable1");
  36. testvariable2=ISVM.GetVar("testvariable2");
  37.  
  38. /* Print the contents of the variables */
  39. print("Restored contents from Testvariable1: ", testvariable1);
  40. print("Restored contents from Testvariable2: ", testvariable2);
  41.  
  42. print("Delete test variables:");
  43. print("Return DelVar 1: ", ISVM.DelVar("testvariable1"));
  44. print("Return DelVar 2: ", ISVM.DelVar("testvariable2"));
  45.  
  46. print("Deleted contents from Testvariable1: ", ISVM.GetVar("testvariable1"));
  47. print("Deleted contents from Testvariable2: ", ISVM.GetVar("testvariable2"));
  48.  
  49. /* Display value if our permanent test variable already exists */
  50.  
  51. if (ISVM.GetVar("PermanentTest")!=0)
  52. {
  53.     print("Permanent test variable found!");
  54.     /* Permanent variable is there -> output and then delete */
  55.     print(ISVM.GetVar("PermanentTest"));
  56.     print("Deleted...");
  57.     ISVM.DelVar("PermanentTest");
  58. }
  59. else
  60. {
  61.     print("Permanent test variable is not found, about to be set!");
  62.     ISVM.SetVar("PermanentTest", "I am a permanent value. :-)", 1);
  63. }