Okay all you elite coders out there.

I know this has been talked about before, but since the weekend appears slow again.

Here is your chance to show off your ideas.

What is the best method to ensure that a minimum version of KiXtart and KiXforms are on the system before launching the KiXform.

Here is an example of code to check, but I don't think it is the optimal bullet proof solution.

This is NOT a Golf game, but rather a best of breed code to guarantee KiXtart and KiXforms are at a set/given level and alert the user if one or the other do no meet the set/given criteria.

So post your ideas and code please.

debug off
break on
dim $iRC
$iRC=setoption('Explicit','ON')
$iRC=setoption('NoVarsInStrings','ON')
$iRC=setoption('WrapAtEOL','ON')

dim $ASCII,$ReqForms,$KixVersion,$MB,$frm,$KFCheck,$MBText,$KiXFound,$KiXMin
$ASCII = setoption(ascii,'on')
$ReqForms = 41
$KixVersion = @KIX
$KiXMin = '4.21'
select
case instr($KixVersion,'4.21') $KiXFound='4.21'
case instr($KixVersion,'4.22') $KiXFound='4.22'
case 1 $KiXFound=0
endselect
if $KiXFound < '4.21'
$MBText='This Script requires at least KiXtart version '+$KiXMin+@CRLF
$MBText=$MBText+'The latest version can be downloaded from'+@CRLF+@CRLF
$MBText=$MBText+'http://www.kixtart.org '
$MB=messagebox($MBTEXT,'Version Check',4112)
quit()
endif
$KFCheck=iif(readvalue('HKLM\SOFTWARE\CLASSES\KIXTART.FORM','')<>"",1,0)
if $KFCheck
$frm = createobject("Kixtart.Form")
if val($frm.Build) < $ReqForms
$MBText='This Script requires Kixforms build '
$MBText=$MBText+$ReqForms+@CRLF+@CRLF
$MBText=$MBText+'The latest version can be downloaded from'+@CRLF+@CRLF
$MBText=$MBText+'http://www.kixforms.com'
$MB=messagebox($MBText,'Version check',4112)
quit()
endif
else
$MBText='Unable to locate KiXforms on this computer. '
$MBText=$MBText+'This Script requires Kixforms build '
$MBText=$MBText+$ReqForms+@CRLF+@CRLF
$MBText=$MBText+'Please download and install the latest version of KiXforms from'+@CRLF
$MBText=$MBText+'http://www.kixforms.com '
$MB=messagebox($MBText,'Version check',4112)
endif

? 'Your KiX32 is: '+$KiXFound
? 'Okay to run your form now'