Sign in to follow this  
Followers 0
Saroset

Run()

7 posts in this topic

Func Function($Variable)
    
    Run($Variable)
    
EndFuncoÝ÷ Ø"¶,²&åzÚ+º{(ëax0ØhºØZ¾)ටjg¬zا²Ú'y«­¢+ÙIÕ¸ ÅÕ½ÐìÅÕ½Ðì°ÀÌØíYÉ¥±

Would that work?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yep, thats the nature of variables. Also you can pass the variable to a function just as you did above. When calling that function, pass whatever variable you want (which will ultimately end up in the Run command).

Looking at code almost makes it easier to explain;

$var1 = "notepad.exe"
MsgBox(0, "", "After you click OK, notepad will run")
Function($var1)

$var2 = "cmd"
MsgBox(0, "", "After you click OK, cmd prompt will open")
Function($var2)


Func Function($Variable)
    
    Run($Variable)
    
EndFunc

EDIT Whoops forgot to welcome you to the forum!

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

RUN($Variable)

This may work, but not the other way around. "Filename" is a required item.


Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Share this post


Link to post
Share on other sites

$var = "notepad"

MyFunc($var)

Func MyFunc($var)

Run($var)

endfuncoÝ÷ Ù8Z·
+Æ®¶­sbb33c´äÔTTDBÒuT7G&Ä7&VFTVFBgV÷C´fÆRæÖRgV÷C²Â#ÂÂ3Â#¢b33c´äÔU$TBÒuT7G&Å&VBb33c´äÔTTDB¤×gVæ2b33c´äÔU$TB ¤gVæ2×gVæ2b33c´äÔU$TB  'Vâb33c´äÔU$TB ¤VæDgVæ0

That doesn't. I'm positive I'm entering "notepad" in the correct field.

Any idea why?

Error: Unable to execute external program.

Access is denied.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Nevermind! I messed up with a variable =P.

Or... Not. It's still giving me the same error.

Edited by Saroset

Share this post


Link to post
Share on other sites

I don't know why exactly that isn't working.... this works for me;

$NAMEREAD = "notepad"
MyFunc($NAMEREAD)

Func MyFunc($NAMEREAD)
    
    Run($NAMEREAD)
    
EndFunc

Try to use some debugging, throw in a msgbox (or consolewrite) before the run function to check the value of $nameread, even an extra space could throw it off. I don't know why it would be saying access denied... are you running vista by chance? Does it change anything to run the script as an admin, or to change the workingdir of the run command?


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I don't know why exactly that isn't working.... this works for me;

$NAMEREAD = "notepad"
MyFunc($NAMEREAD)

Func MyFunc($NAMEREAD)
    
    Run($NAMEREAD)
    
EndFunc

Try to use some debugging, throw in a msgbox (or consolewrite) before the run function to check the value of $nameread, even an extra space could throw it off. I don't know why it would be saying access denied... are you running vista by chance? Does it change anything to run the script as an admin, or to change the workingdir of the run command?

XP. I'm writing a section to do some debugging atm.

Edit: Checked the value while running, turns out it's either not reading correctly or not saving correctly. Probably a mistake somewhere.

Edit2: Yup, turned out I made a mistake. Thanks!

Edited by Saroset

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