Sign in to follow this  
Followers 0
Daniel W.

_Exit( ) UDF

12 posts in this topic

Hi,

was boring when i asked wOuter what to make he told me this:

[22:43] Daniel: ....
[22:43] Daniel: i want to code something but dunno what
[23:00] wOuter:  write something that makes up idees for you.
[23:00] wOuter:  xD
[23:25] Daniel: xD

So i have rewritten Exit

Func _Exit()
    Switch @Compiled
        Case 1 
            Local $file1 =FileGetShortName( @ScriptFullPath )
            Local $split = StringSplit( $file1 , "\" )
            Local $file = $split[ $split[ 0 ] ] 
            Select
                Case ProcessExists( $file )
                    ProcessClose( $file )
                Case Not ProcessExists( $file )
                    SetError( 1 )
                    Return " "
            EndSelect
        Case 0
            Local $file = "Autoit3.exe"
            Select
                Case ProcessExists( $file )
                    ProcessClose( $file )
                Case Not ProcessExists( $file )
                    SetError( 2 )
                    Return " "
            EndSelect       
    EndSwitch
EndFunc

Regards


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Setting the @error is rather useless IMHO... You can play around with this, and it doesn't do anything that Exit doesn't do because you never get an error msg:

$timer = TimerInit()
While 1
    $diff = TimerDiff($timer) / 1000
    If $diff >= 6 Then MsgBox(0, '1', _Exit())
    ToolTip($diff & @CR & @ScriptName, 0, 0)
WEnd

Func _Exit()
    If ProcessExists(@AutoItPID) Then ProcessClose(@AutoItPID)
    SetError(1)
    Return 0
EndFunc

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

So, how does this UDF replace this

Exit 1

:D

Share this post


Link to post
Share on other sites

This was just for fun and not for a revolution in autoIT ....


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

My reply (as well as MHz's I'm sure) wasn't meant to be mean, it was just constructive criticism, I'm sure I could have worded mine better :D .

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Oh k than i understood it wrong ( english 4 at school ^^ )

Sorry then


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

Why do you flame ?

I got a 1 in latein so fuck off ?

And this is the Scripts and Scraps forum?

And i posted A SCRIPT

wow thats amazing or ? a script in the script forum wOOt lets flame him ...


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

dan calm down, i dont think he was flaming you at all, your the one thats starting up the flame.

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Nice, a little pointless, but at least it is readable and makes sense.

Now you need to make up something revolutionary!

Share this post


Link to post
Share on other sites

Why do you flame ?

I got a 1 in latein so fuck off ?

And this is the Scripts and Scraps forum?

And i posted A SCRIPT

wow thats amazing or ? a script in the script forum wOOt lets flame him ...

I meant: Wow that's amazing, You're doing a great job!! :D

Keep them coming!

Share this post


Link to post
Share on other sites

Which part makes sence ?

I don't think its wise to ProcessClose() any program when it can be close in a normal fashion with Exit.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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