Jump to content

V3.0.103 Unstable


Jon
 Share

Recommended Posts

  • Replies 113
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Administrators

Is there a way to allow the onexit to be called while the current script is paused, but be ready to jump back in if break(0) is called inside of onexit? Also, what about the onpause? maybe?

OnExit is already called on exit even if the script was paused. (Click pause, click exit, onexit runs)

onpause would be difficult with the way that autoit currently works internally (when paused the script isn't processed at all)

Link to comment
Share on other sites

What I meant is this:

Allow onexit to be called as if it was _part_ of the _currently running_ action, but return to the currently running action if the onexit function was stopped with break(0). That is why I voted for a return statement that would allow the actual code in the onexit function to decide whether or not to exit the script at that time (like vb).

I this way, if a user tried to exit a script, the script would be able to ask "Would you like to save first" [Yes] [No] [Cancel]

If cancel was pressed, the actions of the script would return to execution as if an exit had never been attempted.

Comprende?

Who else would I be?
Link to comment
Share on other sites

For me, that raises the question, why have the option to exit a script at all if the script writer can just say "No, you can't close me".

But anyway, according to the description of how the event works, what you are asking for is a technical impossibility because there literally isn't anything to return to; the stacks are already popped so all the data is lost (With the exception of global data since that is the last stack that is popped off).

Link to comment
Share on other sites

I am sorry, I don't understand the technical aspects of it. Please let me rephrase the question: Is there a way to "call" the exitfunc code as if it was called as a function from the current line of script?

Who else would I be?
Link to comment
Share on other sites

That's simple. I do it now.

SplashImageOn("Splash", @TempDir & "\image.jpg", 320, 240, @DesktopWidth, @DesktopHeight, 3);show offscreen
WinSetTrans ("Splash", "", 0);make invisible
WinMove("Splash", "", (@DesktopWidth / 2) - (320 / 2) , (@DesktopHeight / 2) - (240 / 2));move back on screen
For $i = 0 To 254 Step 2;fade in
  Sleep(10)
  WinSetTrans ("Splash", "", $i)
Next
Sleep(3000);wait a few seconds
For $i = 254 To 0 Step - 2;fade back out
  Sleep(10)
  WinSetTrans ("Splash", "", $i)
Next
Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

  • Administrators

Updated:

http://www.autoitscript.com/autoit3/files/unstable/autoit/

- Added: Ping()

- Changed: StringMid() the "count" parameter is now optional (assumes remainder of the string)

- Fixed: ^ operator

- Changed: "step" option added to PixelChecksum()

Edited by Jon
Link to comment
Share on other sites

  • Developers

Just tested the script that generates all config files to see if it picks up all updates and noticed that also PixelChecksum changed from:

PixelChecksum ( left, top, right, bottom )
to:

PixelChecksum ( left, top, right, bottom [, step] )

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Jon: there is a bug with "StringMid"

I tried that:

$string = "c:\windows\notepad.exe"
$mid = StringMid($string,4)
$mid = StringMid($string,4,3)

I always get the message: incorrect number of parameters in function call !!!

I saw in the script.cpp:

{"STRINGMID", &AutoIt_Script::F_StringMid, 3, 3},

which seems not to be correct.

Regards Holger

Link to comment
Share on other sites

Great :lol: now I can delete my old 'ping' call in some scripts and change it to an internal command :ph34r:

Maybe CyberSlug could have a little problem with it, cause in the past he wanted it like, i.e.if you use:

If ping("www.something.com",100) Then
   Msgbox(0,"..."successfull")
Else
   Msgbox(0,"error",@error)
EndIf

But however, it works good for me :(

Thanks

Holger

Link to comment
Share on other sites

  • Administrators

Great :lol: now I can delete my old 'ping' call in some scripts and change it to an internal command :ph34r:

Maybe CyberSlug could have a little  problem with it, cause in the past he wanted it like, i.e.if you use:

If ping("www.something.com",100) Then
   Msgbox(0,"..."successfull")
Else
   Msgbox(0,"error",@error)
EndIf

But however, it works good for me :(

Thanks

Holger

The code I have from you did actually set those values in vResult so I updated the docs - I didn't really change the code. Unless you resent it with some changes?
Link to comment
Share on other sites

:ph34r: I take a look...

Edit: cannot find the thing why and how...

At first I used instead of "vResult"-setting -> "SetFuncErrorCode"...

Ok, if I find something (which will not break existing scripts) I will tell you so maybe for one of a next publish we can build in. :lol:

Thanks and regards :lol:

Holger

Edit again: after thinking about I see no chance for it, so we let it like it is.

The problem is to return something that is true or false.

Cause here are 0 and greater true and <0 have to be false and that is not possible, thatswhy.

So, no more discussion about it :D like my mother always said: "you must eat what is on the table" (don't know the correct translation from german you know) :(:D

Upd maybe a change is needed :D Jon, I'll send you the stuff and changed docu in a few minutes, if you want it to change...

Then it would react like at "DriveMapAdd" -> success: result >= 0 ; when the function fails (returns 0) @error contains extended information...

1 = timeout

2 = unreachable

3 = bad destination

4 = other network error

Sorry, I've looked in the source from the 29.07. and maybe I've send you the old stuff with the vResult instead now of SetFuncErrorCode :">

I saw that cause I still had the "autoit3-special" with a prepublish of the ping-function...

Edited by Holger
Link to comment
Share on other sites

  • Administrators

:ph34r: I take a look...

Edit: cannot find the thing why and how...

At first I used instead of "vResult"-setting -> "SetFuncErrorCode"...

Ok, if I find something (which will not break existing scripts) I will tell you so maybe for one of a next publish we can build in. :lol:

Thanks and regards :lol:

Holger

Edit again: after thinking about I see no chance for it, so we let it like it is.

The problem is to return something that is true or false.

Cause here are 0 and greater true and <0 have to be false and that is not possible,  thatswhy.

So, no more discussion about it :D like my mother always said: "you must eat what is on the table" (don't know the correct translation from german you know)  :(:D

Upd maybe a change is needed :D Jon, I'll send you the stuff and changed docu in a few minutes, if you want it to change...

Then it would react like at "DriveMapAdd" -> success: result >= 0 ; when the function fails (returns 0) @error contains extended information...

1 = timeout

2 = unreachable

3 = bad destination

4 = other network error

Sorry, I've looked in the source from the 29.07. and maybe I've send you the old stuff with the vResult instead now of SetFuncErrorCode  :">

I saw that cause I still had the "autoit3-special" with a prepublish of the ping-function...

K, I'll change it to match that.
Link to comment
Share on other sites

  • Administrators

Updated:

http://www.autoitscript.com/autoit3/files/unstable/autoit/

- Changed the return values for Ping()

- Removed URLDownloadToFile()

- Added HttpGet() and FtpGet() - both have a new option to force a cache reload

You can actually use HttpGet() for both http/ftp, but if you want to specify a binary/ascii transfer type for FTP then you can use FtpGet() which has an extra option.

I've also put instructions in the docs on how to use usernames/password with http/ftp commands (this actually worked before but was not documented)

- Added HttpGetSize() (FtpGetSize isn't looking doable without IE5)

I'm looking to add a HttpSetProxy() command next and possibly a FtpPut()

Link to comment
Share on other sites

  • Administrators

Where are the docs on the listview stuff? You said they weren't in there last time, but surely they should be in there this time...

Remember? #28222

Seeing as so many people wanted it I've had zip feedback on this one - so i'll assume everyone likes the syntax and way I've done it and I'll document it as is (I just didn't want to have to redocument if it wasn't liked).
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...