Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Rexx Center's default startup path

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Rexx Center's default startup path
#1581
Posted by: 2003-02-01 01:06:34
I have some problems with Rexx Programmer Center and its startup directory.

If I drag and drop a script's icon onto RPC's icon (to start RPC editing that script), or use the "load on start" preference, then the initial directory does not get changed to the script's. This is different than opening a script with the "File -> Open" menu.
Message2. Re: Rexx Center's default startup path
#1767
Posted by: Jeff Glatt 2003-05-05 11:55:49 Last edited by: Jeff Glatt 2007-08-14 06:13:55 (Total edited 1 time)
It's probably not a good idea to make an assumption about what the default (ie, current) directory is when a script starts.

If your script is going to be run by the enduser clicking on the script's own desktop icon, then note that the user can set the "Start in" directory. Just right-click on the desktop icon to open its pop-up menu, and select "Properties". You'll see where to change the "Start in" directory. This will affect what your default directory is (and what the DIRECTORY() function returns when your script first starts). This also applies if you're using RPC to create a self-running script (EXE). So an enduser can affect what the "default directory" is when your script starts, and that's why it's not a good idea to assume that the default directory will be the same as where your script/exe is located. (And this can be a useful thing because the enduser can set the "work directory" to a different place than the script/exe).

But if your script really needs to know where it is located, then it should use PARSE SOURCE to get its full path (and then use FILESPEC to break off the various pieces if needed).
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2024-4-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0