Sign in to follow this  
Followers 0
Kurto2021

Combo Box updating a label

6 posts in this topic

#1 ·  Posted (edited)

Let me just start by saying I am complete noob here and really have only done what I have done so far by just reading and searching ..... but I can't seem to figure this out. Technically what I want is working but it just doesn't seem right.

Whenever I move the mouse the the label on the bottom right corner seems like it is continually updating. I am sure my code is long and awful but here it is

CODE
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Icon=..\Logo.ico

#AutoIt3Wrapper_Outfile=Devtool.exe

#AutoIt3Wrapper_Res_Comment=This is a nice program.

#AutoIt3Wrapper_Res_Description=Tax Analyst Development Graphical User Interface

#AutoIt3Wrapper_Res_Fileversion=1.0.0.1

#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p

#AutoIt3Wrapper_Res_LegalCopyright=By Kurt Owens

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.12.1

Author: Kurt Owens

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

#include <GUIConstantsEx.au3>

#include <AVIConstants.au3>

#include <ButtonConstants.au3>

#include <ProgressConstants.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <Array.au3>

#include <File.au3>

Global $aFiles[1]

Global $bFiles[1]

Global $dFiles[1]

;I read the Devtool.ini file to input the default information. Devtool.ini file is created on exit

Global $CBState = IniRead("Dev.ini", "State", "key", "")

Global $CBSys = IniRead("Dev.ini", "System", "key", "")

Global $CBYear = IniRead("Dev.ini", "Year", "key", "")

$CustVar = IniRead("Dev.ini", "Custom1", "key", "Custom1")

$CustVar2 = IniRead("Dev.ini", "Custom2", "key", "Custom2")

$CustVar3 = IniRead("Dev.ini", "Custom3", "key", "Custom3")

$CustVar4 = IniRead("Dev.ini", "Custom4", "key", "Custom4")

$Path1 = IniRead("Dev.ini", "Path1", "key", "")

$Path2 = IniRead("Dev.ini", "Path2", "key", "")

$Path3 = IniRead("Dev.ini", "Path3", "key", "")

$Path4 = IniRead("Dev.ini", "Path4", "key", "")

$Override = IniRead("Dev.ini", "Override", "key", "")

$WrkFileOvr = IniRead("Dev.ini", "Primary File", "key", "")

;$Version1 = "1.0.0.0"

$Version1 = FileGetVersion("Devtool.exe")

$Version2 = FileGetVersion("H:\Kowens\Devtool.exe")

If $Version1 < $Version2 Then

MsgBox(1, "Update", "There is an update to DevTool available on H:\Kowens")

EndIf

;This is where I create the Graphical User Interface - The gray bar on left wraps around GUI section

#Region ### START Koda GUI section ### Form=c:\documents and settings\kowens\desktop\dev\koda_1.7.0.1\templates\tabbed pages.kxf

$dlgTabbed = GUICreate("Development Tasks GUI", 441, 360, 208, 128)

GUISetIcon("D:\005.ico")

$PageControl1 = GUICtrlCreateTab(24, 58, 396, 256)

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

$TabSheet1 = GUICtrlCreateTabItem("1 Form Building")

GUICtrlSetState(-1, $GUI_SHOW)

;Tab 1 Row 1 (displayed name, Vertical Position, Horizontal Position, width, height)

$Draw = GUICtrlCreateButton("&Draw", 45, 90, 75, 30, 0)

$Garbo = GUICtrlCreateButton("&Garbo", 140, 90, 75, 30, 0)

$Greta = GUICtrlCreateButton("Gr&eta", 235, 90, 75, 30, 0)

$Roc = GUICtrlCreateButton("&Roc", 330, 90, 75, 30, 0)

;Tab 1 Row 2

$Vamp = GUICtrlCreateButton("&Vamp / DDUT", 45, 130, 75, 30, 0)

$WSViewer = GUICtrlCreateButton("W&SViewer", 140, 130, 75, 30, 0)

$ExtList = GUICtrlCreateButton("E&xt List", 235, 130, 75, 30, 0)

$Help = GUICtrlCreateButton("Draw He&lp", 330, 130, 75, 30, 0)

;Tab 1 Row 3

$DocRoc = GUICtrlCreateButton("DocRoc", 45, 170, 75, 30, 0)

$DocGen = GUICtrlCreateButton("DocGen", 140, 170, 75, 30, 0)

;$DocGen = GUICtrlCreateButton("DocGen", 235, 170, 75, 30, 0)

;$Custom4 = GUICtrlCreateButton($CustVar4, 330, 170, 75, 30, 0)

;Tab 1 Row 4

$Custom1 = GUICtrlCreateButton($CustVar, 45, 260, 75, 30, 0)

$Custom2 = GUICtrlCreateButton($CustVar2, 140, 260, 75, 30, 0)

$Custom3 = GUICtrlCreateButton($CustVar3, 235, 260, 75, 30, 0)

$Custom4 = GUICtrlCreateButton($CustVar4, 330, 260, 75, 30, 0)

;Create second tab

$TabSheet2 = GUICtrlCreateTabItem("2 File Mgmt")

;Tab 2 Row 1

$RetrieveST = GUICtrlCreateButton("&RetrieveST", 45, 90, 75, 30, 0)

$RetrieveFD = GUICtrlCreateButton("Retrieve&FD", 140, 90, 75, 30, 0)

$TempMove = GUICtrlCreateButton("Temp Move", 235, 90, 75, 30, 0)

;Tab 2 Row 2

$HelpGet = GUICtrlCreateButton("Help Get", 45, 140, 75, 30, 0)

$HelpPut = GUICtrlCreateButton("Help Put", 140, 140, 75, 30, 0)

$HelpGen = GUICtrlCreateButton("Help Gen", 235, 140, 75, 30, 0)

;Tab 2 Row 3

$Xref = GUICtrlCreateButton("Get Xref", 45, 190, 75, 30, 0)

$XrefEdit = GUICtrlCreateButton("Open Xref", 140, 190, 75, 30, 0)

;Create Third Tab

$TabSheet3 = GUICtrlCreateTabItem("3 Custom")

;Tab 3 Row 1

$CustBox = GUICtrlCreateInput($CustVar, 40, 136, 75, 20)

$CustPath = GUICtrlCreateInput($Path1, 150, 136, 255, 20)

;Tab 3 Row 2

$CustBox2 = GUICtrlCreateInput($CustVar2, 40, 160, 75, 20)

$CustPath2 = GUICtrlCreateInput($Path2, 150, 160, 255, 20)

;Tab 3 Row 3

$CustBox3 = GUICtrlCreateInput($CustVar3, 40, 184, 75, 20)

$CustPath3 = GUICtrlCreateInput($Path3, 150, 184, 255, 20)

;Tab 3 Row 4

$CustBox4 = GUICtrlCreateInput($CustVar4, 40, 208, 75, 20)

$CustPath4 = GUICtrlCreateInput($Path4, 150, 208, 255, 20)

;Tab 3 Row 5

$Apply = GUICtrlCreateButton("Apply", 330, 265, 75, 30, 0)

$Message = GUICtrlCreateLabel("You must exit before changes take effect", 45, 90, 200, 20)

;Create 4th Tab

$TabSheet4 = GUICtrlCreateTabItem("4 ELF")

$HXED = GUICtrlCreateButton("HXED", 45, 90, 75, 30, 0)

$BEST = GUICtrlCreateButton("BEST", 140, 90, 75, 30, 0)

$Retr = GUICtrlCreateButton("Retriever", 235, 90, 75, 30, 0)

;$FileMsg = GUICtrlCreateLabel($File, 150, 232, 255, 20)

GUICtrlCreateTabItem("")

;End of tabbed data

;Shows on the bottom for all tabs

$Tax = GUICtrlCreateButton("&Tax", 50, 320, 75, 30, 0)

$Prodproc = GUICtrlCreateButton("&ProdProc", 138, 320, 75, 30, 0)

$Officmgr = GUICtrlCreateButton("&OfficMgr", 228, 320, 75, 30, 0)

$Message2 = GUICtrlCreateLabel("Fed File Date", 365, 315, 200, 20)

;Getting the date of the Federal

;Shows on top for all tabs

$Yearlbl = GUICtrlCreateLabel("Year", 28, 6, 49, 25)

$YearCtrl = GUICtrlCreateCombo("", 28, 26, 49, 25)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")

GUICtrlSetData(-1, "0|1|2|3|4|5|6|7|8|9", $CBYear)

$Systemlbl = GUICtrlCreateLabel("System", 104, 6, 41, 25)

$SystemCtrl = GUICtrlCreateCombo("", 104, 26, 41, 25)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")

GUICtrlSetData(-1, "C|F|I|K|P|S|X|Y", $CBSys)

$Statelbl = GUICtrlCreateLabel("State", 168, 6, 89, 25)

$StateCtrl = GUICtrlCreateCombo("", 168, 26, 89, 25)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")

GUICtrlSetData(-1, "AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NC|ND|NE|NH|NJ

|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WI|WV|WY", $CBState)

$OVCHKBox = GUICtrlCreateCheckbox("Secondary File $F", 280, 1, 140, 25)

$WorkCtrl = GUICtrlCreateInput($WrkFileOvr, 280, 28, 130, 25)

;GUICtrlSetFont(-1, 8, 400, 0, "Arial")

$Year = GUICtrlRead($YearCtrl, 0)

$System = GUICtrlRead($SystemCtrl, 0)

$State = GUICtrlRead($StateCtrl, 0)

$WorkingFile = GUICtrlRead($WorkCtrl, 0)

$timei = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "i$f.dat", 0)

If Not @error Then

$yyyymdi = $timei[1] & "/" & $timei[2] & "/" & $timei[0]

Else

$yyyymdi = "No File Local"

EndIf

$timec = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "c$f.dat", 0)

If Not @error Then

$yyyymdc = $timec[1] & "/" & $timec[2] & "/" & $timec[0]

Else

$yyyymdc = "No File Local"

EndIf

$timef = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "f$f.dat", 0)

If Not @error Then

$yyyymdf = $timef[1] & "/" & $timef[2] & "/" & $timef[0]

Else

$yyyymdf = "No File Local"

EndIf

$timep = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "p$f.dat", 0)

If Not @error Then

$yyyymdp = $timep[1] & "/" & $timep[2] & "/" & $timep[0]

Else

$yyyymdp = "No File Local"

EndIf

$times = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "s$f.dat", 0)

If Not @error Then

$yyyymds = $times[1] & "/" & $times[2] & "/" & $times[0]

Else

$yyyymds = "No File Local"

EndIf

$timex = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "x$f.dat", 0)

If Not @error Then

$yyyymdx = $timex[1] & "/" & $timex[2] & "/" & $timex[0]

Else

$yyyymdx = "No File Local"

EndIf

$timey = FileGetTime("C:\fx\0" & $Year & "\dd\0" & $Year & "y$f.dat", 0)

If Not @error Then

$yyyymdy = $timey[1] & "/" & $timey[2] & "/" & $timey[0]

Else

$yyyymdy = "No File Local"

EndIf

$Message = GUICtrlCreateLabel("", 365, 330, 200, 20)

$DrawTip = "Draw" & $Year & " dd" & $Year & $System & "$" & $State & " dd" & $Year & $System & "$fd"

$WrkTip = "Override the primary file. Year and System must be entered."

$OVCHKBoxTip = "Check this box to use $F file as secondary file in Draw."

GUICtrlSetTip($Draw, $DrawTip)

GUICtrlSetTip($WorkCtrl, $WrkTip)

GUICtrlSetTip($OVCHKBox, $OVCHKBoxTip)

;GUISetState(@SW_SHOW)

GUISetState()

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

;Reading the keyed in data and assigning the data to a temp variable

$Year = GUICtrlRead($YearCtrl, 0)

$System = GUICtrlRead($SystemCtrl, 0)

$State = GUICtrlRead($StateCtrl, 0)

$WrkFileOvr = GUICtrlRead($WorkCtrl, 0)

$Wrk = GUICtrlRead($WorkCtrl, 1)

$CustVar = GUICtrlRead($CustBox, 0)

$CustVar2 = GUICtrlRead($CustBox2, 0)

$Path1 = GUICtrlRead($CustPath, 0)

$Path2 = GUICtrlRead($CustPath2, 0)

$CustVar3 = GUICtrlRead($CustBox3, 0)

$CustVar4 = GUICtrlRead($CustBox4, 0)

$Path3 = GUICtrlRead($CustPath3, 0)

$Path4 = GUICtrlRead($CustPath4, 0)

$Override = GUICtrlRead($OVCHKBox, 0)

; Path Keywords - This will reduce usage of full pathing in execution of code

; these are the set paths for when You are calling a common file I added them late so most items don't use it.

$ddpath = "C:\fx\0" & $Year & "\dd\"

; example = C\fx\08\dd

If $Wrk = "" Then

;If $override = 1 then

$statedd = "DD" & $Year & $System & "$" & $State

Else

$statedd = $WrkFileOvr

; example = dd8p$nj

EndIf

$ddfile = "DD" & $Year & $System & "$FD"

; example = dd8p$fd

$Ffile = "0" & $Year & $System & "$F"

; example = 08p$f

$wsmfile = "0" & $Year & $System & "$WSM"

$diagfile = "0" & $Year & $System & "$D"

$printfile = "0" & $Year & $System & "$P"

; end of paths

; combining path keywords will lead you to most files. For example $ddpath & $statedd will lead you to state DD file

Switch $nMsg

Case $Draw

; Search for the Federal / Secondary file

$Search = FileFindFirstFile($ddpath & $ddfile & ".dat")

If $Search = -1 Then ; -1 means file doesn't exist

$Nofile = MsgBox(4, "File Not Found", "The File " & $Ffile & " was not found. Would you like to retrieve it?")

If ($Nofile = 6) Then

FileCopy("G:\WFX32\0" & $Year & $System & "\" & $ddfile & ".*", $ddpath)

FileSetAttrib($ddpath & $ddfile & ".*", "-R")

EndIf

EndIf

; Search for the Primary / State file

$Search = FileFindFirstFile($ddpath & $statedd & ".dat")

If $Search = -1 Then ; -1 means file doesn't exist

$Search = FileFindFirstFile("P:\temp\" & $statedd & ".dat")

If $Search = -1 Then ; -1 means file doesn't exist

MsgBox(0, "File Not Found", "The File " & $statedd & " was not found on C or on P:\temp. Please verify the filename")

Else

$Nofile = MsgBox(4, "File Not Found", "The File " & $statedd & " was not found. Would you like to retrieve it?")

If ($Nofile = 6) Then

FileCopy("P:\temp\" & $statedd & ".*", $ddpath & "*.*", 9)

Run("draw" & $Year & ".exe " & $ddpath & $statedd & " " & $ddpath & $ddfile)

EndIf

EndIf

Else

FileCopy("P:\temp\" & $statedd & ".*", $ddpath & "*.*", 9)

Run("draw" & $Year & ".exe " & $ddpath & $statedd & " " & $ddpath & $ddfile)

EndIf

Case $Roc

Run("roc" & $Year & ".exe " & $ddpath & $statedd & " " & $ddpath & $Ffile, "c:\fx\0" & $Year & "\dd\")

Case $Vamp

If $Override = 1 Then

RunWait("Vamp" & $Year & ".exe " & $ddpath & $Ffile, "c:\fx\0" & $Year & "\dd\")

; Full Vamp when overriden

Else

RunWait("Vamp" & $Year & ".exe " & $ddpath & $Ffile & " " & $State, "c:\fx\0" & $Year & "\dd\")

; Vamp just the state portion when override not present

EndIf

Run("DDut" & $Year & " " & $ddpath & $Ffile & ".dat", "c:\fx\0" & $Year & "\dd\")

Case $Garbo

Run("Garbo" & $Year & ".exe " & $ddpath & $statedd & " " & $ddpath & $Ffile, "c:\fx\0" & $Year & "\dd\")

Case $Greta

Run("Greta" & $Year & ".exe " & $ddpath & $statedd & " " & $ddpath & $Ffile, "c:\fx\0" & $Year & "\dd\")

Case $WSViewer

$Search4 = FileFindFirstFile("C:\Program Files\wsviewer" & $Year & "\WSViewer0" & $Year & ".exe")

If $Search4 = 1 Then

Run("C:\Program Files\wsviewer" & $Year & "\WSViewer0" & $Year & ".exe", "C:\Program Files\wsviewer" & $Year)

Else

$Prior = $Year - 1

Run("C:\Program Files\wsviewer" & $Prior & "\WSViewer0" & $Prior & ".exe", "C:\Program Files\wsviewer" & $Prior)

EndIf

Case $ExtList

Run("cmd /c start c:\fx\0" & $Year & "\dd\dd" & $Year & $System & "$" & $State & ".lst", "", @SW_HIDE)

Case $DocRoc

MsgBox(0, "Error", "This is not implemented at this time")

Case $DocGen

MsgBox(1, "Error", "This is not implemented at this time")

Case $Custom1

Run($Path1, "")

Case $Custom2

Run($Path2, "")

Case $Custom3

Run($Path3, "")

Case $Custom4

Run($Path4, "")

Case $Tax

Run("K:\wfx32\Tax0" & $Year & ".exe", "K:\wfx32\")

Case $Prodproc

Run("K:\wfx32\Prodproc.exe", "K:\wfx32\")

Case $Officmgr

Run("K:\wfx32\Officmgr.exe", "K:\wfx32\")

Case $Help

$Search = FileFindFirstFile("C:\Devtool\wintool.chm")

If $Search = -1 Then

FileCopy("X:\fx\execute\wintool.chm", "c:\DevTool\Wintool.*", 9)

EndIf

Run("C:\Windows\hh.exe C:\Wintool\Wintool.chm", "C:\windows\")

Case $HelpGet

FileCopy("O:\Help\0" & $Year & $System & "$H" & $State & ".rtf", "C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", 9)

FileSetAttrib("C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", "-R")

MsgBox(0, "File Copied", "The File 0" & $Year & $System & "$H" & $State & ".rtf has been retrieved from O:\Help\")

Case $HelpPut

$Search = FileFindFirstFile("C:\Devtool\0" & $Year & $System & "$H" & $State & ".rtf")

If $Search = -1 Then

MsgBox(0, "Error", "The file 0" & $Year & $System & "$H" & $State & ".rtf does not exist locally")

Else

FileSetAttrib("O:\Help\0" & $Year & $System & "$H" & $State & ".rtf", "-R")

FileCopy("C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", "O:\Help\0" & $Year & $System & "$H" & $State & ".rtf", 9)

FileSetAttrib("O:\Help\0" & $Year & $System & "$H" & $State & ".rtf", "R")

MsgBox(0, "File Copied", "The File 0" & $Year & $System & "$H" & $State & ".rtf has been copied to O:\Help\")

EndIf

Case $HelpGen

$Search = FileFindFirstFile("C:\Devtool\0" & $Year & $System & "$H" & $State & ".rtf")

If $Search = -1 Then

$Search = FileFindFirstFile("O:\help\0" & $Year & $System & "$H" & $State & ".rtf")

If $Search = -1 Then

MsgBox(0, "Error", "The File 0" & $Year & $System & "$H" & $State & ".rtf does not exist")

Else

FileCopy("O:\Help\0" & $Year & $System & "$H" & $State & ".rtf", "C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", 9)

FileSetAttrib("C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", "-R")

EndIf

EndIf

If $Search <> -1 Then

Run("Helpgen" & $Year & " C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$H" & $State & ".rtf", "C:\fx\0" & $Year & "\")

EndIf

Case $Xref

FileCopy("O:\Help\Xref\0" & $Year & $System & "$X" & $State & ".rtf", "C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$X" & $State & ".rtf", 9)

FileSetAttrib("C:\fx\0" & $Year & "\dd\0" & $Year & $System & "$X" & $State & ".rtf", "-R")

Case $XrefEdit

Run("cmd /c start " & $ddpath & "\0" & $Year & $System & "$X" & $State & ".rtf", "", @SW_HIDE)

Case $RetrieveST

$Search = FileFindFirstFile("C:\fx\0" & $Year & "\dd\dd" & $Year & $System & "$" & $State & ".*")

If $Search = -1 Then ; -1 means file doesn't exist

FileCopy("P:\temp\dd" & $Year & $System & "$" & $State & ".*", "C:\fx\0" & $Year & "\dd\*.*", 9)

Else

$prompt = MsgBox(1, "Retrieve State", "Are you sure you want to retrieve the state file")

If $prompt = 1 Then

FileMove($ddpath & $statedd & ".*", $ddpath & "\ddbackup\" & $State & "\" & $statedd & ".*", 9)

$btime = FileGetTime($ddpath & "ddbackup\" & $State & "\" & $statedd & ".dat", 0, 0)

RunWait("pkzip " & $ddpath & "\ddbackup\" & $State & "\zipped.zip " & $ddpath & "\ddbackup\" & $State & "\" & $statedd & ".*")

If $btime[3] > 12 Then

$btimehour = ($btime[3] - 12)

Else

$btimehour = ($btime[3])

EndIf

FileCopy($ddpath & "\ddbackup\" & $State & "\zipped.zip", $ddpath & "\ddbackup\" & $State & "\" & $btime[1] & "-" & $btime[2] & "-" & $btimehour & $btime[4] & ".zip", 9)

FileDelete($ddpath & "ddbackup\" & $State & "\zipped.zip")

FileCopy("P:\temp\dd" & $Year & $System & "$" & $State & ".*", "C:\fx\0" & $Year & "\dd\*.*", 9)

EndIf

EndIf

Case $TempMove

FileCopy("P:\temp\dd" & $Year & $System & "$" & $State & ".*", "C:\devtool\ddbackup\0" & $Year & "\" & $State & "\dd" & $Year & $System & "$" & $State & ".*", 9)

FileCopy("C:\fx\0" & $Year & "\dd\dd" & $Year & $System & "$" & $State & ".dat", "P:\temp\dd" & $Year & $System & "$" & $State & ".dat", 9)

FileCopy("C:\fx\0" & $Year & "\dd\dd" & $Year & $System & "$" & $State & ".idx", "P:\temp\dd" & $Year & $System & "$" & $State & ".idx", 9)

MsgBox(0, "Temp Move", "Original file on P:\temp was backed up to C:\Devtool\ddbackup\0" & $Year & "\" & $State)

Case $RetrieveFD

FileDelete($ddpath & $ddfile & ".*")

FileDelete($ddpath & $Ffile & ".*")

FileDelete($ddpath & $wsmfile & ".*")

FileDelete($ddpath & $printfile & ".*")

FileDelete($ddpath & $diagfile & ".*")

_FileCopy("G:\WFX32\0" & $Year & $System & "\" & $ddfile & ".*", $ddpath)

_FileCopy("G:\WFX32\0" & $Year & $System & "\" & $Ffile & ".*", $ddpath)

_FileCopy("G:\WFX32\0" & $Year & $System & "\" & $wsmfile & ".*", $ddpath)

_FileCopy("G:\WFX32\0" & $Year & $System & "\" & $printfile & ".*", $ddpath)

_FileCopy("G:\WFX32\0" & $Year & $System & "\" & $diagfile & ".*", $ddpath)

FileSetAttrib($ddpath & $ddfile & ".*", "-R")

FileSetAttrib($ddpath & $Ffile & ".*", "-R")

FileSetAttrib($ddpath & $wsmfile & ".*", "-R")

FileSetAttrib($ddpath & $printfile & ".*", "-R")

FileSetAttrib($ddpath & $diagfile & ".*", "-R")

$time2 = FileGetTime("C:\fx\08\dd\08p$f.dat", 0)

If Not @error Then

$yyyymd2 = $time2[1] & "/" & $time2[2] & "/" & $time2[0]

MsgBox(1, "title", "retrieved")

GUICtrlSetData($Message, $yyyymd2)

EndIf

Case $HXED

$Search = FileFindFirstFile("C:\DevTool\hxed.exe")

If $Search = -1 Then ; -1 means file doesn't exist

FileCopy("h:\Fulghum\hxed.exe", "c:\Devtool\hxed.exe", 9)

EndIf

Run("C:\DevTool\Hxed.exe", "C:\DevTool\")

Case $BEST

$Search = FileFindFirstFile("C:\Program Files\CCH ELF\BEST\CCH.EFile.BEST.exe")

If $Search = -1 Then ; -1 means file doesn't exist

MsgBox(0, "File Search", "Best tool not installed - Please install")

Else

Run("C:\Program Files\CCH ELF\BEST\CCH.EFile.BEST.exe", "C:\Program Files\CCH ELF\BEST\")

EndIf

Case $Retr

Run("H:\ginger\FileRetriever - 04-07-08\FileRetriever.exe", "H:\ginger\FileRetriever - 04-07-08")

Case $Apply

GUICtrlSetData($Custom1, GUICtrlRead($CustBox))

GUICtrlSetData($Custom2, GUICtrlRead($CustBox2))

GUICtrlSetData($Custom3, GUICtrlRead($CustBox3))

GUICtrlSetData($Custom4, GUICtrlRead($CustBox4))

Case $GUI_EVENT_CLOSE

Exit

Case $System

Select

Case GUICtrlRead($SystemCtrl) = "I"

GUICtrlSetData($Message, $yyyymdi)

Case GUICtrlRead($SystemCtrl) = "C"

GUICtrlSetData($Message, $yyyymdc)

Case GUICtrlRead($SystemCtrl) = "F"

GUICtrlSetData($Message, $yyyymdf)

Case GUICtrlRead($SystemCtrl) = "P"

GUICtrlSetData($Message, $yyyymdp)

Case GUICtrlRead($SystemCtrl) = "S"

GUICtrlSetData($Message, $yyyymds)

Case GUICtrlRead($SystemCtrl) = "X"

GUICtrlSetData($Message, $yyyymdx)

Case GUICtrlRead($SystemCtrl) = "Y"

GUICtrlSetData($Message, $yyyymdy)

EndSelect

EndSwitch

WEnd

Func _FileCopy($fromFile, $tofile)

Local $FOF_RESPOND_YES = 16

Local $FOF_SIMPLEPROGRESS = 256

$winShell = ObjCreate("shell.application")

$winShell.namespace($tofile).CopyHere($fromFile, $FOF_RESPOND_YES)

EndFunc ;==>_FileCopy

Func OnAutoItExit()

IniWrite("Dev.ini", "State", "key", $State)

IniWrite("Dev.ini", "System", "key", $System)

IniWrite("Dev.ini", "Year", "key", $Year)

IniWrite("Dev.ini", "Custom1", "key", $CustVar)

IniWrite("Dev.ini", "Custom2", "key", $CustVar2)

IniWrite("Dev.ini", "Custom3", "key", $CustVar3)

IniWrite("Dev.ini", "Custom4", "key", $CustVar4)

IniWrite("Dev.ini", "Path1", "key", $Path1)

IniWrite("Dev.ini", "Path2", "key", $Path2)

IniWrite("Dev.ini", "Path3", "key", $Path3)

IniWrite("Dev.ini", "Path4", "key", $Path4)

IniWrite("Dev.ini", "Override", "key", $Override)

IniWrite("Dev.ini", "Primary File", "key", $WrkFileOvr)

EndFunc ;==>OnAutoItExit

I was able to take some sample code I found on here and it tweak it so that it works exactly like I want. Just can't figure out what is different here and in my setup.

CODE
#include <GuiConstants.au3>

$hWnd = GuiCreate("",150,50)

$hCombo = GUICtrlCreateCombo("",5,5,80)

GUICtrlSetData(-1,"C|S|P|I|L","OFF")

$hInput = GuiCtrlCreateLabel("Kurt",85,10,100,20)

GuiSetState()

While 1

$nmsg = GuiGetMsg()

Switch $nmsg

Case $GUI_EVENT_CLOSE

Exit

Case $hCombo

Select

Case GuiCtrlRead($hCombo) = "I"

GUICtrlSetData($hInput,"Individual")

Case GuiCtrlRead($hCombo) = "C"

GUICtrlSetData($hInput,"Corporate")

Case GuiCtrlRead($hCombo) = "S"

GUICtrlSetData($hInput,"S Corp")

Case GuiCtrlRead($hCombo) = "P"

GUICtrlSetData($hInput,"Partnership")

EndSelect

EndSwitch

WEnd

Edited by Kurto2021

Share this post


Link to post
Share on other sites



The second script works for me (as far as it goes - there is no selection case for "L").

What was your exact question?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I think:

Case $SystemoÝ÷ Ù(hºW[y«­¢+Ù
ÍÀÌØíMåÍѵ
ÑÉ

WBD

Share this post


Link to post
Share on other sites

$system is always true, that's why "case $System" updates the label in each loop.

Additionally I saw that you used $Message for 2 different labels :D...

Share this post


Link to post
Share on other sites

To further elaborate on KaFu's most correct post... just look up "Switch...Case...EndSwitch" and "Select...Case...EndSelect" in the helpfile and note the differences.

Share this post


Link to post
Share on other sites

$system is always true, that's why "case $System" updates the label in each loop.

Additionally I saw that you used $Message for 2 different labels :D...

I told you it was pretty sloppy....I have been learning as I go.

SystemCtrl worked great.....You guys rule. Now I must use my rudimentary skills to help others.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0