Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set defa to multiple directories

Status
Not open for further replies.

codetyko

Programmer
May 26, 2001
73
MY
I am programming for a company with a peer to peer network connection. I set one of the pc as a "server" and map this pc as drive "f" in other workstation with "set defa to f:\data" in my main program. With this setup, I need to clarify on these issues:

1) The "server" mentioned above would have to access "c:\data" as this is its resident drive instead of "f:\data". To do so, I have to set the statement in the main program from "set defa to f:\data" to "set defa to c:\data" .

Question: How do I set the program in such a way that if "f:\data" is not found(), go to "c:\data" instead and vice versa?

2) What files do I have to include in the "workstation" besides the esl and exe file? I found that there are some "strange" errors which only happens with some "workstations" such as before the execution of a custom msgbox function, a "file not found" error pops up and when the ignore button is clicked, the message box appeared perfectly without problems. The custom message box function calls its bitmaps from a table which is already included in the .vue file for the respective screens. For the "workstation" where the exe is compiled and naturally the one containing the fpw26 directory , this error does not occur as well as the "server" having its tables read from its native c: drive.

Any ideas? Thanks in advance for suggestions or similar experiences encountered as this is my first attempt in a multiuser environment .
 
Hi
Instead of hardcodeing the drive letters, you can soft code it...

myData = "C:\data" or "F:\Data" and save this as a local mem file in your local directory. Then restore it from mem file when the application runs. May be you can think of defining that as "C:\DATA" if such a mem file is not existing.

Or you xcan think of a local DBF which contains all user specific info for the current workstation, be it a server or a user station. Then set defa to &myData or (myData)

Hope this helps ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
codetyko:

1. You could try:

a.
m.datafile = 'c:\' + <the name of one of your date files, including extension>
IF FILE(m.datafile)
<search in c:>
ELSE
<search in f:>
ENDIF

b.
If you are doing this in Windows enviroment, modify the direct access properties for the system to start in c: or f:, and perform the search without specifying drive letters.

c.
Perform SET DEFAULT TO f:\data; c:\data
(or DEFAULT = f:\data; c:\data in CONFIG.FPW)

2. The msgbox function in built in FOXTOOLS.FLL, so you have to include this file, too.

Try and let us know :)
 
I have a database that stored system memory variables. On program startup it looks at this database and set the memvars. One of the checks is to looks for a file and set the drive letter for the location of that file.

[tt]
*/*************************************************************/Program : FCBIDSYS
*/System : Project Bidding System
*/Purpose : populate the Fc memvars from the BIDSYS table
*/Syntax : do fcbidsys
*/Returns : nothing
*/Parameter : nothing
*/Defaults : nothing
*/Requires : 1. database bidsys to be in the default Dir
*/ : 2. the Fc memvars to be declared public in the calling prg
*/Changes : FC* memvars
*/Calls : nothing
*/Version : 1.0
*/Dated : 11/07/97
*/Written By: David W. Grewe
*/*************************************************************& type of prg :
*/*************************************************************/ Record Of Change
*/************************************************************public PRJTYPE , fcPrjType , fcSysDrv , fcSysDir , fcSysDbf , fcSysRpt , fcSysIcon , fcSysWave , fcSysWall , fcSysPrt
public fcPrintDir , fcTempDir , fcMailer , fcVendor , fcSupDir , fcSupDrv
store &quot; &quot; to PRJTYPE , fcPrjType , fcSysDrv , fcSysDir , fcSysDbf , fcSysRpt , fcSysIcon , fcSysWave , fcSysWall , fcSysPrt
store &quot; &quot; to fcPrintDir , fcTempDir , fcSupDir , fcMailer , fcVendor , fcSupDrv
*
if !used(&quot;BIDSYS&quot;)
use BIDSYS in 0
endif
if sys(5) != BIDSYS.SYSDRV
replace BIDSYS.SYSDRV with sys(5)
endif
*
M.PRJTYPE = alltrim(BIDSYS.PRJTYPE)
fcPrjType = alltrim(BIDSYS.PRJTYPE)
fcSysDrv = alltrim(BIDSYS.SYSDRV) + &quot;:\&quot;
fcSysDir = fcSysDrv + alltrim(BIDSYS.SYSDIR)
fcSysDbf = fcSysDrv + alltrim(BIDSYS.SYSDBF)
fcSysRpt = fcSysDrv + alltrim(BIDSYS.SYSRPT)
fcSysPrt = fcSysDrv + alltrim(BIDSYS.PRINTDIR)
fcSysIcon = fcSysDrv + alltrim(BIDSYS.SYSICON)
fcSysWave = fcSysDrv + alltrim(BIDSYS.SYSWAVE)
fcSysWall = fcSysDrv + alltrim(BIDSYS.SYSWALL)
fcPrintDir= fcSysDrv + alltrim(BIDSYS.PRINTDIR)
fcSupDrv = alltrim(BIDSYS.SUPPORTDRV) + &quot;:\&quot;
fcSupDir = fcSupDrv + alltrim(BIDSYS.SUPPORTDIR)
fcMailer = fcSupDrv + alltrim(BIDSYS.SUPPORTDIR) + alltrim(BIDSYS.MAILERS)
fcVendor = fcSupDrv + alltrim(BIDSYS.SUPPORTDIR) + alltrim(BIDSYS.VENDORS)
fcTempDir = alltrim(BIDSYS.TEMPDIR)
on error **
md (fcTempDir)
md c:\temp
on error
*
lcPath = fcSysDir + &quot;,&quot; + ;
fcSysDbf + &quot;,&quot; + ;
fcSysRpt + &quot;,&quot; + ;
fcSysIcon + &quot;,&quot; + ;
fcSysWave + &quot;,&quot; + ;
fcSysWall + &quot;,&quot; + ;
fcSysDir + &quot;SRC\,&quot; + ;
fcSysDir + &quot;LIB\&quot;
SET PATH TO &lcPath
*
return


procedure LooK4File
**************************************************************parameter pcFileName , pcField
for x = 67 to 90 step 1
lcFileName = chr(x) + &quot;:&quot; + pcFileName
if file(lcFileName)
replace (&quot;BIDSYS.&quot; + pcField) with chr(x)
return chr(x)
endif
endfor
= MsgWWait(&quot;File &quot; + lcFile + &quot; Was Not Located, Exiting the Program.&quot;)
close data
close all
quit David W. Grewe
Dave@internationalbid.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top