Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set path to:
Message
From
17/03/2004 04:21:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/03/2004 03:48:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00886984
Message ID:
00886992
Views:
18
>Hi all,
>
>I have problem with the following commands "SET DEFAULT TO" & "SET PATH TO" commands:
>
>Firstly I specify my DEFAULT dir to (SET DEFAULT TO c:\program;)
>My set path is where it gets n bit more interesting.I have about 40 programs that is in my working directory,but these lie in there own folders for example:The default Directory as I have mentioned is c:\program and the working programs are in c:\programs\prog1,c:\programs\prog2,inc:\programs\prog3 and so on.So when I do a (SET PATH TO) with all these directories seperating them with a semi-colon I cannot continue to the next line with a semi-colon for the set path command ignores it.My solutions for this was add all of them in one straight line,but it has reached the end of the page.
>
>I have also tried to put this string into a text file and then assign it to a variable with SET PATH TO cPath and it returns no error.When it comes to the first table or program it cannot find the location.Is there any other way that I can try.
>
>Regards,
>
>Colin Smith

Colin,
1) You could preserve space using relative pathing. ie :
set path to 'progs1;progs2;progs3;forms;include;'
2) I think path had a limit of 1024 in length. Other than that spanning to multiple lines is not a problem. ie:

set path to ('c:\Some Path\Folder1;'+;
'c:\Some Path\Folder2;'+;
'c:\Some Path\Folder3;'+;
'c:\Some Path\Folder4;'+;
'c:\Some Path\Folder5;')

PS: If you use relative pathing and put that path in 'Tools\Options\File Locations\Search path' (or have a line in config.fpw) you'd have same pathing to a folder tree whereever your set default changes. ie: In my system for projects I've a structure like :

...\Proj1Path
...\Proj1Path\Include
...\Proj1Path\Data
...\Proj1Path\Forms
...\Proj1Path\Reports
...
...\Proj2Path
...\Proj2Path\Include
...\Proj2Path\Data
...\Proj2Path\Forms
...\Proj2Path\Reports

and my path looks like : Include;Data;Forms;Reports;c:\MyPath\CommonToAll
When I want to work with Proj1 I simply do
set defa to ...\Proj1Path
to switch to other :
set defa to ...\Proj2Path

Update: With assigning to a char variable don';t forget to include parentheses :
set path to (m.lcPath)
otherwise path is set to cPath (literally as if cPath was afolder name)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform