VERSION CHECK
This script will take a look at the version of the project being used, and then determine if a message/warning needs to be provided to the user! This script can be used in every project you write! The way you use it is two fold. In your script add the following:
***********in your Script******************
COM*******************************
COM v_pdf should be set to T if you are loading a pdf file in the script.
COM v_version_write should be changed to the version of ACL you are using.
COM The PATH needs to be replaced with a common path for the script.
COM*******************************
v_pdf = F
v_version_write = 9.1
DO "PATH\versioncheck.bat"
*************versioncheck.bat *************************
Save this as a .bat file in a folder that is in the path identified above.
***************************************************
SET SAFETY OFF
SET SUPPRESSXML ON
DEL versiontest.log OK
DEL versiontest.lix OK
DEL SCRIPT versioncheck OK
COM************************************
COM ACL will check the version of the project currently being used.
COM***********************************
SET LOG versiontest
DIS VER
SET LOG
IMPORT PRINT TO temp1 "C:\ACL DATA\Sample Data Files\templog1.FIL" FROM "templog1.LOG" 0 RECORD "Detail" 0 1 0 TEST 0 0 AT 1,35,0 7 "Version" FIELD "version" X AT 1,43 SIZE 3,1 DEC 1 WID 3 PIC "" AS ""
DEL versiontest.log OK
DEL versiontest.lix OK
OPEN TEMP1
COUNT
LOCATE RECORD count1
v_version_project = Version
v_terminate = F
COM*****************************************
COM If the version being used is older than the version the script was written on a warning message will appear.
COM*****************************************
IF v_version_project < v_version_write PAUSE "Warning: The version this project was written with is more advanced than the one being used. Some commands may not work."
COM*****************************************
COM If the version is older than 9.1 AND the option to load a pdf was selected, then
COM the script will warn the user that the version is too old and given the option
COM to continue on or terminate.
COM*****************************************
IF v_version_project < 9.1 and v_pdf DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 225 ) (BUTTONSET TITLE "&OK;&Cancel" AT 370 12 DEFAULT 1 ) (TEXT TITLE "This script must be run with a version of ACL that is 9.1 or greater, you are using version 9.0. Script will terminate." AT 36 88 WIDTH 368 HEIGHT 33 ) (CHECKBOX TITLE "If you want to override the termination of this script, please uncheck box." TO "v_terminate" AT 60 144 WIDTH 372 HEIGHT 13 CHECKED )
IF v_terminate PAUSE