Hello,
I am trying to create an application with kixforms and kixtart. The application is supposed to give the user options to print a customer survey on the register, and if so, print it every 10 minutes, or 15 minutes, etc. I have come a pretty long way with it, but cannot figure out how to get it to run all the secondary print scripts at the same time. I am using a WAIT.exe command in DOS to time the printing of the surveys, and it works fine if only one register is selected to print. I just cannot get them all to print. I have it set so if a user selects a certain radio button, it writes a true or false value into an .ini file. The when the user clicks the Start Printing button, I used the CALL command to call the secondary kix scripts. The secondary kix scripts read values from the .ini file, and then changes the $time and $path variable and prints. The secondary scripts need to run in a loop (ex. print one survey every 10 min.) until the user closes it. I have tried using the CALL command to open all four secondary scripts, but it will only execute the first. I also cannot figure out how to close the secondary scripts once they start running. All I can do is close the first form, which says it is not responding in windows, and then click end now.
I am new to kixtart, so any help would be greatly appreciated. If what I am trying to do is to complex for kixtart, is there another programming language that could accomplish what I am trying to do???
Here is part of the main script:
Code:
Break On
$System = CreateObject("Kixtart.System")
;KD START
;************* Form **************
$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.Height = 492
$Form.Left = 43
$Form.MaximizeBox = "False"
$Form.Text = "PrintSurvey"
$Form.Top = 13
$Form.Width = 662
;**************************************
;************* Button1 **************
$Button1 = $Form.Controls.Button()
$Button1.FontBold = "True"
$Button1.FontSize = 12
$Button1.Height = 39
$Button1.Left = 200
$Button1.Text = "Start Printing"
$Button1.Top = 330
$Button1.Width = 254
$Button1.OnClick = "OnButtonClick()"
;**************************************
Function OnButtonClick
CALL Print1.kix
CALL Print2.kix
CALL Print3.kix
CALL Print4.kix
EndFunction
;************* Label1 **************
$Label1 = $Form.Controls.Label()
$Label1.BackColor = 212,208,200
$Label1.FontBold = "True"
$Label1.FontSize = 12
$Label1.Height = 90
$Label1.Left = 30
$Label1.Text = "Choose the register"
$Label1.Top = 15
$Label1.Width = 585
;**************************************
;************* Label3 **************
$Label3 = $Form.Controls.Label()
$Label3.BackColor = 212,208,200
$Label3.FontBold = "True"
$Label3.FontSize = 12
$Label3.Height = 50
$Label3.Left = 200
$Label3.Text = "To Stop Printing Click The X To Close This Window"
$Label3.Top = 380
$Label3.Width = 254
;**************************************
;************* GroupBox1 **************
$GroupBox1 = $Form.Controls.GroupBox()
$GroupBox1.BackColor = 212,208,200
$GroupBox1.FontSize = 10
$GroupBox1.Height = 192
$GroupBox1.Left = 30
$GroupBox1.Text = "Register 1"
$GroupBox1.Top = 120
$GroupBox1.Width = 136
;**************************************
;************* GroupBox2 **************
$GroupBox2 = $Form.Controls.GroupBox()
$GroupBox2.BackColor = 212,208,200
$GroupBox2.FontSize = 10
$GroupBox2.Height = 192
$GroupBox2.Left = 180
$GroupBox2.Text = "Register 2"
$GroupBox2.Top = 120
$GroupBox2.Width = 135
;**************************************
;************* GroupBox3 **************
$GroupBox3 = $Form.Controls.GroupBox()
$GroupBox3.BackColor = 212,208,200
$GroupBox3.FontSize = 10
$GroupBox3.Height = 192
$GroupBox3.Left = 330
$GroupBox3.Text = "Register 3"
$GroupBox3.Top = 120
$GroupBox3.Width = 136
;**************************************
;************* RadioButton22 **************
$RadioButton22 = $GroupBox1.Controls.RadioButton()
$RadioButton22.BackColor = 212,208,200
$RadioButton22.Checked = "False"
$RadioButton22.Height = 24
$RadioButton22.FontBold = "True"
$RadioButton22.FontSize = 10
$RadioButton22.Left = 15
$RadioButton22.TabStop = "False"
$RadioButton22.Text = "Print None"
$RadioButton22.Top = 30
$RadioButton22.Width = 104
$RadioButton22.OnClick = "OnRadioClick22()"
;**************************************
;************* RadioButton23 **************
$RadioButton23 = $GroupBox1.Controls.RadioButton()
$RadioButton23.BackColor = 212,208,200
$RadioButton23.Checked = "False"
$RadioButton23.Height = 24
$RadioButton23.FontSize = 10
$RadioButton23.Left = 15
$RadioButton23.TabStop = "False"
$RadioButton23.Text = "Every 10 Min."
$RadioButton23.Top = 60
$RadioButton23.Width = 104
$RadioButton23.OnClick = "OnRadioClick23()"
;**************************************
Function OnRadioClick22()
$IniFile=C:\Print.ini
$rc=writeprofilestring($IniFile,'Term1','RadioButton22Checked','True')
$rc=writeprofilestring($IniFile,'Term1','RadioButton23Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton24Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton25Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton26Checked','False')
EndFunction
Function OnRadioClick23()
$IniFile=C:\Print.ini
$rc=writeprofilestring($IniFile,'Term1','RadioButton22Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton23Checked','True')
$rc=writeprofilestring($IniFile,'Term1','RadioButton24Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton25Checked','False')
$rc=writeprofilestring($IniFile,'Term1','RadioButton26Checked','False')
EndFunction
The part of the .ini file:
Code:
[Term1]
RadioButton22Checked=
RadioButton23Checked=
RadioButton24Checked=
RadioButton25Checked=
RadioButton26Checked=
Here is one of the secondary scripts:
Code:
:PRINT
$RadioButton22Checked = ReadProfileString("C:\Print.ini", "Term1", "RadioButton22Checked")
$RadioButton23Checked = ReadProfileString("C:\Print.ini", "Term1", "RadioButton23Checked")
$RadioButton24Checked = ReadProfileString("C:\Print.ini", "Term1", "RadioButton24Checked")
$RadioButton25Checked = ReadProfileString("C:\Print.ini", "Term1", "RadioButton25Checked")
$RadioButton26Checked = ReadProfileString("C:\Print.ini", "Term1", "RadioButton26Checked")
SELECT
CASE $RadioButton22Checked = "True"
$Time1 = 0
$Path1 = none
CASE $RadioButton23Checked = "True"
$Time1 = 600
$Path1 = wichitafalls
CASE $RadioButton24Checked = "True"
$Time1 = 900
$Path1 = wichitafalls
CASE $RadioButton25Checked = "True"
$Time1 = 1800
$Path1 = wichitafalls
CASE $RadioButton26Checked = "True"
$Time1 = 3600
$Path1 = wichitafalls
ENDSELECT
$rc = shellcmd('%WINDIR%\system32\PRINT.EXE /D:\\$Path1\epsontm C:\TMLOGO.TMB')
$rc = shellcmd('ECHO . \\$Path1\epsontm')
$rc = shellcmd('ECHO . \\$Path1\epsontm')
$rc = shellcmd('TIME /T > \\$Path1\epsontm')
$rc = shellcmd('DATE /T > \\$Path1\epsontm')
$rc = shellcmd('%WINDIR%\system32\PRINT.EXE /D:\\$Path1\epsontm C:\survey.txt')
SHELL "C:\WAIT.EXE $Time1"
RETURN
GOTO "PRINT"
function shellcmd($commandstring, optional $forcewait)
Dim $rc
if val($forcewait)
$forcewait='start /min /wait '
else
$forcewait=''
endif
if $commandstring<>''
$commandstring='%COMSPEC% /c '+$forcewait+$commandstring
shell $commandstring
$shellcmd=@ERROR
else
exit 87
endif
endfunction
Thanks again for your help,
-Michael