Jump to content

Bugs or something wrong with my script?


Recommended Posts

Here is sample of my script

------------------------------------------------------

#include <GUIConstantsEx.au3>

GUICreate("My GUI Tab", 200, 350)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 55, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 75, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 105, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 125, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 155, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 175, 90)

GUISetState(@SW_SHOW)

Sleep(15000)

-------------------------------------

why at the 5th combo (10th combo also) will not show the default value which is 'a'?

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>

GUICreate("My GUI Tab", 200, 350)
GUICtrlCreateCombo("", 85, 55, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 75, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 105, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 125, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 155, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 175, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = -3

GUIDelete()
Exit

...

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>

GUICreate("My GUI Tab", 200, 350)
GUICtrlCreateCombo("", 85, 55, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 75, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 105, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 125, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 155, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUICtrlCreateCombo("", 85, 175, 90)
GUICtrlSetData(-1, "a|b|c|d", "a")
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = -3

GUIDelete()
Exit

...

Thank alot... you solved my problem!

By the way, can you briefly explain why it happens (blank in combo)?

Link to comment
Share on other sites

Thank alot... you solved my problem!

By the way, can you briefly explain why it happens (blank in combo)?

I guess I said 'you solved my problem' too early... The 6th combo still not showing any default 'value'

Sorry, I would like to repost my scritp again as I am using while loop at the end of the script.

#include <GUIConstantsEx.au3>

GUICreate("My GUI Tab", 200, 350)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 55, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 75, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 105, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 125, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 155, 90)

GUICtrlSetData(-1, "a|b|c|d", "a")

GUICtrlCreateCombo("", 85, 175, 90)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_MINIMIZE

MsgBox(0, "", "Dialog minimized", 2)

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

EndSelect

WEnd

above is the simplified version of my script. In the orginal script, it has 4 tabs (1st tab with 4 button, 2nd tab with input, 3rd and 4th tab with combo similiar to script above). Furthermore, the select case is originally use for the 4 button is my 1st tab).

Link to comment
Share on other sites

The GUICtrlSetData() is supposed to be AFTER the GUICtrlCreateCombo()

Edit: And stop deleting your own posts, that is lame

Edited by AdmiralAlkex
Link to comment
Share on other sites

The GUICtrlSetData() is supposed to be AFTER the GUICtrlCreateCombo()

Edit: And stop deleting your own posts, that is lame

Sorry... I would like to apologize... I didn't not read script that you guys post carefully.

I deleted my post as I know is my mistake and I would like to repost it again.

Here is my original script... even after I modified it, it still showing blank at the 7th combo.

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

AutoIt Version: 3.3.0.0

Author: myName

Script Function:

Template AutoIt script.

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

#include <GUIConstantsEx.au3>

GUICreate("My GUI Tab", 200, 350); will create a dialog box that when displayed is centered

GUICtrlCreateTab(0, 0, 200, 350)

GUICtrlCreateTabItem("Main")

GUICtrlCreatePic("C:\Documents and Settings\40203929\Desktop\abc.gif", 25, 25, 0, 0)

GUICtrlCreateLabel("Select one of following options", 30, 175)

$button1 = GUICtrlCreateButton("Project 1", 25, 200, 150)

$button2 = GUICtrlCreateButton("Project 2", 25, 235, 150)

$button3 = GUICtrlCreateButton("Shutdown Current Project", 25, 270, 150)

$button4 = Guictrlcreatebutton("Exit", 25, 305, 150)

GUICtrlCreateTabItem("Setup1")

GUICtrlCreateLabel("OTS PC Setup", 25, 25)

GUICtrlCreateLabel("Model PC", 25, 50)

GUICtrlCreateLabel("Eng PC", 25, 75)

GUICtrlCreateLabel("HIS1 PC", 25, 100)

GUICtrlCreateLabel("HIS2 PC", 25, 125)

GUICtrlCreateLabel("HIS3 PC", 25, 150)

GUICtrlCreateLabel("SIM1 PC", 25, 175)

GUICtrlCreateLabel("SIM2 PC", 25, 200)

GUICtrlCreateLabel("ITK PC", 25, 225)

GUICtrlCreateLabel("VIEW PC", 25, 250)

$pc1 = GUICtrlCreateInput("MDL0801", 85, 45, 90, 20)

$pc2 = GUICtrlCreateInput("ENG0802", 85, 70, 90, 20)

$pc3 = GUICtrlCreateInput("HIS0803", 85, 95, 90, 20)

$pc4 = GUICtrlCreateInput("HIS0804", 85, 120, 90, 20)

$pc5 = GUICtrlCreateInput("HIS0805", 85, 145, 90, 20)

$pc6 = GUICtrlCreateInput("SIM0806", 85, 170, 90, 20)

$pc7 = GUICtrlCreateInput("SIM0807", 85, 195, 90, 20)

$pc8 = GUICtrlCreateInput("ITK0808", 85, 220, 90, 20)

$pc9 = GUICtrlCreateInput("VIW0809", 85, 245, 90, 20)

GUICtrlCreateTabItem("Setup2")

GUICtrlCreateLabel("HIS & FCS Setup", 25, 25)

GUICtrlCreateLabel(GUICtrlRead($pc2), 25, 50)

GUICtrlCreateLabel(GUICtrlRead($pc3), 25, 75)

GUICtrlCreateLabel(GUICtrlRead($pc4), 25, 100)

GUICtrlCreateLabel(GUICtrlRead($pc5), 25, 125)

GUICtrlCreateLabel(GUICtrlRead($pc6), 25, 150)

GUICtrlCreateLabel(GUICtrlRead($pc7), 25, 250)

GUICtrlCreateCombo("", 85, 45, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0164") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 70, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0165") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 95, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0167") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 120, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0168") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 145, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0801") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 170, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0802") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 195, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS8083") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 220, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0804") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 245, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0805") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 270, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0806") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 295, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0807") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 320, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0808") ; add other item snd set a new default

GUICtrlCreateTabItem("Setup3")

GUICtrlCreateLabel("HIS and FCS Setup", 25, 25)

GUICtrlCreateLabel(GUICtrlRead($pc2), 25, 50)

GUICtrlCreateLabel(GUICtrlRead($pc3), 25, 75)

GUICtrlCreateLabel(GUICtrlRead($pc4), 25, 100)

GUICtrlCreateLabel(GUICtrlRead($pc5), 25, 125)

GUICtrlCreateLabel(GUICtrlRead($pc6), 25, 150)

GUICtrlCreateLabel(GUICtrlRead($pc7), 25, 250)

GUICtrlCreateCombo("", 85, 45, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0164") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 70, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0165") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 95, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0167") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 120, 90) ; create first item

GUICtrlSetData(-1, "HIS0164|HIS0165|HIS0167|HIS0168", "HIS0168") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 145, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0801") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 170, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0802") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 195, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS8083") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 220, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0804") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 245, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0805") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 270, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0806") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 295, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0807") ; add other item snd set a new default

GUICtrlCreateCombo("", 85, 320, 90) ; create first item

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS0808") ; add other item snd set a new default

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $button1

ShellExecute("psexec", "\\PC9 -u abc -p abc -i D:\project\model1.exe")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncShutdown", "all")

Sleep(45000)

ShellExecute("C:\Program\BKETestFuncInit", "-j DEPRO -p HIS0164 -h PC5 -o -nd")

Sleep(90000)

ShellExecute("c:\program\BKETestFuncInit", "-j DEPRO -s FCS0101 -h PC5 -m -nd")

Sleep(30000)

Case $msg = $button2

ShellExecute("psexec", "\\PC9 -u abc -p abc -i D:\project\model2.exe")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncShutdown", "all")

Sleep(45000)

ShellExecute("C:\Program\BKETestFuncInit", "-j SMM3 -p HIS0850 -h PC5 -o -nd")

Sleep(90000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0801 -h PC5 -m -nd")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0802 -h PC5 -m -nd")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0803 -h PC5 -m -nd")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0804 -h PC5 -m -nd")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0805 -h PC5 -m -nd")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncInit", "-j SMM3 -s FCS0806 -h PC5 -m -nd")

Sleep(30000)

Case $msg = $button3

ShellExecute("psexec", "\\PC9 -u abc -p abc -i D:\project\model3.exe")

Sleep(3000)

ShellExecute("c:\program\BKETestFuncShutdown", "all")

Sleep(30000)

Case $msg = $button4

ExitLoop

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

EndSelect

WEnd

Edited by yclee99
Link to comment
Share on other sites

You wrote the wrong number.

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS8083") ; add other item snd set a new default

Link to comment
Share on other sites

You wrote the wrong number.

GUICtrlSetData(-1, "FCS0801|FCS0802|FCS0803|FCS0804|FCS0805|FCS0806|FCS0807|FCS0808", "FCS8083") ; add other item snd set a new default

what a simple mistake...

thanks a lot...

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...