Jump to content

Recommended Posts

Posted

Hello, I'm making a function helpfile like script, but I have 2 errors, one: the example button doesnt work, and two: when I click info, the label is all messed up, heres the code:

CODE
#include <GUIConstants.au3>

$HelpFileDir = "C:\Program Files\Autoit3\Examples\Helpfile\"

$Functions = IniReadSectionNames("FunctionsList.ini")

GUICreate("Functions", 180, 290)

$FunctionsList = GUICtrlCreateList("Populating...", 10, 10, 160, 225)

$ReturnLabel = GUICtrlCreateLabel("", 10, 245)

$UsedLabel = GUICtrlCreateLabel("", 10, 230)

$ExampleButton = GUICtrlCreateButton("Example", 20, 260, 60, 20)

$InfoButton = GUICtrlCreateButton("Info", 100, 260, 60, 20)

For $x = 1 To $Functions[0]

GUICtrlSetData($FunctionsList, $Functions[$x])

Next

GUISetState()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then

ExitLoop

EndIf

If $msg = $InfoButton Then

$Selected = GUICtrlRead($FunctionsList)

$ReturnInfo = IniRead("FunctionsList.ini", $Selected, "Return", "NotFound")

$UsedInfo = IniRead("FunctionsList.ini", $Selected, "Used", "NotFound")

GUICtrlSetData($ReturnLabel, $ReturnInfo)

GUICtrlSetData($UsedLabel, $UsedInfo)

EndIf

If $msg = $ExampleButton Then

$Selected = GUICtrlRead($FunctionsList)

Run($Selected & ".au3")

EndIf

WEnd

Exit

By the way my .ini file is set up like:

[Function Name]

Return=Return Value

Used=Description

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Posted

Hello, I'm making a function helpfile like script, but I have 2 errors, one: the example button doesnt work, and two: when I click info, the label is all messed up, heres the code:

1) You can't Run a script directly with the run function unless you pass it as a parameter to AutoIt3.exe or @ScriptFullPath /AutoIt3ExecuteScript.

If AutoIt is installed, it's easier to just use ShellExecute instead and let Windows handle the path.

ShellExecute($Selected & ".au3")

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

1) You can't Run a script directly with the run function unless you pass it as a parameter to AutoIt3.exe or @ScriptFullPath /AutoIt3ExecuteScript.

If AutoIt is installed, it's easier to just use ShellExecute instead and let Windows handle the path.

ShellExecute($Selected & ".au3")
K thanks, also can I make the label auto go to the next line if its too long?

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

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
×
×
  • Create New...