Jump to content

not reading my variables it seems


gcue
 Share

Recommended Posts

i dont think my variables are being read. any ideas why?

any help would be greatly appreciated

thanks in advance

Opt("GUIOnEventMode", 1)
#Include <GuiConstants.au3>
#Include <Constants.au3>

If FileExists("test.txt") Then
    FileDelete("test.txt")
EndIf

GUICreate("Macro Builder v0.1", 620,520, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES


$filemenu = GUICtrlCreateMenu ("&About")

GUICtrlCreateLabel("Requestor:", 10, 15)
$requestor = GUICtrlCreateInput ("", 10,  35, 300, 20)

GUICtrlCreateLabel("Keyword:", 10, 65)
$keyword = GUICtrlCreateInput ("", 10,  85, 300, 20)

GUICtrlCreateLabel("Assigned To:", 10, 115)
$assigned = GUICtrlCreateInput ("", 10,  135, 300, 20)

GUICtrlCreateLabel("Location:", 10, 165)
$location = GUICtrlCreateInput ("", 10,  185, 300, 20)

GUICtrlCreateLabel("Site:", 10, 215)
$site = GUICtrlCreateInput ("", 10,  235, 300, 20)

GUICtrlCreateLabel("Status:", 10, 265)
$status = GUICtrlCreateInput ("", 10,  285, 300, 20)

GUICtrlCreateLabel("Submitter:", 10, 315)
$submitter = GUICtrlCreateInput ("", 10,  335, 300, 20)

GUICtrlCreateLabel("Date:", 10, 365)
$date = GUICtrlCreateInput ("mm/dd/yyyy", 10,  385, 300, 20)

$btn = GUICtrlCreateButton ("Ok", 270,440,80,40,0x0300)
GUICtrlSetOnEvent($btn, "OKBTN")
GUISetOnEvent($GUI_EVENT_CLOSE, "XButton")
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)
WEnd

Func OKBTN()
    $file = FileOpen("test.txt", 1)
 If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
 EndIf
    FileWrite($file, $requestor)
;       FileWrite($file, "Keyword: " & $keyword & " test" & @CRLF)
;       FileWrite($file, $assigned & @CRLF)
;   FileWrite($file, $keyword & @CRLF)
    FileClose($file)
;MsgBox(0, "Macro Saved", "Macro saved to: C:\Program Files\AR System\HOME\ARCmds")
 Exit
EndFunc

Func Xbutton()
  Exit
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...