Sign in to follow this  
Followers 0
zero57

Button Help for Simolokid & Zero57 (project going on)

3 posts in this topic

#1 ·  Posted (edited)

Hey, so our projects going goood.... Well not for now! So we need u people to help us. Heres our problem:

We r doing seperate .au3's once were finished, we combine ;) . But thats not the real problem. On my half, i have an error.... So i did a syntax error check. No errors. Then When i ran it.... error happened.... Also my script was running well, but when i added a piece of code to it, it stopped working :) well anyways heres the error that it said to me:

C:\Documents and Settings\polam\Desktop\directory-crap.au3 (43) : ==> Variable used without being declared.:
ShellExecute($inputshellexecute)
ShellExecute(^ ERROR

(please don't mind the script name)

I don't know how to fix this :) so im asking u to help me. Also heres my script:

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $exitbutton, $opensesime, $desiredname


fileopenproject()

Func fileopenproject()
    GUICreate('directory crap for now', 300, 400)
    GUISetState()

    $opensesime = GUICtrlCreateButton("Run the exe/executable", 0, 0)
    $exitbutton = GUICtrlCreateButton("Exit", 275, 0)
EndFunc



#region - GUI SelectLoop
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $exitbutton
            Exit 1
        Case $msg = $opensesime
            $inputshellexecute = InputBox("Run the exe you want", "Type the file name Example: firefox   If that doesn't work try firefox.exe", "", "", Default, Default)
            $desiredname = GUICtrlCreateButton($inputshellexecute, 0, 100)
        Case $msg = $desiredname
            ShellExecute($inputshellexecute)
    EndSelect
WEnd
#endregion

At the end of the script it should show u the error part called: ShellExecute($inputshellexecute)

Any ideas on helping me?

EDIT: Oh ya, i almost forgot, when i run it, it instantly just exits the script!!!

Edited by zero57

[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites



Is this what you need?

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $exitbutton, $opensesime, $desiredname , $inputshellexecute
fileopenproject()
Func fileopenproject()
    GUICreate('directory crap for now', 300, 400)
    GUISetState()
    $opensesime = GUICtrlCreateButton("Run the exe/executable", 0, 0)
    $exitbutton = GUICtrlCreateButton("Exit", 275, 0)
EndFunc
#region - GUI SelectLoop
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $exitbutton
            Exit 1
        Case $msg = $opensesime
            $inputshellexecute = InputBox("Run the exe you want", "Type the file name Example: firefox   If that doesn't work try firefox.exe")
            $desiredname = GUICtrlCreateButton($inputshellexecute, 0, 100)
        Case $msg = $desiredname
            $menutext = GUICtrlRead($desiredname)
            If $menutext = "" Then
                Else
            ShellExecute($inputshellexecute)
            EndIf
    EndSelect
WEnd
#endregion

Share this post


Link to post
Share on other sites

Is this what you need?

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $exitbutton, $opensesime, $desiredname , $inputshellexecute
fileopenproject()
Func fileopenproject()
    GUICreate('directory crap for now', 300, 400)
    GUISetState()
    $opensesime = GUICtrlCreateButton("Run the exe/executable", 0, 0)
    $exitbutton = GUICtrlCreateButton("Exit", 275, 0)
EndFunc
#region - GUI SelectLoop
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $exitbutton
            Exit 1
        Case $msg = $opensesime
            $inputshellexecute = InputBox("Run the exe you want", "Type the file name Example: firefox   If that doesn't work try firefox.exe")
            $desiredname = GUICtrlCreateButton($inputshellexecute, 0, 100)
        Case $msg = $desiredname
            $menutext = GUICtrlRead($desiredname)
            If $menutext = "" Then
                Else
            ShellExecute($inputshellexecute)
            EndIf
    EndSelect
WEnd
#endregion

oh hey, thx. It works.

Many thanks!!! Houstan, we have a working script here!!!

ty very much. Yes almost completed.

Oh and one more thing. THX!!!!


[font="Arial Black"][u]zero57[/u][/font]

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