ExecFile command

Blitz3D Forums/Blitz3D Programming/ExecFile command

Gerard(Posted 2008) [#1]
Hi all !

I've a problem with "execfile" command :

Unlike what is printed in "BLITZ3D Manual book" (page 175) - see note (*)- , EXECFILE don't wait that file$ is completed ...

Example :
;----------------------------------------------------------------
file$="EXCEL.EXE"
ExecFile(file$)
Print " >> message after execfile command"
WaitKey()
End
;----------------------------------------------------------------

==> This little program opens an EXCEL window but, instantaneously, it write message on runtime windows, without waiting exit of EXCEL.

So, What do yo think about this ? Have you answer ?
I know that in DARKBASIC, ExecFile command has another parameter to wait (or not) that file$ is completed.

Thanks for reply 8-)))
-----------------------------------------------------------
(*) extract from Manual:
"Use this command to HALT execution of your program and run an external program"


Wings(Posted 2008) [#2]
I think as soon as excell loader is finished. blitz is getting command back.

I like this feature by the way.. makes blitz multitask like the amiga 512 did.


Wings(Posted 2008) [#3]
I tryed to use execfile with explorer.exe and it took 58 millisecs before program execution continues.. so yes blitz basic dose multi tasking.

But you can always make batch files. and registry magic to controll blirz basic from excell.


Wings(Posted 2008) [#4]
I can comfirm that blitz aint waiting for any program to finish loading. :)
i did a test with a blitz3d program that execute itself....

Time to think of a workaround. for example blitz3d can read registry.
you can make a loop in blitz3d that reads a certain registry key


Gerard(Posted 2008) [#5]
Thanks to WINGS :-)

I'll try his answer :"you can make a loop in blitz3d that reads a certain registry key".

But I think that better is to add a parameter for EXECFILE (or create a "new" EXECFILE, like DARKBASIC). Is it a great problem to implementing such a command ? (question to Mark Sibly or developpers !)
gerard


John Blackledge(Posted 2008) [#6]
Blitz sends the command to Windows to run Excel, as asked, then continues.

If you need your program to halt until the program exits then try this
www.blitzbasic.co.nz/toolbox/toolbox.php?tool=151


Gerard(Posted 2008) [#7]
Thanks to John Blackledge : this was exactly what I hope to do !!
With this answer, my post is closed :)
Gerard