Sign in to follow this  
Followers 0
farhan879

Help Needed [Solved]

3 posts in this topic

#1 ·  Posted (edited)

My question is, i want to create a .au3 file but how do i put in the code? Something like when i create the .au3 file, the code is also included in it.

Here is what i currently have:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <File.au3>


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 191, 73, 322, 272)
$Button1 = GUICtrlCreateButton("Generate Code", 48, 40, 91, 25, 0)
$Input1 = GUICtrlCreateInput(">>Msgbox Text", 32, 16, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
             _FileCreate("Msgbox.au3")   ; Creates a *.au3 file with the info in Form1
            MsgBox(0,"Done", "The MsgBox has been generated.")  

    EndSwitch
WEnd

If you don't understand i will explain. Please help :)

Edited by farhan879

System task ---> My first GUICalculator v1.0 ---> My version of the calculatorNetZilla 1.0 --> Web browserEmail Sender --> You can Send emails with this without opening a web browser

Share this post


Link to post
Share on other sites



#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 191, 73, 322, 272)
$Button1 = GUICtrlCreateButton("Generate Code", 48, 40, 91, 25, 0)
$Input1 = GUICtrlCreateInput(">>Msgbox Text", 32, 16, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $text = GUICtrlRead($Input1)
            FileDelete("Msgbox.au3")
            FileWrite("Msgbox.au3",$text)
            MsgBox(0,"Done", "The MsgBox has been generated.") 
 
    EndSwitch
WEnd

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