Normal Topic File Locations (Read 577 times)
JBMorris
Member
*
Offline


No personal text

Posts: 5
Joined: Jun 28th, 2005
File Locations
Jun 28th, 2005 at 5:06pm
Print Post Print Post  
I'm considering storing things like paths for xlookups within my applications in a text file that I read and parse into global variables when I start an application.  The reason I'm thinking of doing it in a text file instead of a database (the way I have it in my current and very old Q&A4 app) is so that my client's system administrator can feel comfortable moving files and directories around as necessary and updating the text file. 

Any thoughts and advice on best practices for the structure and location of this file?  The system will be multi-user client-server.  I would really prefer the text file with the paths to be on the server side, but I'm not really sure where or if that will work.  For one thing, there's the likelihood of drive mapping differences among the different clients. 

Can Sesame use the \\ drive location syntax?  (heck, I forget that that standard is called)



  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: File Locations
Reply #1 - Jun 30th, 2005 at 4:28pm
Print Post Print Post  
Hello,

The path file can be structured however you want it to be as long as you can parse it out in code.

Yes, Sesame does support UNC (The \\ drive location syntax)

An example of this would be..

Paths.txt contains
Code
Select All
XLookupPath;C:\Sesame\Data
ImagePath;C:\Sesame\Pics
 



The code to parse would be
Code
Select All
Var vPaths as String
Var vInfo as String
Var vName as String
Var vPath as String

vPaths = @Insert("\\ComputerName\c\Sesame\Paths.txt")

While @Len(vPaths) > 0
{
   vInfo = Split(vPaths, @Newline())
   vName = @AccessStringArray(vInfo, 1)
   vPath = @AccessStringArray(vInfo, 2)
   GlobalValue(vName, vPath)
}
 



This would create two GlobalValues with the names of XLookupPath and ImagePath and store the appropriate paths in them.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
JBMorris
Member
*
Offline


No personal text

Posts: 5
Joined: Jun 28th, 2005
Re: File Locations
Reply #2 - Jun 30th, 2005 at 7:44pm
Print Post Print Post  
Thanks for the info, and especially the example.  I missed the GlobalValue procedure and did it the yucky hard way with a big if statement and hard-coded global variable names. 

  
Back to top
 
IP Logged