Sign in to follow this  
Followers 0
ThaSatelliteGuy

My Program Errors Out on Another Machine?

13 posts in this topic

I wrote a program of about 1000 lines for converting a text file to a csv file for another program to use as an import. Anyways, the program gives XP a "serious error" (You know, Send or Don't Send a Report)

This happens when running on another machine(besides teh one I wrote it on)

This other machine had an older version of AutoIT, so I installed the newer version and it worked fine.

Curious, (mainly because I need to email this prog out to others) I uninstalled the new version, and the error returned.

Now I re-installed the AutoIT, but this time the error persists...

Bug in 3.2.2.0, or Bug in my Prog????

Also, the error only shows itself in a FileSaveDialog, and to boot, it'll not error until you enter the first char of the target you want to save as. If you let it sit empty, it'll sit idle all day long. ?????- Confused

Will post script if needed.... I just need it to run...BADLY!

Share this post


Link to post
Share on other sites



Dim $RunProg
Dim $MenuChoice
Dim $SetupLocationsID
Dim $SetupGlobalsID
Dim $ConvID
Dim $QuitID
Dim $GUI_EVENT_CLOSE
Dim $JobString
Dim $ImportFile
Dim $RecordArray[1000]
Dim $RecordCount
Dim $LocID[100]
Dim $TechNum[100]
Dim $EditLocChoice
Dim $NewLoc
Dim $NewTechNum
Dim $LocString
Dim $CurEditLoc
Dim $RawFile
Dim $CSVFile
Dim $RawLine
Dim $WOStartLine
Dim $WOLineNumber
Dim $ChkMonth
Dim $Cnt1
Dim $Cnt2
Dim $Cnt3
Dim $Header
Dim $Ack
Dim $MGTAREA
Dim $DSSOffice
Dim $TechNumber
Dim $WONumber
Dim $Units
Dim $CSG_Status
Dim $WOType
Dim $CSG_LAST_CHANGED_DATE
Dim $AutoAssignTechNum
Dim $ScheduleDate
Dim $AcctNum
Dim $CustPhone1
Dim $CustPhone2
Dim $CustName
Dim $CustAddr
Dim $ChkEOL
Dim $NameLength
Dim $AddrLength
Dim $CustCity
Dim $CityLength
Dim $CustState
Dim $CustZip
Dim $DashPOS
Dim $Note1
Dim $Note2
Dim $BillCode[15]
Dim $NOC
Dim $CodeString
Dim $CurLoc
Dim $Activity
Dim $MDU
Dim $HardDeliv
Dim $Classes
Dim $WOCreated
Dim $WOInsert
Dim $Reason1
Dim $Reason2
Dim $Reason3
Dim $Reason4
Dim $Reso1
Dim $Reso2
Dim $Reso3
Dim $Reso4
Dim $NBU
Dim $RR_Cand
Dim $RBU
Dim $Category
Dim $Segment
Dim $RetName
Dim $AM
Dim $StateString
Dim $GlobalChoice
Dim $CheckLine
Dim $PossLineNumber
Dim $Char
Dim $FinalJobCount
Dim $StateID[50]
Dim $StateCount
#include<string.au3>
;******************************************************* USER EDITABLE VARIABLES***************************************************
;$StateString = "|AR|TX|NM|LA"
;***************************************************************************************************
*******************************
$RecordCount = 0
$Virgin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars" & $Cnt2, "Virgin")
If $Virgin <> "No" Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "ACK","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MGTAREA","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Units","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "CSG","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AutoTech","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Activity","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MDU","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Delivery","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Classes","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason1","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason2","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason3","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason4","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso1","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso2","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso3","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso4","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "NBU","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RRC","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RBU","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Category","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Segment","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RetName","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AM","REG_SZ","")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Virgin","REG_SZ","No")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars\States", "State_1","REG_SZ","TX")
EndIf
$RunProg = "Yes"
While $RunProg = "Yes"
GUICreate("Welcome To DevelopeThis!",500,240)
GUISetState (@SW_SHOW)
$SetupLocationsID = GUICtrlCreateButton ("Change/Add Locations",50,40,190,50)
$SetupGlobalsID = GUICtrlCreateButton ("Setup Global Variables",260,40,190,50)
$ConvID = GUICtrlCreateButton ("Convert WebConnect Jobs for GRID Import",50,125,400,50)
$QuitID = GUICtrlCreateButton ("Quit",440,200,35,20)
$MenuChoice = "Hold Open"
While $MenuChoice = "Hold Open"
    $msg = GUIGetMsg()
    Select
        Case $msg= $SetupLocationsID
            $MenuChoice = "Setup"
        Case $msg= $SetupGlobalsID
            $MenuChoice = "SetGlobals"
        Case $msg= $ConvID
            $MenuChoice = "Convert"
        Case $msg= $QuitID
            $MenuChoice = "Quit"
        EndSelect
Wend
GUIDelete()
If $MenuChoice = "Setup" Then
    $ComboChoice1 = "New Location"
    $LocString = ""
    $Cnt2 = 0
    While @error <> 1
        $Cnt2 = $Cnt2 + 1
        $LocID[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $Cnt2, "LocName")
        $TechNum[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $Cnt2, "TechNum")
    WEnd    
    $LocCount = $Cnt2 - 1
    $Cnt2 = 0
    If $LocCount > 0 Then
        While $Cnt2 < $LocCount
            $Cnt2 = $Cnt2 + 1
            $LocString = $LocString & "|" & $LocID[$Cnt2]
        WEnd
    GUICreate("Setup Locations!",200,175)
    GUISetState (@SW_SHOW)
    $ContID = GUICtrlCreateButton ("Continue",50,105,100,25)
    $ComboChoice1 = GUICtrlCreateCombo ("Select Location:", 50,40)
    GUICtrlSetData($ComboChoice1,"|New Location" & $LocString, "New Location")
    GUISetState ()
        $SetupChoice = "Hold Open"
        While $SetupChoice = "Hold Open"
            $msg = GUIGetMsg()
            Select
                Case $msg= $ContID
                    $SetupChoice = "Continue"
            EndSelect
        Wend
    $ComboChoice1 = GUICtrlRead($ComboChoice1)
    GUIDelete()
    EndIf   
If $ComboChoice1 <> "New Location" Then
    $Cnt2 = 0
    While $Cnt2 < $LocCount
        $Cnt2 = $Cnt2 + 1
        If $LocID[$Cnt2] = $ComboChoice1 Then $CurEditLoc = $Cnt2
    WEnd    
    $NewLoc = $LocID[$CurEditLoc]
    $NewTechNum = $TechNum[$CurEditLoc]
    $EditLocChoice = "Hold Open"
    While $EditLocChoice <> "Quit"
                GUICreate("Edit A DSS Office Location!",300,240)
                GUISetState (@SW_SHOW)
                GUICtrlCreateLabel ("Location Name:",30, 25)
                GUICtrlCreateLabel($NewLoc, 40, 45)
                $EditNewLocID = GUICtrlCreateButton ("Change",175,33,100,20)
                GUICtrlCreateLabel ("Tech Number:",30, 80)
                GUICtrlCreateLabel($NewTechNum, 40, 103)
                $EditNewTechID = GUICtrlCreateButton ("Change",175,93,100,20)
                $QuitID = GUICtrlCreateButton ("Return",100,180,100,30)
                GUISetState ()
            $EditLocChoice = "Hold Open"
            While $EditLocChoice = "Hold Open"
                $msg = GUIGetMsg()
                Select
                    Case $msg= $EditNewLocID
                        $EditLocChoice = "EditName"
                    Case $msg= $EditNewTechID
                        $EditLocChoice = "EditTechNum"
                    Case $msg= $QuitID
                        $EditLocChoice = "Quit"
                EndSelect
            Wend
            GUIDelete()
            If $EditLocChoice = "EditName" Then
                $NewLoc = InputBox("New Location:", "Enter Location Name:")
            EndIf
            If $EditLocChoice = "EditTechNum" Then
                $NewTechNum = InputBox("New Location:", "Enter Tech Number Designation:")
            EndIf   
            If $EditLocChoice = "Quit" Then
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $CurEditLoc, "LocName","REG_SZ",$NewLoc)
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $CurEditLoc, "TechNum","REG_SZ",$NewTechNum)
                MsgBox(0,"Record Updated!","Area " & Chr (34) & $NewLoc & Chr (34) & " Has Been Successfully Updated!")
                ExitLoop
            EndIf   
    WEnd
EndIf   
If $LocCount = 0 Or $ComboChoice1 = "New Location" Then
    $EditLocChoice = "NoQuit"
    $NewLoc = ""
    $NewTechNum = ""
    While $EditLocChoice <> "Quit"
            GUICreate("Add A DSS Office Location!",300,240)
            GUISetState (@SW_SHOW)
            GUICtrlCreateLabel ("Location Name:",30, 25)
            GUICtrlCreateLabel($NewLoc, 40, 37)
            $EditNewLocID = GUICtrlCreateButton ("Change",175,33,100,20)
            GUICtrlCreateLabel ("Tech Number:",30, 80)
            GUICtrlCreateLabel($NewTechNum, 40, 92)
            $EditNewTechID = GUICtrlCreateButton ("Change",175,93,100,20)
            $QuitID = GUICtrlCreateButton ("Return",100,180,100,30)
            GUISetState ()
        $EditLocChoice = "Hold Open"
        While $EditLocChoice = "Hold Open"
            $msg = GUIGetMsg()
            Select
                Case $msg= $EditNewLocID
                    $EditLocChoice = "EditName"
                Case $msg= $EditNewTechID
                    $EditLocChoice = "EditTechNum"
                Case $msg= $QuitID
                    $EditLocChoice = "Quit"
            EndSelect
        Wend
        GUIDelete()
        If $EditLocChoice = "EditName" Then
            $NewLoc = InputBox("New Location:", "Enter Location Name:")
        EndIf
        If $EditLocChoice = "EditTechNum" Then
            $NewTechNum = InputBox("New Location:", "Enter Tech Number Designation:")
        EndIf   
        If $EditLocChoice = "Quit" Then
            If $NewLoc = "" Then ExitLoop
                If $NewLoc <> "" Then
                    $Cnt2 = 0
                    $Duplicate = "No"
                    While $Cnt2 < $LocCount
                        $Cnt2 = $Cnt2 + 1
                        If $NewLoc = $LocID[$Cnt2] Then
                            $Duplicate = "Yes"
                            ExitLoop
                        EndIf
                    WEnd
                    If $Duplicate = "No" Then
                        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $LocCount + 1, "LocName","REG_SZ",$NewLoc)
                        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $LocCount + 1, "TechNum","REG_SZ",$NewTechNum)
                    ElseIf $Duplicate = "Yes" Then
                        MsgBox(0,"Duplicate Location!","Location Already Exists!")
                    EndIf
                EndIf
        EndIf   
    WEnd
EndIf
EndIf
If $MenuChoice = "SetGlobals" Then
;Get Variables From Global Locations in the Registry, And Load them into Variables.
While $GlobalChoice <> "Back"
$Ack = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Ack")
$MGTAREA = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MGTAREA")
$Units = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Units")
$CSG_Status = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "CSG")
$AutoAssignTechNum = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AutoTech")
$Activity = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Activity")
$MDU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MDU")
$HardDeliv = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Delivery")
$Classes = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Classes")
$WOCreated = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "WOCreated")
$WOInsert = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Insert")
$Reason1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason1")
$Reason2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason2")
$Reason3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason3")
$Reason4 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason4")
$Reso1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso1")
$Reso2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso2")
$Reso3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso3")
$Reso4 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso4")
$NBU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "NBU")
$RR_Cand = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RRC")
$RBU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RBU")
$Category = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Category")
$Segment = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Segment")
$RetName = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RetName")
$AM = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AM")
GUICreate("Setup Global Variables For DevelopeThis!",740,540)
GUISetState (@SW_SHOW)
GUICtrlCreateLabel ("Column A",20,30,100,20,0x01)
GUICtrlCreateLabel ($Ack,20,50,100,20,0x01)
$Col_A_ID = GUICtrlCreateButton ("Change",20,70,100,20)
GUICtrlCreateLabel ("Column B",140,30,100,20,0x01)
GUICtrlCreateLabel ($MGTAREA,140,50,100,20,0x01)
$Col_B_ID = GUICtrlCreateButton ("Change",140,70,100,20)
GUICtrlCreateLabel ("Column C",260,30,100,20,0x01)
GUICtrlCreateLabel ("From Location ID",260,50,100,20,0x01)
;$Col_C_ID = GUICtrlCreateButton ("Change",260,70,100,20)
GUICtrlCreateLabel ("Column D",380,30,100,20,0x01)
GUICtrlCreateLabel ($Units,380,50,100,20,0x01)
$Col_D_ID = GUICtrlCreateButton ("Change",380,70,100,20)
GUICtrlCreateLabel ("Column E",500,30,100,20,0x01)
GUICtrlCreateLabel ($CSG_Status,500,50,100,20,0x01)
$Col_E_ID = GUICtrlCreateButton ("Change",500,70,100,20)
GUICtrlCreateLabel ("Column F",620,30,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",620,50,100,20,0x01)
;$Col_F_ID = GUICtrlCreateButton ("Change",620,70,100,20)
GUICtrlCreateLabel ("Column G",20,100,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",20,120,100,20,0x01)
;$Col_G_ID = GUICtrlCreateButton ("Change",20,140,100,20)
GUICtrlCreateLabel ("Column H",140,100,100,20,0x01)
GUICtrlCreateLabel ($AutoAssignTechNum,140,120,100,20,0x01)
$Col_H_ID = GUICtrlCreateButton ("Change",140,140,100,20)
GUICtrlCreateLabel ("Column I",260,100,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",260,120,100,20,0x01)
;$Col_I_ID = GUICtrlCreateButton ("Change",260,140,100,20)
GUICtrlCreateLabel ("Column J",380,100,100,20,0x01)
GUICtrlCreateLabel ($Activity,380,120,100,20,0x01)
$Col_J_ID = GUICtrlCreateButton ("Change",380,140,100,20)
GUICtrlCreateLabel ("Column K",500,100,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",500,120,100,20,0x01)
;$Col_K_ID = GUICtrlCreateButton ("Change",500,140,100,20)
GUICtrlCreateLabel ("Column L",620,100,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",620,120,100,20,0x01)
;$Col_L_ID = GUICtrlCreateButton ("Change",620,140,100,20)
GUICtrlCreateLabel ("Column M",20,170,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",20,190,100,20,0x01)
;$Col_M_ID = GUICtrlCreateButton ("Change",20,210,100,20)
GUICtrlCreateLabel ("Column N",140,170,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",140,190,100,20,0x01)
;$Col_N_ID = GUICtrlCreateButton ("Change",140,210,100,20)
GUICtrlCreateLabel ("Column O",260,170,100,20,0x01)
GUICtrlCreateLabel ($MDU,260,190,100,20,0x01)
$Col_O_ID = GUICtrlCreateButton ("Change",260,210,100,20)
GUICtrlCreateLabel ("Column P",380,170,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",380,190,100,20,0x01)
;$Col_P_ID = GUICtrlCreateButton ("Change",380,210,100,20)
GUICtrlCreateLabel ("Column Q",500,170,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",500,190,100,20,0x01)
;$Col_Q_ID = GUICtrlCreateButton ("Change",500,210,100,20)
GUICtrlCreateLabel ("Column R",620,170,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",620,190,100,20,0x01)
;$Col_R_ID = GUICtrlCreateButton ("Change",620,210,100,20)
GUICtrlCreateLabel ("Column S",20,240,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",20,260,100,20,0x01)
;$Col_S_ID = GUICtrlCreateButton ("Change",20,280,100,20)
GUICtrlCreateLabel ("Column T",140,240,100,20,0x01)
GUICtrlCreateLabel ($HardDeliv,140,260,100,20,0x01)
$Col_T_ID = GUICtrlCreateButton ("Change",140,280,100,20)
GUICtrlCreateLabel ("Column U",260,240,100,20,0x01)
GUICtrlCreateLabel ($Classes,260,260,100,20,0x01)
$Col_U_ID = GUICtrlCreateButton ("Change",260,280,100,20)
GUICtrlCreateLabel ("Column V",380,240,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",380,260,100,20,0x01)
;$Col_V_ID = GUICtrlCreateButton ("Change",380,280,100,20)
GUICtrlCreateLabel ("Column W",500,240,100,20,0x01)
GUICtrlCreateLabel ("Same As Col V",500,260,100,20,0x01)
;$Col_W_ID = GUICtrlCreateButton ("Change",500,280,100,20)
GUICtrlCreateLabel ("Column X",620,240,100,20,0x01)
GUICtrlCreateLabel ($Reason1,620,260,100,20,0x01)
$Col_X_ID = GUICtrlCreateButton ("Change",620,280,100,20)
GUICtrlCreateLabel ("Column Y",20,310,100,20,0x01)
GUICtrlCreateLabel ($Reason2,20,330,100,20,0x01)
$Col_Y_ID = GUICtrlCreateButton ("Change",20,350,100,20)
GUICtrlCreateLabel ("Column Z",140,310,100,20,0x01)
GUICtrlCreateLabel ($Reason3,140,330,100,20,0x01)
$Col_Z_ID = GUICtrlCreateButton ("Change",140,350,100,20)
GUICtrlCreateLabel ("Column AA",260,310,100,20,0x01)
GUICtrlCreateLabel ($Reason4,260,330,100,20,0x01)
$Col_AA_ID = GUICtrlCreateButton ("Change",260,350,100,20)
GUICtrlCreateLabel ("Column AB",380,310,100,20,0x01)
GUICtrlCreateLabel ($Reso1,380,330,100,20,0x01)
$Col_AB_ID = GUICtrlCreateButton ("Change",380,350,100,20)
GUICtrlCreateLabel ("Column AC",500,310,100,20,0x01)
GUICtrlCreateLabel ($Reso2,500,330,100,20,0x01)
$Col_AC_ID = GUICtrlCreateButton ("Change",500,350,100,20)
GUICtrlCreateLabel ("Column AD",620,310,100,20,0x01)
GUICtrlCreateLabel ($Reso3,620,330,100,20,0x01)
$Col_AD_ID = GUICtrlCreateButton ("Change",620,350,100,20)
GUICtrlCreateLabel ("Column AE",20,380,100,20,0x01)
GUICtrlCreateLabel ($Reso4,20,400,100,20,0x01)
$Col_AE_ID = GUICtrlCreateButton ("Change",20,420,100,20)
GUICtrlCreateLabel ("Column AF",140,380,100,20,0x01)
GUICtrlCreateLabel ($NBU,140,400,100,20,0x01)
$Col_AF_ID = GUICtrlCreateButton ("Change",140,420,100,20)
GUICtrlCreateLabel ("Column AG",260,380,100,20,0x01)
GUICtrlCreateLabel ($RR_Cand,260,400,100,20,0x01)
$Col_AG_ID = GUICtrlCreateButton ("Change",260,420,100,20)
GUICtrlCreateLabel ("Column AH",380,380,100,20,0x01)
GUICtrlCreateLabel ($RBU,380,400,100,20,0x01)
$Col_AH_ID = GUICtrlCreateButton ("Change",380,420,100,20)
GUICtrlCreateLabel ("Column AI",500,380,100,20,0x01)
GUICtrlCreateLabel ($Category,500,400,100,20,0x01)
$Col_AI_ID = GUICtrlCreateButton ("Change",500,420,100,20)
GUICtrlCreateLabel ("Column AJ",620,380,100,20,0x01)
GUICtrlCreateLabel ($Segment,620,400,100,20,0x01)
$Col_AJ_ID = GUICtrlCreateButton ("Change",620,420,100,20)
GUICtrlCreateLabel ("Column AK",20,450,100,20,0x01)
GUICtrlCreateLabel ("Pulled From W/O",20,470,100,20,0x01)
;$Col_AK_ID = GUICtrlCreateButton ("Change",20,490,100,20)
GUICtrlCreateLabel ("Column AL",140,450,100,20,0x01)
GUICtrlCreateLabel ($RetName,140,470,100,20,0x01)
$Col_AL_ID = GUICtrlCreateButton ("Change",140,490,100,20)
GUICtrlCreateLabel ("Column AM",260,450,100,20,0x01)
GUICtrlCreateLabel ($AM,260,470,100,20,0x01)
$Col_AM_ID = GUICtrlCreateButton ("Change",260,490,100,20)
$NewState_ID = GUICtrlCreateButton ("Add States",380,490,100,20)
$QuitID = GUICtrlCreateButton ("Back",675,500,45,25)
;***************************************************************************************************
******************************
$Cnt2 = 0
$GoLoop = "Yes"
$StateString = ""
While $GoLoop = "Yes"
    $Cnt2 = $Cnt2 + 1
    $StateID[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars\States", "State_" & $Cnt2)
    If $StateID[$Cnt2] = "" Then ExitLoop
WEnd    
$StateCount = $Cnt2 - 1
$Cnt2 = 0
While $Cnt2 < $StateCount
    $Cnt2 = $Cnt2 + 1
    $StateString = $StateString & "|" & $StateID[$Cnt2]
WEnd
;***************************************************************************************************
******************************
$GlobalChoice = "Hold Open"
While $GlobalChoice = "Hold Open"
    $msg = GUIGetMsg()
    Select
        Case $msg= $QuitID
            $GlobalChoice = "Back"
        Case $msg= $Col_A_ID
            $GlobalChoice = "Col_A"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column A")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "ACK","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_B_ID
            $GlobalChoice = "Col_B"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column B")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MGTAREA","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_D_ID
            $GlobalChoice = "Col_D"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column D")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Units","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_E_ID
            $GlobalChoice = "Col_E"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column E")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "CSG","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_H_ID
            $GlobalChoice = "Col_H"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column H")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AutoTech","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_J_ID
            $GlobalChoice = "Col_J"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column J")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Activity","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_O_ID
            $GlobalChoice = "Col_O"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column O")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MDU","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_T_ID
            $GlobalChoice = "Col_T"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column T")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Delivery","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_U_ID
            $GlobalChoice = "Col_U"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column U")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Classes","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_X_ID
            $GlobalChoice = "Col_X"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column X")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason1","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_Y_ID
            $GlobalChoice = "Col_Y"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column Y")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason2","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_Z_ID
            $GlobalChoice = "Col_Z"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column Z")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason3","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AA_ID
            $GlobalChoice = "Col_AA"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AA")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason4","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AB_ID
            $GlobalChoice = "Col_AB"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AB")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso1","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AC_ID
            $GlobalChoice = "Col_AC"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AC")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso2","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AD_ID
            $GlobalChoice = "Col_AD"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AD")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso3","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AE_ID
            $GlobalChoice = "Col_AE"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AE")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso4","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AF_ID
            $GlobalChoice = "Col_AF"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AF")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "NBU","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AG_ID
            $GlobalChoice = "Col_AG"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AG")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RRC","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AH_ID
            $GlobalChoice = "Col_AH"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AH")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RBU","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AI_ID
            $GlobalChoice = "Col_AI"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AI")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Category","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AJ_ID
            $GlobalChoice = "Col_AJ"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AJ")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Segment","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AL_ID
            $GlobalChoice = "Col_AL"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AL")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RetName","REG_SZ",$NewGlobalVar)
        Case $msg= $Col_AM_ID
            $GlobalChoice = "Col_AM"
            $NewGlobalVar = InputBox("Change Global Parameter:", "Change Output For Column AM")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AM","REG_SZ",$NewGlobalVar)         
        Case $msg= $NewState_ID
            $Cnt2 = 0
            $GoLoop = "Yes"
            While $GoLoop = "Yes"
            $Cnt2 = $Cnt2 + 1
            $StateID[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars\States", "State_" & $Cnt2)
            If $StateID[$Cnt2] = "" Then ExitLoop
            WEnd    
            $NxStateCount = $Cnt2
            $NewState = InputBox("Add New State To List:","Add New State To Display In ComboBox:")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars\States", "State_" & $NxStateCount,"REG_SZ",$NewState)
        EndSelect
Wend
GUIDelete()
WEnd
EndIf
If $MenuChoice = "Convert" Then
$Header = "ACKNOWLEDGED,MGT AREA,TECH NUMBER,UNITS,CSG STATUS,WORK ORDER TYPE,CSG LAST CHANGED DATE,AUTO ASSIGNED TECH NUMBER,SCHEDULED DATE,ACTIVITY,CUSTOMER NAME,CUSTOMER PHONE,CSG ACCT NUMBER,WORK ORDER NUMBER,MDU,CUSTOMER ADDRESS,CUSTOMER CITY,CUSTOMER ZIP,SERVICE CODES,HARDWARE DELIVERY,CLASSES,WO CREATE DATE,WO INSERT DATE,REASON1,REASON2,REASON3,REASON4,RESO1,RESO2,RESO3,RESO4,NBU,RR_CANDIDATE,RBU_WORKED,CATEGORY,SE
GMENT_OUTPUT,SECONDARY PH,RETAILER NAME"
$Ack = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Ack")
$MGTAREA = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MGTAREA")
$Units = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Units")
$CSG_Status = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "CSG")
$AutoAssignTechNum = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AutoTech")
$Activity = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Activity")
$MDU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "MDU")
$HardDeliv = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Delivery")
$Classes = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Classes")
$WOCreated = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "WOCreated")
$WOInsert = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Insert")
$Reason1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason1")
$Reason2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason2")
$Reason3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason3")
$Reason4 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reason4")
$Reso1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso1")
$Reso2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso2")
$Reso3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso3")
$Reso4 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Reso4")
$NBU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "NBU")
$RR_Cand = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RRC")
$RBU = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RBU")
$Category = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Category")
$Segment = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "Segment")
$RetName = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "RetName")
$AM = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "AM")
$ComboChoice1 = "Choose Location"
    $LocString = ""
    $Cnt2 = 0
    $GoLoop = "Yes"
    While $GoLoop = "Yes"
        $Cnt2 = $Cnt2 + 1
        $LocID[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $Cnt2, "LocName")
        $TechNum[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\Location_" & $Cnt2, "TechNum")
        If $LocID[$Cnt2] = "" Then $GoLoop = "Stop"
    WEnd    
    $LocCount = $Cnt2 - 1
    $Cnt2 = 0
    If $LocCount = 0 Then
        MsgBox(0,"Error!", "You Have Not Designated Any DSS Offices!")
        ExitLoop
    EndIf
    If $LocCount > 0 Then
        While $Cnt2 < $LocCount
            $Cnt2 = $Cnt2 + 1
            $LocString = $LocString & "|" & $LocID[$Cnt2]
        WEnd
    EndIf       
    $Cnt2 = 0
    $GoLoop = "Yes"
    While $GoLoop = "Yes"
        $Cnt2 = $Cnt2 + 1
        $StateID[$Cnt2] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars\States", "State_" & $Cnt2)
        If $StateID[$Cnt2] = "" Then ExitLoop
    WEnd    
    $StateCount = $Cnt2 - 1
    $Cnt2 = 0
    $StateString = ""
    While $Cnt2 < $StateCount
        $Cnt2 = $Cnt2 + 1
        $StateString = $StateString & "|" & $StateID[$Cnt2]
    WEnd
    ;MsgBox(0,"",$StateString)
    $ComboChoice1 = ""
    $ComboChoice2 = ""
    While $GoLoop <> 16250
    GUICreate("Choose Location:",220,175)
    GUISetState (@SW_SHOW)
    $ContID = GUICtrlCreateButton ("Continue",25,105,75,25)
    $QuitID = GUICtrlCreateButton ("Quit",120,105,75,25)
    $ComboChoice1 = GUICtrlCreateCombo ("Select Location:", 30,40)
    GUICtrlSetData($ComboChoice1,"|Select" & $LocString,"Select")
    $ComboChoice2 = GUICtrlCreateCombo ("Select State:",120,40,70,45)
    GUICtrlSetData($ComboChoice2,"|Select" & $StateString,"Select")
    GUISetState ()
        $SetupChoice = "Hold Open"
        While $SetupChoice = "Hold Open"
            $msg = GUIGetMsg()
            Select
                Case $msg= $ContID
                    $SetupChoice = "Continue"
                Case $msg= $QuitID
                    $SetupChoice = "Quit"
            EndSelect
        Wend
    If $SetupChoice = "Quit" Then Exit
    $ComboChoice1 = GUICtrlRead($ComboChoice1)
    $ComboChoice2 = GUICtrlRead($ComboChoice2)
    $Cnt2 = 0
    While $Cnt2 < $LocCount
        $Cnt2 = $Cnt2 + 1
        If $ComboChoice1 = $LocID[$Cnt2] Then $CurLoc = $Cnt2
    WEnd
    GUIDelete()
    If $ComboChoice1 <> "Select" And $ComboChoice2 <> "Select" Then 
        ExitLoop
    Else
        MsgBox(0,"Error!", "You Must Enter a Location And a State!")
        $GoLoop = "Yes"
    EndIf
    WEnd
$DSSOffice = $LocID[$CurLoc]
$TechNumber = $TechNum[$CurLoc]
$RawFile = FileOpenDialog("Choose DirecTV File To Process:", "C:\", "All Files (*.*)", 1)
    If @error Then
        MsgBox(4096,"","No File(s) chosen... Exit!")
        Exit
    EndIf
$ImportFile = FileSaveDialog("Choose Filename to Save As:","C:\", "Comma Delimited (*.csv)")
    If @error Then
        MsgBox(4096,"","No File(s) chosen... Exit!")
        Exit
    EndIf
FileOpen($ImportFile,1)
FileOpen($RawFile,0)
$WOStartLine = 4
$GoLoop = "Yes"
While $GoLoop = "Yes"
If $RecordCount = 0 Then $PossStartLine = 0
$Cnt3 = 0
$LineVerify = "False"
While $LineVerify <> "True" And $Cnt3 < 6
    $Cnt3 = $Cnt3 + 1
    $RawLine = FileReadLine($RawFile,$PossStartLine + $Cnt3)
    $CharVerify = "False"
    $Cnt4 = 0
    While $CharVerify <> "True" And $Cnt4 < 22
        $Cnt4 = $Cnt4 + 1
        $Char = StringMid($RawLine, $Cnt4, 9)
        If $Char = "PRINT ID:" Then $CharVerify = "True"
    WEnd
    If $Char = "PRINT ID:" Then $LineVerify = "True"
WEnd
;MsgBox(0,"PRINT ID: FOUND!",$Char)
$EOF_Reached = "False"
If $LineVerify <> "True" Then 
    $EOF_Reached = "True"
    $GoLoop = "Stop"
EndIf
If $EOF_Reached = "False" Then
$WOStartLine = $PossStartLine + $Cnt3
$RawLine = FileReadLine($RawFile,$WOStartLine + 2)
$WONumber = StringRight($RawLine, 7)
$WONumber = StringReplace($WONumber, ",", "")
;MsgBox(0,"Work Order Number:",$WONumber)
; These Lines Needed to Copy/Paste For Line Verify Routine
$PossLineNumber = $WOStartLine + 3
$Cnt3 = 0
$LineVerify = "False"
While $LineVerify <> "True" And $Cnt3 < 5
    $Cnt3 = $Cnt3 + 1
    $RawLine = FileReadLine($RawFile,$PossLineNumber + $Cnt3)
    $CharVerify = "False"
    $Cnt4 = 0
    While $CharVerify <> "True" And $Cnt4 < 5
        $Cnt4 = $Cnt4 +1
        $Char = StringRight($RawLine, 8)
        $Char = StringMid($Char, 3, 1)
        If $Char = "/" Then $CharVerify = "True"
    WEnd
    If $Char = "/" Then $LineVerify = "True"
WEnd
$WOLineNumber = $PossLineNumber + $Cnt3
;*********************************************************
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$CSG_LAST_CHANGED_DATE = StringRight($RawLine, 8)
$CSG_LAST_CHANGED_DATE = _StringInsert($CSG_LAST_CHANGED_DATE,"20", -2 )
$ChkMonth = StringMid($CSG_LAST_CHANGED_DATE, 2, 1)
If $ChkMonth = "/" Then $CSG_LAST_CHANGED_DATE = "0" & $CSG_LAST_CHANGED_DATE
;MsgBox(0,"Last Changed Date:",$CSG_LAST_CHANGED_DATE)
$WOLineNumber = $WOLineNumber + 3
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$AcctNum = StringMid($RawLine, 2, 16)
;MsgBox(0,"Account Number:",$AcctNum)
$CustPhone1 = StringMid($RawLine, 20, 12)
;MsgBox(0,"Customer's Phone Number:",$CustPhone1)
$CustPhone2 = StringMid($RawLine, 34, 12)
;MsgBox(0,"Customer's 2nd Phone Number:",$CustPhone2)
$WOType = StringMid($RawLine, 48, 7)
If $WOType = "MOVER C" Then $WOType = "DTV Mover"
IF $WOType = "INSTALL" Then $WOType = "DTV NC"
If $WOType = "ESCALAT" Then $WOType = "DTV Escalation"
;MsgBox(0,"Work Order Type:",$WOType)
$ScheduleDate = StringMid($RawLine, 66, 12)
$ScheduleDate = StringReplace($ScheduleDate, "   ", " ")
$ScheduleDate = _StringInsert ( $ScheduleDate,"20", -5 )
$ChkMonth = StringMid($ScheduleDate, 2, 1)
If $ChkMonth = "/" Then $ScheduleDate = "0" & $ScheduleDate
;MsgBox(0,"Scheduled Date Is:", $ScheduleDate)
$PossLineNumber = $WOStartLine + 9
$Cnt3 = 0
$LineVerify = "False"
While $LineVerify <> "True" And $Cnt3 < 5
    $Cnt3 = $Cnt3 + 1
    $RawLine = FileReadLine($RawFile,$PossLineNumber + $Cnt3)
    $CharVerify = "False"
    $Cnt4 = 0
    While $CharVerify <> "True" And $Cnt4 < 20
        $Cnt4 = $Cnt4 + 1
        $Char = StringMid($RawLine, $Cnt4, 1)
        If $Char = "," Then $CharVerify = "True"
    WEnd
    If $Char = "," Then $LineVerify = "True"
WEnd
$WOLineNumber = $PossLineNumber + $Cnt3
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$Cnt1 = 1
$ChkEOL = "Z"
While $ChkEOL <> " "
    $Cnt1 = $Cnt1 + 1
    $ChkEOL = StringMid($RawLine, $Cnt1, 1)
WEnd
$NameLength = $Cnt1 - 2
$CustName = StringMid($RawLine, 2, $NameLength)
$CustName = Chr (34) & $CustName & Chr (34) 
;MsgBox(0,"Customer Name:",$CustName)
$WOLineNumber = $WOLineNumber + 1
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$Cnt1 = 1
$Loop = 0
While $Loop = 0
    $Cnt1 = $Cnt1 + 1
    $ChkEOL = StringMid($RawLine, $Cnt1, 1)
    If $ChkEOL = "" Then $Loop = 1
WEnd
$AddrLength = $Cnt1 - 2
$CustAddr = StringMid($RawLine, 2, $AddrLength)
;MsgBox(0,"Customer Address:",$CustAddr)
$PossLineNumber = $WOStartLine + 11
$Cnt3 = 0
$LineVerify = "False"
While $LineVerify <> "True" And $Cnt3 < 5
    $Cnt3 = $Cnt3 + 1
    $RawLine = FileReadLine($RawFile,$PossLineNumber + $Cnt3)
    $CharVerify = "False"
    $Cnt4 = 0
    While $CharVerify <> "True" And $Cnt4 < 25
        $Cnt4 = $Cnt4 + 1
        $Char = StringMid($RawLine, $Cnt4, 4)
        If $Char = " " & $ComboChoice2 & " " Then $CharVerify = "True"
    WEnd
    If $Char = " " & $ComboChoice2 & " " Then $LineVerify = "True"
WEnd
$WOLineNumber = $PossLineNumber + $Cnt3
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$CharVerify = "False"
    $Cnt4 = 0
    While $CharVerify <> "True" And $Cnt4 < 35
        $Cnt4 = $Cnt4 + 1
        $Char = StringMid($RawLine, $Cnt4, 1)
        $IsANumber = StringIsInt($Char)
        If $IsANumber = 1 Then $CharVerify = "True"
    WEnd
$DashPOS = $Cnt4 + 5
$CityLength = $DashPOS - 11
$CustCity = StringMid($RawLine, 2, $CityLength)
;MsgBox(0,"Customer's City Is:",$CustCity)
$CustState = StringMid($RawLine, $DashPOS - 8, 2)
;MsgBox(0,"Customer's State Is:",$CustState)
$CustZip = StringMid($RawLine, $DashPOS - 5, 5)
;MsgBox(0,"Customer's Zip Code Is:",$CustZip)
$WOLineNumber = $WOLineNumber + 6
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$Note1 = $RawLine
;MsgBox(0,"Note 1 Is:",$Note1)
$WOLineNumber = $WOLineNumber + 1
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$Note2 = $RawLine
;MsgBox(0,"Note 2 Is:",$Note2)
$WOLineNumber = $WOLineNumber + 2
$Loop = 1
$Cnt1 = 0
While $Loop = 1
$WOLineNumber = $WOLineNumber + 1
$RawLine = FileReadLine($RawFile,$WOLineNumber)
$Cnt1 = $Cnt1 + 1
$BillCode[$Cnt1] = StringMid($RawLine, 3, 2)
;MsgBox(0,"Billing Codes:",$Cnt1 & "  " & $BillCode[$Cnt1]) 
If $BillCode[$Cnt1] = "" Then ExitLoop
WEnd
$NOC = $Cnt1 - 1
$Cnt1 = 0
While $Cnt1 < $NOC
    $Cnt1 = $Cnt1 + 1
    $CodeString = $CodeString & "|" & $BillCode[$Cnt1]
WEnd
$CodeString = StringTrimLeft($CodeString, 1)
If $WOType = "DTV Escalation" Then $CodeString = ""
;MsgBox(0,"CodeString:  ",$CodeString)  
$JobString = ""
$JobString = $Ack & "," & $MGTAREA & "," & $TechNumber & "," & $Units & "," & $CSG_Status & "," & $WOType & ","
$JobString = $JobString & $CSG_LAST_CHANGED_DATE & "," & $AutoAssignTechNum & "," & $ScheduleDate & "," & $Activity & ","
$JobString = $JobString & $CustName & "," & $CustPhone1 & "," & $AcctNum & "," & $WONumber & "," & $MDU & "," & $CustAddr & ","
$JobString = $JobString & $CustCity & "," & $CustZip & "," & $CodeString & "," & $HardDeliv & "," & $Classes & ","
$JobString = $JobString & $WOCreated & "," & $WOInsert & "," & $Reason1 & "," & $Reason2 & "," & $Reason3 & ","
$JobString = $JobString & $Reason4 & "," & $Reso1 & "," & $Reso2 & "," & $Reso3 & "," & $Reso4 & "," & $NBU & ","
$JobString = $JobString & $RR_Cand & "," & $RBU & "," & $Category & "," & $Segment & "," & $CustPhone2 & "," & $RetName & "," & $AM
$CodeString = ""
$RecordCount = $RecordCount + 1 
$RecordArray[$RecordCount] = $JobString
$PossStartLine = $WOStartLine + 53
EndIf
$FinalJobCount = $RecordCount
WEnd
$RecordCount = 0
FileWriteLine($ImportFile,$Header)
While $RecordCount < $FinalJobCount
    $RecordCount = $RecordCount + 1 
    FileWriteLine($ImportFile,$RecordArray[$RecordCount])
WEnd
FileClose($ImportFile)
FileClose($RawFile)
MsgBox(0,"Success!",$FinalJobCount & " Jobs Were Successfully Converted!")
;End Of Section EndIf
EndIf
If $MenuChoice = "Quit" Then Exit
WEnd

Share this post


Link to post
Share on other sites

nine hundred and fifty-nine lines, and all we know is that it gives a serious error. Pretty hard for us to do anything about it...unless of course there's some one here bored enough to muddle through that whole thing until they find something.


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Ok, Sorry, I have only been writing code for like a week... certainly never needed assistance b4, Be Patient With Me!!!

Line 706 is where the program is when it errors out...

706 $ImportFile = FileSaveDialog("Choose Filename to Save As:","C:\", "Comma Delimited (*.csv)")

It's a Windows Error though, not like a syntax or other error from within AutoIT.

Wonderful system though, very very easy to learn... even with the 'hands on' way of doing GUI, still easier than VB!

Share this post


Link to post
Share on other sites

Ok, Sorry, I have only been writing code for like a week... certainly never needed assistance b4, Be Patient With Me!!!

Line 706 is where the program is when it errors out...

706 $ImportFile = FileSaveDialog("Choose Filename to Save As:","C:\", "Comma Delimited (*.csv)")

It's a Windows Error though, not like a syntax or other error from within AutoIT.

Wonderful system though, very very easy to learn... even with the 'hands on' way of doing GUI, still easier than VB!

You might want to post a bug report as autoit should't crash hard like that.


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

You might want to post a bug report as autoit should't crash hard like that.

See, that's what I would think, but since I have not been coding long at all, I wanted someone to confirm that it wasn't simply something stupid that I was doing wrong.

Now, since I have written ALL THIS CODE...

I suppose I will try to back-convert it to an older version of AutoIT. The only problem is, I think I have used a couple of funtions that are only in the new version.. :-(

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

See, that's what I would think, but since I have not been coding long at all, I wanted someone to confirm that it wasn't simply something stupid that I was doing wrong.

Now, since I have written ALL THIS CODE...

I suppose I will try to back-convert it to an older version of AutoIT. The only problem is, I think I have used a couple of funtions that are only in the new version.. :-(

what about coding a work around so you woundn't have to use that line. Anyway, good luck.

Edit:hmm, Weird. I just tested that line on my machine and it work fine. If it only errors out on one machine i would assume something wrong with the machine.

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

what about coding a work around so you woundn't have to use that line. Anyway, good luck.

Edit:hmm, Weird. I just tested that line on my machine and it work fine. If it only errors out on one machine i would assume something wrong with the machine.

No way I can think of to get around it, I HAVE to have the user pick the file name.... I suppose I could use a ChooseFolder type function, and then have the program automatically name the file based on the input filename tho.... ya, I smell burning rubber, the wheels must be turning!

Share this post


Link to post
Share on other sites

No way I can think of to get around it, I HAVE to have the user pick the file name.... I suppose I could use a ChooseFolder type function, and then have the program automatically name the file based on the input filename tho.... ya, I smell burning rubber, the wheels must be turning!

OK, How can I get the current path from the file just picked from an OpenFileDialog command?

Like this:

$LastRawFileLoc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc")

If $LastRawFileLoc = "" Then $LastRawFileLoc = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

$RawFile = FileOpenDialog("Choose DirecTV File To Process:",$LastRawFileLoc, "All Files (*.*)", 1)

If @error Then

MsgBox(4096,"","No File(s) chosen... Exit!")

Exit

EndIf

$LastRawFileLoc = ????????????????????

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc","REG_SZ",$LastRawFileLoc)

You see where I am going with this... I want the program to 'remember' where you went the last time to find the file....

Share this post


Link to post
Share on other sites

Ok, that didn't work either, now it throws that Windows Error 3x's in a row before closing. REALLY pi$$in' me off!! (Very well could be the computer tho)

CODE
$LastRawFileLoc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc")

If $LastRawFileLoc = "" Then $LastRawFileLoc = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

$RawFile = FileOpenDialog("Choose DirecTV File To Process:",$LastRawFileLoc, "All Files (*.*)", 1)

If @error Then

MsgBox(4096,"","No File(s) chosen... Exit!")

Exit

EndIf

_PathSplit($RawFile, $szDrive, $szDir, $szFName, $szExt)

$LastRawFileLoc = $szDrive & $szDir & "\"

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc","REG_SZ",$LastRawFileLoc)

$LastImportFileLoc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastImportFileLoc")

If $LastImportFileLoc = "" Then $LastImportFileLoc = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

$ImportFile = InputBox("Save As","Enter Filename to Save The New File:",$szFName & "_Importable.csv")

************* Gets to right here and BOMBS! *****************

$LastImportFileLoc = FileSelectFolder("Select Destination Folder:", "C:\",1,$LastImportFileLoc)

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastImportFileLoc","REG_SZ",$LastImportFileLoc)

;$ImportFile = FileSaveDialog("Choose Filename to Save As:","C:\", "Comma Delimited (*.csv)")

MsgBox(0,"",$ImportFile)

Exit

If @error = 1 Then

MsgBox(4096,"","Cancel Chosen... Exit!")

Exit

EndIf

FileOpen($LastImportFileLoc & $ImportFile,1)

FileOpen($RawFile,0)

Share this post


Link to post
Share on other sites

Does the helpfile sample work on the offending machine?

$MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

$var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)", 2)
; option 2 = dialog remains until valid path/file selected

If @error Then
    MsgBox(4096,"","Save cancelled.")
Else
    MsgBox(4096,"","You chose " & $var)
EndIf


; Multiple filter group
$var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)|Text files (*.ini;*.txt)", 2)
; option 2 = dialog remains until valid path/file selected

If @error Then
    MsgBox(4096,"","Save cancelled.")
Else
    MsgBox(4096,"","You chose " & $var)
EndIf

Share this post


Link to post
Share on other sites

Yes, script and compiled runs fine

Share this post


Link to post
Share on other sites

Yes, script and compiled runs fine

OK, so there is possibly nothing wrong with the FileOpenDialog command?

No way I can think of to get around it, I HAVE to have the user pick the file name.... I suppose I could use a ChooseFolder type function, and then have the program automatically name the file based on the input filename tho.... ya, I smell burning rubber, the wheels must be turning!

Use the default value. Set it to "Select folder". If your return value is "Select Folder" then the user has only selected a folder and not a file. So StringLeft($data, StringLen($data)-StringLen("Select Folder")) or something should give you the path.

OK, How can I get the current path from the file just picked from an OpenFileDialog command?

Like this:

$LastRawFileLoc = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc")
    If $LastRawFileLoc = "" Then $LastRawFileLoc = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"
$RawFile = FileOpenDialog("Choose DirecTV File To Process:",$LastRawFileLoc, "All Files (*.*)", 1)
    If @error Then
        MsgBox(4096,"","No File(s) chosen... Exit!")
        Exit
    EndIf       
$LastRawFileLoc = ????????????????????
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\DevThis\GlobalVars", "LastRawFileLoc","REG_SZ",$LastRawFileLoc)

You see where I am going with this... I want the program to 'remember' where you went the last time to find the file....

Do your user have privileges to read and more important write to that location? Try with HKCU and see if it helps?

Main()
Exit
Func Main()
   $LastRawFileLoc = RegRead("HKCU\SOFTWARE\Slettes\GlobalVars", "LastRawFileLoc")
   dbg("$LastRawFileLoc:=" & $LastRawFileLoc)
   If $LastRawFileLoc = "" Then $LastRawFileLoc = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"
   $RawFile = FileOpenDialog("Choose DirecTV File To Process:", $LastRawFileLoc, "All Files (*.*)", 2, "Select Folder")
   If dbg("$RawFile:=" & $RawFile) Then
       MsgBox(4096, "", "No File(s) chosen... Exit!")
       Exit
   EndIf
   If StringRight($RawFile, StringLen("Select Folder")) = "Select Folder" Then
       $RawFile = StringLeft($RawFile, StringLen($RawFile) - StringLen("Select Folder"))
   EndIf
   If $LastRawFileLoc <> $RawFile Then
       RegWrite("HKCU\SOFTWARE\Slettes\GlobalVars", "LastRawFileLoc", "REG_SZ", $RawFile)
       dbg('RegWrite("HLCU\SOFTWARE\Slettes\GlobalVars", "LastRawFileLoc", "REG_SZ",' & $RawFile & ")")
       $LastRawFileLoc = $RawFile
   EndIf
EndFunc

Func dbg($msg, $error = @error, $extended = @extended, $erl = @ScriptLineNumber)
   ;Note: If we use StringFormat to output $erl we can't use Jump to line in Scite by doubel clicking in the Output pan.
   ConsoleWrite("(" & $erl & ") : = (" & $error & ")(" & $extended & ") " & $msg & @LF)
   ;StringFormat("%.5u",  $erl)
   Return $error
EndFunc   ;==>dbg
#cs
   Running without main reg key defined (HLCU Rather than HKCU)
   (2) := (2)(0) $LastRawFileLoc:=
   (5) := (0)(0) $RawFile:=C:\backup\Test.txt
   (14) := (2)(0) RegWrite("HLCU\SOFTWARE\Slettes\GlobalVars", "LastRawFileLoc", "REG_SZ",C:\backup\Test.txt)
    
   Runing with HKCU
   (5) : = (1)(0) $LastRawFileLoc:=
   (8) : = (0)(0) $RawFile:=C:\backup\Test.txt
   (17) : = (0)(0) RegWrite("HLCU\SOFTWARE\Slettes\GlobalVars", "LastRawFileLoc", "REG_SZ",C:\backup\Test.txt)
   
   Third run. Now the key is installed
   (5) : = (0)(1) $LastRawFileLoc:=C:\backup\Test.txt
   (8) : = (0)(0) $RawFile:=C:\backup\Test.txt
   
#ce

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