Jump to content

Recommended Posts

Posted (edited)

Hello,

I would appreciate any help on this...I am trying to compile this script

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=harddisc.ico
#AutoIt3Wrapper_outfile=rmaparts.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#Include <GuiEdit.au3>


Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

Local $ilc, $ilc2, $sn, $i, $p, $opd, $oin, $edit1max, $location, $blob, $locationcarrriagereturn, $locationspace
$i= 1
$p= 0
$ilc=""
$ilc2=""
$sn=""
$opd=""
$oin=""

$p=InputBox("Number Of Parts ","Number Of Parts Being Checked In")

Do
$ilc=InputBox("What is the ILC?", "What is the ILC?")
$sn=InputBox("What is the Serial Number?", "What is The Serial Number? If There Is No Serial Number, Enter N/A or leave BLANK")
$opd=InputBox("What was the Original Purchase Date?", "What was the Original Purchase Date?")
$oin=InputBox("What is The Original Invoice Number?", "What is The Original Invoice Number")

Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Issue", 615, 222, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$Label1 = GUICtrlCreateLabel("Please Describe The Customer's Issue For The Technician", 88, 0, 416, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Edit1 = GUICtrlCreateEdit("", 16, 32, 577, 113, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetResizing(-1, $GUI_DOCKHCENTER)
$Button1 = GUICtrlCreateButton("OK", 240, 160, 105, 33, 0)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)

Func Button1Click()
$blob = GUICtrlRead($edit1)
$edit1max = StringLen($blob) ;number
;~ Exit
GUIDelete()

EndFunc

WinWaitClose("Issue","Please Describe The Customer's Reason For RMA")

Func CLOSEClicked()
EndFunc
Func datetime()
   $min=string(@MIN)
   $hour=@HOUR
   $day=string(@MDAY)
   $mon=string(@MON)
   $year=string(@YEAR)
   If $hour=00 then
      $hour="24"
   Else
      $hour=string(@HOUR)
   Endif
   $time = $hour & ":" & $min
   $date= $mon & "/" & $day & "/" & $year
   $dt=$time & " ON  " & $date
   Return ($dt)
EndFunc
$dt=datetime()
WinWait("Microsoft Store Operations POS","")
If Not WinActive("Microsoft Store Operations POS","") Then WinActivate("Microsoft Store Operations POS","")
WinWaitActive("Microsoft Store Operations POS","")
;~  work order mode detect by color
$POS="Microsoft Store Operations POS"
$POSposition = WinGetPos($POS)
$coord = PixelSearch( $POSposition[0], $POSposition[1], $POSposition[0]+200, $POSposition[1]+200, 0xFFFF00 )

If @error Then
    Send("^{F2}")
;~  work order mode toggle
EndIf
Send("{F2}")
WinWait("Items (All)","")
If Not WinActive("Items (All)","") Then WinActivate("Items (All)","")
WinWaitActive("Items (All)","")
ControlClick("Items (All)","","[ID:3]")
WinWait("Items (All)","")
If Not WinActive("Find Items","") Then WinActivate("Find Items","")
WinWaitActive("Find Items","")
ControlClick("Find Items","","[ID:1001]")
send($ilc)
ControlClick("Find Items","","[ID:12]")
SLEEP(1000)
WinWait("Items (All)","")
If Not WinActive("Find Items","") Then WinActivate("Find Items","")
WinWaitActive("Find Items","")
ControlClick("Find Items","","[ID:9]")
WinWait("Items (All)","")
If Not WinActive("Items (All)","") Then WinActivate("Items (All)","")
WinWaitActive("Items (All)","")
ControlClick("Items (All)","","[ID:7]")
WinWait("Item Properties:","")
If Not WinActive("Item Properties:","") Then WinActivate("Item Properties:","")
WinWaitActive("Item Properties:","")
ControlClick("Item Properties: ","","[ID:20]")
send("^{c}")
$ilc2= ClipGet()
ControlClick("Item Properties: ","","[ID:5]")
WinWait("Items (All)","")
If Not WinActive("Items (All)","") Then WinActivate("Items (All)","")
WinWaitActive("Items (All)","")
ControlClick("Items (All)","","[ID:10]")
WinWaitActive("Microsoft Store Operations POS","")
WinWait("Microsoft Store Operations POS","")
If Not WinActive("Microsoft Store Operations POS","") Then WinActivate("Microsoft Store Operations POS","")
WinWaitActive("Microsoft Store Operations POS","")
Send("{DOWN}0{ENTER}{UP}{CTRLDOWN}{F10}{CTRLUP}")
Send("Part # "&$i&"{CTRLDOWN}{ENTER}{CTRLUP}")
Send("ILC: "&$ilc&"{CTRLDOWN}{ENTER}{CTRLUP}")
Send("SN: "&$sn&"{CTRLDOWN}{ENTER}{CTRLUP}")
Send("Description: "&$ilc2&"{CTRLDOWN}{ENTER}{CTRLUP}")
Send("Original Purchase Date: "&$opd&"{CTRLDOWN}{ENTER}{CTRLUP}")
Send("Original Invoice Number: "&$oin&"{CTRLDOWN}{ENTER}{CTRLUP}")
send("{ENTER}")
ClipPut("")
WinWait("Microsoft Store Operations POS","")
If Not WinActive("Microsoft Store Operations POS","") Then WinActivate("Microsoft Store Operations POS","")
WinWaitActive("Microsoft Store Operations POS","")
Send("{DOWN}0{ENTER}{UP}^{F10}")
;~ MsgBox(0,"stop3","")
WinWait("Comment","")
If Not WinActive("Comment","") Then WinActivate("Comment","")
WinWaitActive("Comment","")
Send("^{enter}ISSUE:^{enter}")

;~ continous issue data: resolved feb 20/10

while 1

    $locationcarrriagereturn = StringInStr($blob,@CR,0,1,240);find key seperator for carriage returns
;~  MsgBox(0,"carriage return location",$locationcarrriagereturn)

    $locationspace = StringInStr($blob," ",0,1,240);find key seperator for space seperators
;~  MsgBox(0,"space location",$locationspace)

;~      choose shorter position
            if $locationcarrriagereturn < $locationspace Then
            $location = $locationcarrriagereturn
            Else
            $location = $locationspace
            EndIf


;~      check if leftover text is shorter than limit, then print last of text and exit
            if $location < 1 then
;~              MsgBox(0,"final page",$location)
;~              WinActivate("Untitled - Notepad")
;~              Send(StringLeft(StringReplace($blob,@CRLF,"|||"),$location))
                Send(StringLeft(StringReplace($blob,@CRLF,"^{enter}"),$location))

;~          close final comment box
                Send("{ENTER}")
                ExitLoop
            EndIf

;~              WinActivate("Untitled - Notepad")
;~              Send(StringLeft(StringReplace($blob,@CRLF,"|||"),$location))
                Send(StringLeft(StringReplace($blob,@CRLF,"^{enter}"),$location))


;~ close comment box
        Send("{ENTER}")

        $blob = StringTrimLeft($blob,$location) ;resize the edit text

;~ WEnd
WinWait("Microsoft Store Operations POS","")
If Not WinActive("Microsoft Store Operations POS","") Then WinActivate("Microsoft Store Operations POS","")
WinWaitActive("Microsoft Store Operations POS","")
Send("{DOWN}0{ENTER}{UP}^{F10}")
;~ MsgBox(0,"stop3","")
WinWait("Comment","")
If Not WinActive("Comment","") Then WinActivate("Comment","")
WinWaitActive("Comment","")
WEnd
$i = $i + 1
Until $i = $p



WinWait("Microsoft Store Operations POS","")
If Not WinActive("Microsoft Store Operations POS","") Then WinActivate("Microsoft Store Operations POS","")
WinWaitActive("Microsoft Store Operations POS","")
Send("{DOWN}0{ENTER}{UP}^{F10}")
Send("PLEASE TEST THE INCLUDED PART(S) FOR THE CUSTOMER")
Send("{ENTER}")
Send("{SHIFTDOWN}{F9}{SHIFTUP}")
WinWait("Work Order Information","")
If Not WinActive("Work Order Information","") Then WinActivate("Work Order Information","")
WinWaitActive("Work Order Information","")
Send("RMA PART(S){TAB}")
Send("CHECKED IN AT: " & $dt & ")
Send("{ENTER}")
MsgBox(0,"IMPORTANT", "PLEASE PRINT ANY INVOICES RELATING TO THE PART(S) ON THIS WORK ORDER")
Send("{SHIFTDOWN}{F7}{SHIFTUP}")

and I keep getting the error

Edited by cgycowboy
Posted

H:\POS TOOLS\rmaparts.au3(45,1) : ERROR: missing Until <expr>.

Func

^

H:\POS TOOLS\rmaparts.au3(28,1) : REF: missing Until <expr>.

Do

^

H:\POS TOOLS\rmaparts.au3(191,1) : ERROR: syntax error

Until

^

H:\POS TOOLS\rmaparts.au3 - 2 error(s), 0 warning(s)

It's probably something simple I am missing, but I can't figure it out....any help would be appreciated

Posted (edited)

Well yeah you can do a loop, but maybe not the loop. At the least one without defining a function in it.

Edit: I guess what I'm saying is you can call a function from a loop, but the function itself is created outside the loop. In AutoIt, the function(s) can be created in the code after a loop.

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted (edited)

Hi,

resorting your code should solve your problems.

If you define a function, the function could be called from everywhere inbeetween your code.

You should structure your code better, like:

1) includes

2) Variable declarations

3) Main Code

4) Functions

....

  Reveal hidden contents

;-))

Stefan

Edited by 99ojo
Posted

  On 2/22/2010 at 8:37 AM, '99ojo said:

Hi,

resorting your code should solve your problems.

If you define a function, the function could be called from everywhere inbeetween your code.

You should structure your code better, like:

1) includes

2) Variable declarations

3) Main Code

4) Functions

....

  Reveal hidden contents

;-))

Stefan

Thank You Very Much

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
  • Recently Browsing   0 members

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