This project is read-only.

ReuseLegacyScript

The users can reuse VBScript in SALAD through VBSHandler.(for JavaScript, JSHandler)

Requirements
  • registered COM object that is MSScriptControl.ScriptControl
  • session what's in 32bit mode

Case:
There are VBScript files.(For example colony.vbs)
Put the files in one directory wherever you like.(for example "c:\temp\vbs")
Load and use them.

The users can new them, call their methods so that USOClasses and Functions can collaborate with VBScript or JavaScript.

[SALAD]
# create script handler
$b = new VBSHandler;
# initialize
$b = $b.Initialize("C:\temp\vbs");
# new colony class
$classname = "colony";
$colony = $b.New($classname);

# and else, whatever you like

# initialize colony(this is a method that Colony class has in vbs)
$colony.Initialize();
# check colony instance
$colony;
# send 100 days for colony(NextDay is a method that Colony class has in vbs)
0..99 | %{$colony.NextDay()};
# check colony instance
$colony;
# check colony workers
$colony.workers | Group-Object alive;


about Colony.vbs
Colony
  • has Queen and Workers.
  • gets tomorrow by NextDay method.
Queen
  • lives 50000 days.
  • sometimes bear a Worker, and Worker belongs to Colony.
Worker
  • sometimes dies.
Operation
  • create a Colony and give it some days.

The operations in VBS are like following.
Set c = New Colony
Call c.Initialize()
Call c.NextDay()
MsgBox (Cstr(c.age))

Last edited Mar 2, 2013 at 4:12 PM by Tom__S, version 14

Comments

No comments yet.