checkVersion()

eSignal EFS 2

checkVersion()

Top  Previous  Next

 

checkVersion( versionNo,  URL, fName )

 

Provides script developers with a mechanism to get updated versions of scripts and/or libraries into the user's hands. The EFS update settings govern how often a user's system will check for updated scripts/libraries. To access the EFS Update dialog, select Tools-->EFS-->AutoUpdates from the eSignal menu.

 

Parameters

 

versionNo

the current version number in this script

URL

the url to check for a more recent version

fName

file name (required when used with efsLib files)

 

Usage

 

function preMain() {

 

       setPriceStudy(true);

       setStudyTitle("Example Script");

       setCursorLabelName("EMA", 0);

       setDefaultBarFgColor( Color.blue, 0 );

       setShowTitleParameters( false );

 

       //Assume that the name of this script is ExampleScript.efs

       //Each time this script is loaded, it will check the URL specified

       //in the checkVersion function. If the versionNo in the file found

       //at the URL is greater than the value of versionNo in the running

       //EFS, the user will be prompted to allow eSignal to download the

       //newer script. The download as well as the replacement of the old

       //EFS with the new is automatic.

 

       checkVersion( 1.0, "http://myWebSite.com/ExampleScript.efs" );

 

       //So, if I was the author of ExampleScript.efs and if I had created a new

       //version, I would simply change the versionNo in my new version from

       //1.0 to 1.1 and then I would upload the EFS file to the location

       //specified on my web site. Any users of my script would then be prompted

       //to update the very next time they run the script.

 

       //Here is the correct syntax to use when implementing checkVersion with

       //a library file

       checkVersion( 1.0, "http://myWebSite.com/ExampleLibrary.efsLib", "ExampleLibrary.efsLib" );

 

 

 

}