Sign in to follow this  
Followers 0
MerkurAlex

help me fix this error! lol im tired

2 posts in this topic

#1 ·  Posted (edited)

Here is the code

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 454, 193, 115)
$scriptbox = GUICtrlCreateEdit("", 8, 8, 609, 417)
$MenuItem1 = GUICtrlCreateMenu("File")
$open = GUICtrlCreateMenuItem("Open", $MenuItem1)
$sva = GUICtrlCreateMenuItem("Save as", $MenuItem1)
$exit = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenu("Tools")
$run = GUICtrlCreateMenuItem("Run", $MenuItem5)
$compile = GUICtrlCreateMenuItem("Compile", $MenuItem5)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$curfile=""
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $exit
            exit
        case $sva
            $flnam=FileSaveDialog("Save as", @scriptdir,"default(*.uam)",16,".uam")
            $flopen=fileopen($flnam,2)
            filewrite($flopen,guictrlread($scriptbox))
            fileclose($flopen)
        case $run
            if $curfile="" then 
                msgbox("","","No file opened or file not saved file must be saved to run.") 
            else 
                run("Autoit3.exe " & $curfile)
            EndIf
        case $open
            $curfile=fileopendialog("Open file",@scriptdir,"default(*.uam)")
            $opfl=fileopen($curfile,0)
            $filer=fileread($opfl)
            fileclose($opfl)
            guictrlsetdata($scriptbox,$filer)
    EndSwitch
WEnd

i get this error

Line 0 (File "C:\new"):
Error: Error opening the file.

im kinda tired so for some reason i cannot figure out why btw i get this error trying to run a file

ohh crap so tired i posted in the wrong forum can someone move this please?

Edited by EagleClaw

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 454, 193, 115)
$scriptbox = GUICtrlCreateEdit("", 8, 8, 609, 417)
$MenuItem1 = GUICtrlCreateMenu("File")
$open = GUICtrlCreateMenuItem("Open", $MenuItem1)
$sva = GUICtrlCreateMenuItem("Save as", $MenuItem1)
$exit = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenu("Tools")
$run = GUICtrlCreateMenuItem("Run", $MenuItem5)
$compile = GUICtrlCreateMenuItem("Compile", $MenuItem5)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$curfile=""
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $exit
            exit
        case $sva
            $flnam=FileSaveDialog("Save as", @scriptdir,"default(*.uam)",16,".uam")
            $flopen=fileopen($flnam,2)
            filewrite($flopen,guictrlread($scriptbox))
            fileclose($flopen)
        case $run
            if $curfile="" then
                msgbox("","","No file opened or file not saved file must be saved to run.")
            else
                run("Autoit3.exe """ & $curfile&"""")
            EndIf
        case $open
            $curfile=fileopendialog("Open file",@scriptdir,"default(*.uam)")
            $opfl=fileopen($curfile,0)
            $filer=fileread($opfl)
            fileclose($opfl)
            guictrlsetdata($scriptbox,$filer)
    EndSwitch
WEnd

in the run line you need to have quotes around the script

run("Autoit3.exe """ & $curfile&"""")

Edited by eckyecky

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