Hello,
i just hit a easy(?) problem.
How can i pause ABL for a amount x of seconds without showing any window in a batch process?
With C# i would use Thread.Sleep but this isn't allowed in OOABL (ABL.NET).
I found old p9079 but i won't like to use ocx.
/* UPDATE */
It seems to be that i hit a bug again (as so often in the past months), the trick is using WIN API (P167212,P24590).
Many KB where i am missing links, without good links it would prevent initiating discussions ...
Stefan
if you only need down to seconds then what's wrong with plain abl?
pause 0 before hide.
pause x no-message.
It's wrong that it's shows an empty ABL window.
It's wrong that it's shows an empty ABL window.
DEFAULT-WINDOW:HIDDEN = TRUE .
It's still showing the window, only API with sleep helps (as proposed in two KB).
What about using the -b parameter in the command line?
prowin32 -b -p program.p [additional command line parameters]
or
_progres -b -p program.p [additional command line parameters]
Well, -b would be another solution.
Because i am using alert-boxes and silent run in a mix i prefer the API version.
And i can test it easy within OEA or procedure editor.
Thanks for the answers.
You can in fact use System.Threading.Thread:Sleep(n). We have a restriction that you cannot create a new thread from the ABL. (Is that why you were thinking you can't use this?) But you can use this static method which operates on the current thread. I was also thinking that maybe this did not work in batch mode. But actually this works just fine.
What about "WAIT-FOR CLOSE OF THIS-PROCEDURE PAUSE n"?
Laura,
i didn't notice that the .NET sleep in the thread class is allowed, that's fine. (perhaps it will call inside the same api function)
I am not 100% sure, but i think that i tested it in the past with 10.2A and got an error.
Since them i never tried it, because it's a threading class.
What about updating P167212? The better solution für a GUI for .NET application should be to use this static .NET method than API.
For me - i will prefer this instead calling API direct.
Stefan
I have requested that this solution be updated. Thanks.
PROCEDURE Sleep EXTERNAL "kernel32":U:
DEFINE INPUT PARAMETER Milliseconds AS LONG NO-UNDO.
END PROCEDURE.
Seems to do the trick fine...