Re: Portable XY

  • From: Carl Distefano <cld@xxxxxxxxxx>
  • To: xywrite@xxxxxxxxxxxxx
  • Date: Mon, 25 Jun 2012 10:45:38 -0400

Quoting Fred Weiner <fw1948@xxxxxxxxx>:

Why not use <VA$ED>? Isn't that the editor's directory? In other words,
what's the advantage of <VA$PA>, the current D:\PATH?

<VA$ED> includes both the path and the EXEcutable's filename; if you use <VA$ED> you must parse out the filename. Easy way to do this parsing is:
<SX50,<VA$ED>>JM 2.GetPathQ2 ;*;
(which puts the path only into S/G 50); we use it all the time in U2. You can do that in STARTUP.INT, but only *after* U2 has been loaded. The advantage of <VA$PA> is that it's elegantly simple -- no parsing required. Just be sure that, at the time you invoke <VA$PA>, Editor's dir is the current dir -- and it *will* be the current dir, unless a ChDir command has been executed before <VA$PA> is used. If you hold off on any ChDir commands until the very end of STARTUP.INT, you should be safe.

--
Carl Distefano
cld@xxxxxxxxxx


Other related posts: