A utility program called Ensure is provided in the main module directory. ie accessible with /PlayIt:Ensure. Note that the Run command (or /) must be used since PlayIt:Ensure by itself will try to execute a (non-existent) command in the PlayIt module itself.



Ensure is used as follows:

/Ensure [-e] <min version> [<driver leaf>]

eg /Ensure 1.55
/Ensure -e 1.50 Standard



The optional -e will cause any errors to be written to the OS variable PlayIt$Error instead of the screen.



<min version> is the minimum required version in the form x.xx (eg 1.55).



<driver leaf>, if supplied, will forcibly load the driver specified otherwise Ensure will automatically select a driver.



The source code for ensure is present in the AOF directory if you wish to see exactly how it works but it is essentially just a shell for the xplayit_ensure function defined in playitap which, in turn, implements the loading guidelines.



In summary is does this:

checks currently loaded version (=0.00 if not loaded)
returns an error if wrong major version is loaded
if an older (minor) version is loaded or PlayIt isn't loaded then:
if PlayIt is loaded and not idle an error is returned (too old)
PlayIt is (re)loaded from the given path
If the version is still too old an error is returned
if no driver is loaded, one is automatically selected and loaded
if a driver was supplied on the command line it is loaded replacing any that may have just been loaded in the previous step. Note that if this fails PlayIt will be left in a driverless state regardless of the success of the automatic selection above.



Note that once an error occurs it returns immediately and does not continue to the end of the above list of actions!

[ Parent ] [ Manual root ]


Created by SHtoHTML v1.20