[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: programming question
- Subject: Re: programming question
- From: "Robert Holmgren" holmgren@xxxxxxxx
- Date: Sat, 15 Feb 2003 11:36:42 -0500
** Reply to message from Harry Binswanger on Sat, 15 Feb 2003
01:18:24 -0500
> >BX ca filenameQ2 ;*; if it's not open, open it in a new window
> >;*: store the window number that it's in
> Suppose the shorthand file is in window 3. Then to switch to it, use the
> function:
> #3
> which you get into your XPL by entering, on the command line, PFUN #3
Or -- maybe simpler -- since you stuffed the WindowNumber into S/G 01 in the
sample code above, you can issue
BX func #Q2 ;*;
> This presupposes that your settings.dfl file has set the default value of
> NW to something other than 0. I use NW=3.
In "public" programming you aren't able to assume that really, but it's easy
enough to work around, by opening the window first (making it the current
window), then CAlling a file into it if there isn't one there already. The
real difficulty arises on closing the file and then killing the window: you
have to get the window number first, then ABort, then check whether the window
number is still open or not, and if so RemoveScreen. Zillions of examples of
this in U2. Something like:
>;*;
BX ab/nvQ2 ;*;
==&>1>BX rsQ2 ;*; This works around the problem that
if this is the last and only open window, it MUST stay open!
-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------