Sign in to follow this  
Followers 0
bobheart

Help A Dumb Sh@t Out :)

4 posts in this topic

I started this but not having much luck . as always . lol

What I want to do is have this script that I can use to compile basic files .

I don't like using the command line to do it so what I did was made a au3 script that has the info hard coded in it .

Something like this

Run(@comspec& " /k TBC.EXE LNEQ.BAS")

So even if I could make it so I just have to point to the file I want to compile would be great .I would just hard code the compiler.exe .

#cs - ### Generated by AutoBuilder 0.4 -- do not modify ###
388 271
0   2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
button  $button_1   Button 1    30  30  90  20  0   0   
button  $button_2   Button 2    30  80  90  20  0   0   
#ce - ### End of Dump ###

;Script generated by AutoBuilder 0.4


Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate("MyGUI", 386,266,(@DesktopWidth-386)/2, (@DesktopHeight-266)/2 , 0x04CF0000)

$button_1 = GUISetControl("button", "Button 1", 30, 30, 90, 20)
$button_2 = GUISetControl("button", "Button 2", 30, 80, 90, 20)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    Case $msg = 2
       ;;;
    Case $msg = $button_1
   $message = "Load the compiler exe."

$var = FileOpenDialog($message, "C:\", "exe's (*.exe)", 1 + 4 )

If @error Then
    MsgBox(4096,"","No File(s) chosen")
Else
    $var = Run(@ComSpec & " /k "$var", $var")
EndIf

Case $msg = $button_2
$message = "Load the compiler exe."

$var2 = FileOpenDialog($message, "C:\", "BLD's (*.*)", 1 + 4 )

If @error Then
    MsgBox(4096,"","No File(s) chosen")
       ;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites



well this part of your script it seems to fall apart

$var = Run(@ComSpec & " /k "$var", $var")

you might want to have a different variable for each.. now here you have a typo that should be "$var", "$var2"

however to make your code more easy to debug you might want to think of using things like

$compile = Run(@ComSpec & " /k " & $prog & ", " & $code)

as your variables. Having this means less chance of missing little typos like that (it's ever easy to miss a little number on the end) as well as being sure that nothing is overwritten as in the case where you have you $var being overwritten

anyway.. along with all of this I beleive that the fileopen dialogue contains the entire string ie C:/myfolder/myprog.exe instead of just myprog.exe. Not sure if that is making a difference or not however if it has something like :

c:/documents and settings/administrator/desktop/myprog.exe

then you will note that documents and settings have spaces.. Command prompt doesn't handle spaces like that too well you need to put the whole string into quotes which means in autoit you need double quotes.

$compile = Run(@ComSpec & " /k '" & $prog & "', '" & $code & "'")

not sure if that would work. I don't have the program you do to test it out.

your other option is to take the file open dialogue and break up the string by "/" and then take the last value which should be your program. and then make sure the script is run from it's directory. which means both code and exe needs to be there as well as the script.. hm kinda messy.. ok ignore that one.. (wandering thoughts are fun) :ph34r:

ok well I will stop rambling now and hopefully I've given something that may work. if not I'm sure someone will come in and clean up my mess :(

moo

Share this post


Link to post
Share on other sites

$var = FileOpenDialog($message, "C:\", "exe's (*.exe)", 1 + 4 )

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = Run(@ComSpec & " /k "$var", $var")

EndIf

Case $msg = $button_2

$message = "Load the compiler exe."

$var2 = FileOpenDialog($message, "C:\", "BLD's (*.*)", 1 + 4 )

oh actually I saw more.. you have it say if it can open the file then to make $var that but in the code it hasn't even gotten to the other file open yet so there is no variable there.

So they are in the wrong order too. hmmm.. I dunno if I'm helping or hindering here.

Share this post


Link to post
Share on other sites

I wish it helped me but it does not . i just don't get a lot of this I guess . :ph34r:

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