Jump to content
Sign in to follow this  

Append file name - GUI

Recommended Posts

I am trying to create a script that :

1# Asks the user for a 5 digit string value then they press "connect"

2# The script then reads the value, verifies it exits in a text file and launches a seperate AutoIT script that builds a connection and a settings file.

I can do all the connections stuff, but getting it to read the input then verifies the string in a text file is killing me.

Please help...

"so much work, so little brains..."

Share this post

Link to post
Share on other sites

Here you go:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 168, 64, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("Button1", 24, 24, 115, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
#EndRegion ### END Koda GUI section ###

;Use FileRead to read the whole file
$FileRead_Result = "my string TTTTTT here"&@CRLF&"some other garbage text"

While 1

Func Button1Click()
    $testString = InputBox("String to Find", "Enter search string")
    If StringInStr($FileRead_Result, $testString) Then
        MsgBox(0, "Found", "Found: "&$testString)
        MsgBox(0, "Not Found", "Not Found: "&$testString)
Func Form1Close()

Very basic and easy script - it has all the elements you need.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...