Another thought, with out the complexities of true INI [see website for
sample code], would be to create an INI file, just one line of text that is
the path for that machine.  This would facilitate needed
changes/installations without any code rewriting.  Besure to replace the
ProgramName with you MBX name.
If you need more than this then you can read each line, see what the KEY= is
and then assign the =VALUE to an assigned variable but if your going to do
this then looking into using the WinAPI would really be easier. [ IMO ]

DIM aPath AS STRING
IF FileExists(ApplicationDirectory$()+"ProgramName.INI) THEN
  Open File ApplicationDirectory$()+"ProgramName.INI" FOR INPUT as #1
    While aPath=""
      Line Input #1, aPath
    Wend
  Close File #1
ELSE
  aPath=FileOpenDlg("","","","Please Locate The File....")
  IF aPath>"" THEN
    aPath=PathToDirectory$(aPath)
    Open File ApplicationDirectory$()+"ProgramName.INI" FOR OUTPUT as #1
      Print #1, aPath
    CLOSE FILE #1
  ELSE
    NOTE "Terminating....Can Not Locate File(s)"
    END PROGRAM
  END IF
END IF


Trey Pattillo
[EMAIL PROTECTED]
www.wap3.com
-97.66532W 27.79902N


----- Original Message -----
From: "Driver, Greg 9434" <[EMAIL PROTECTED]>
To: "MapInfo-L (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, December 04, 2001 06:22
Subject: MI-L File open in MapBasic


> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
>
> Hi Listers
>
> Is there a way to identify the location of a file in MapBasic without
having
> some sort of user inter-action (say using FileOpenDlg)?  The problem I
have
> is that we have some users (at remote locations) who access files on their
> C: drive, whilst others who access the same files via a server (though
even
> then the mapped drive pointing to the same server may well be different on
> different PC's).  So if I want to open a table in MapBasic that's held in
> different places what's the best way to go about it without getting the
user
> to locate it through a dialog?
>
> Thanks in advance.....
>
> Greg
>
>
>
>
> Internet communications are not secure and therefore Surrey Police does
not
> accept legal responsibility for the contents of this message.  This email
> and any attachments may be confidential. They may contain privileged
> information and are intended for the named addressee (s) only. They must
not
> be distributed without our consent. If you are not the intended recipient,
> please notify us immediately and delete the message and any attachments
from
> your computer, do not disclose, distribute, or retain this email or any
part
> of it. Unless expressly stated, opinions in this email are those of the
> individual sender, and not of Surrey Police. We believe but do not warrant
> that this e-mail and any attachments are virus free. You must therefore
take
> full responsibility for virus checking. Surrey Police reserves the right
to
> monitor all email communications through their networks.
>
>
>
>
>
> _______________________________________________________________________
> 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