Jump to content

Output to editbox?


Recommended Posts

Hi,

Its me again :ph34r:

I now have a new problem...

I have made a script that collects alot of data to a txt file, and now

i need a way to use that data to a Edit box.

This is what i wanna do:

Use a combo box, and chose (for example) Computer Model

NC4000

Press Search

It will then go into my txt file, check all Models and list Username in a edit box.

On that edit box, ill have two buttons, "Mark All" and "Copy To Clipboard"

The buttons, i belive i can fix, but no idea how to search ALL models field,

and then write it to the edit window???

This is part of the text file.

[xpx8963]
RAM=512 MB
Model=NC4000
IP=40.212.4.93
Full Name=MARCUS
Admin=Yes
Ipass=Installed
CompName=XPP8963
Llogon=15/07/2004 10:09
Cpu=1521
C:=415
D:=9 613
SAV=07/07/2004

I got a Combo box, with all my computer names on it.

So when i chose NC4000 and press Search, it should go into this file,

check all users model, and report back in a Edit box.

This might be worst explanation you seen, but my head is just spinning around now :(

Were ever i lay my script is my home...

Link to comment
Share on other sites

Here is the code i use to create the Search GUI:

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate($ProgTitel, 522,375,(@DesktopHeight-522)/2, (@DesktopHeight-375)/2 , 0x04CF0000)

$tab_1 = GUISetControl("tab", "Tab 1", 20, 20, 470, 340)
$tabitem_1 = GUISetControl("tabitem", "User", 0, 0, 0, 0)
    GUISetControl("combo", "Computer", 90,50,150,200)
    GUISetControlData(-1,"Department|Administrator")
    $butSave1 = GuiSetControl("button", "Search", 190,140,80,25)
    GuiSetControlNotify()
    $butCancel1 = GuiSetControl("button", "Cancel", 280,140,80,25)
    GuiSetControlNotify()


$tabitem_2 = GUISetControl("tabitem", "Computers", 0, 0, 0, 0)
    GUISetControl("combo", "Computer", 90,50,150,200)
    GUISetControlData(-1,"Evo N400c|Compaq nc4000|Deskpro")

    GUISetControl("combo", "Ram", 90,70,150,200)
    GUISetControlData(-1,"128|256|512")

    GuiSetControl("label", "Model: ", 30,55,50,15)
    GuiSetControl("label", "RAM: ", 30,75,50,15)
    $butSave2 = GuiSetControl("button", "Search", 190,140,80,25)
    GuiSetControlNotify()
    $butCancel2 = GuiSetControl("button", "Cancel", 280,140,80,25)
    GuiSetControlNotify()

$tabitem_3 = GUISetControl("tabitem", "Applications", 0, 0, 0, 0)
    GUISetControl("combo", "Apps", 30,50,150,200)
    GUISetControlData(-1,"Ipass|Vägguiden|Siebel")
    $butSave3 = GuiSetControl("button", "Search", 190,140,80,25)
    GuiSetControlNotify()
    $butCancel3 = GuiSetControl("button", "Cancel", 280,140,80,25)
    GuiSetControlNotify()

;----------------------------------
$tab_close = GUISetControl("tabitem","",-99,-99,1,1) ;close tab


GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $Msg = $butCancel1
    Exit
    Case $Msg = $butSave1
    MsgBox(0,"Patch","You chose 1")
    Case $Msg = $butCancel2
    Exit
    Case $Msg = $butSave2
    MsgBox(0,"Patch","You chose 2")
    Case $Msg = $butCancel3
    Exit
    Case $Msg = $butSave3
    MsgBox(0,"Patch","You chose 3")
    Case $msg = -3
        Exit
    Case $msg = 0
       ;;;
    Case $msg = $tab_1
       ;;;
    Case $msg = $tabitem_1
       ;;;
    Case $msg = $tabitem_2
       ;;;
    Case $msg = $tabitem_3
       ;;;

    EndSelect
WEnd

"You Chose 1,2,3" Should be were the code to search the txt file should be.

So first check Combo box, for what it should look for, and then look into text file and print back to Edit box.

Thanks

Were ever i lay my script is my home...

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