[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: OpSys query in XPL



Reply to note from "Fred Weiner"  Mon, 12 Jun 2006
19:31:07 -0700

Fred:

> I'm working on writing an XPL program (my first, in any
> language other than batch) to place at the beginning of
> STARTUP.INT that finds out whether MSWin98 is loaded or that XY
> is running under DOS only O/S; then brances to two possible
> SETP choices.

U2 frame GetXyOS does what you need. It queries the OS, then stuffs
a 3-character identifier into Save/Get 652. HELP GETXYOS
gives you the basic usage and a list of OS identifiers.

Once you understand how GETXYOS works, your task is simple. Here's
code to execute SETP 1 if the OS is Win98, otherwise SETP 2 (issue
DECODE to decode it into working XPL):

XPLeNCODE v2.0
b-gin [UNTITLED]
[JM_]2.GetXyOS[Q2_];*; Save OS identifier to S/G 652[cr|lf]{<
}IF{<}IS652{>}{240}"W98"{>}[BX_]setp 1[Q2_]{<}GLa{>}{<}EI{>};
*; If Win98, issue SETP 1[cr|lf][BX_]setp 2[Q2_];*; else issu
e SETP2[cr|lf]{<}LBa{>};*; continue...[cr|lf]
-nd
XPLeNCODE

The critical statement (aside from the call to GetXyOS itself) is
{240}"W98">.... The Ascii-240 operator tests for
containment; the English translation is, ÿ7Eÿ7Eÿ7EIf S/G 652 contains
the string "W98"...'

Hope this helps.

--
Carl Distefano
cld@xxxxxxxx