Title: File Exist loop
Hi Stuart,
VB had a DoEvents construct that allows control to pass back to other
running processes, so one process doesn't hang the system. MapBasic
doesn't include that statement, unfortunately. A loop in MapBasic will
thus always be active.
And an active loop that queries for the existence of a file will hog
too many cpu cycles, and therefore it's not a good idea.
Besides, a file exist from when it's created, before it's ready to be
read, so there's also some syncronization issues to handle as well.
What you're doing is waiting for is an external program, so why not let
the external program itself tell the MapBasic app that the file is
ready ?
This is how a VB program would do that (oMIPro is the object reference
to MIPro) :
oMIPro.MBApplications("yourname.mbx").Do "I am ready to rock"
The MapBasic RemoteMsgHandler will be invoked, and
CommandInfo(CMD_INFO_MSG) will return the sent command string, here
it's "I am ready to rock".
HTH
Best regards / Med venlig hilsen
Lars I. Nielsen
GisPro
Gibb, Stuart wrote:
Hi all,
I have an external program which I
call from MI. The result of this is a text file being created which I
then read in for input into MI. Does anyone know how to tell MI to wait
until the external file has been created before trying to open it ?
I'm guessing I need a FileExists Loop
of some sorts but am banging my head against a wall to get it to work.
Many thanks for all your help
previously.
Stu
Visit our website at http://www.halcrow.com
------------------------------------------------------------------------
The contents of this email are confidential, for the sole use
of the intended recipient at the email address to which it has
been addressed and do not give rise to any binding legal
obligation upon Halcrow companies unless subsequently confirmed
on headed business notepaper sent by fax, letter or as an email
attachment. Whilst reasonable care has been taken to avoid virus
transmission, no responsibility for viruses is taken and it is
your responsibility to carry out such checks as you feel
appropriate. Emails supplied are as found and there's no
guarantee that the messages contained within the body of the
email have not been edited after receipt. If you receive this
email in error, please contact the sender immediately and delete
the message from your system.
Thank you.
-------------------------------------------------------------------------
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
|
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l