Hello,

You are right that file funtions can not be used in the MBWindow.

The Open "filename" as #FileNum is calling the WinAPI>OpenFile which returns
a FileHandle is successful with MI/MB them maps to your assigned #FileNum
and
is then forever hidden from access.  The Print #FileNum has access to the
handle referenced
by #FileNum but as stated in the help file it can't be accessed by code.

Plan #A -- use WinAPI ---- won't work in MBWindow because DECLARE can not be
used  but fine in MB code

Plan #B -- use Run Program "ProgramName [ParamA ParamB..........]"
and then create a small *non-visual" application in your favorite language
that
can pick up the command line parameters and process them.

ProgramName = FileWrit.exe [using 8.3 as DOS application can be contructed
and work correctly]
ParamA = the file to write to [full drive/path/filename]
ParamB = flag to Append or Overwrite
ParamC....? = parameters to write to the file

This can be done in Scripting, Delphi, VB, C--, or even as a DOS Batch File


Trey Pattillo
-97.665333W 27.799121N
www.wap3.com
[EMAIL PROTECTED]


----- Original Message -----
From: "Jacques Paris" <[EMAIL PROTECTED]>
To: "MIL" <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 14:16
Subject: MI-L run command and print #


> I am trying to use the run command to write to an open file the following
> way
>
> a=frontwindow()
> run command "print #9, "+a
>
> I get a "Command unavailable: Write." Notice that >> run command "print
"+a
> << will work.
>
> Does the following sentence from the help file be the key to it :"The rc
> statement has some restrictions, due to the fact that the command
parameter
> is interpreted at run-time, rather than being compiled".
>
> For me run-time is equivalent to the MapBasic Window environment (which is
> not compiled). Can I see the "run command" as being bound to the MBW
> environment and thus having the same restrictions? And that the handling
of
> files is impossible with run command?
>
> As the continuation of the previous quotation is "You cannot use a rc
> statement to issue a dialog statement. Also, variable names may not
appeared
> enclosed in quotes", wouldn't you have interpreted that as all the
> restrictions we were warned about?
>
> I expect to learn I am right and I already hate it. Any work around?
>
> Jacques Paris
> e-mail  [EMAIL PROTECTED]
> MapInfo/MapBasic support  http://www.paris-pc-gis.com
>
>
>
> _______________________________________________________________________
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to