Re: Integers vs. reals in s/gs

  • From: Carl Distefano <cld@xxxxxxxxxx>
  • To: xywrite@xxxxxxxxxxxxx
  • Date: Tue, 04 Oct 2016 16:03:35 -0400

Harry,

1. Do serious XPL programmers use Scroll Lock? I don't, but maybe I'm missing out.

It's a quick-and-dirty facility for recording macros. If you're programming, chances are you need more than that. Besides, Scroll Lock is a pain. If it gets stuck in the On state, which happens frequently, you've got to kill the session. If you want to record keystrokes, investigate Xy4's func RK. U2 has two implementations of it, frame RK (mine) and frame RKOK (Robert's).

2. In the same vein, should I be using LDPM? Or does U2 obsolesce that?

Timely question. LDPM is the only "native" XyWrite way to load the contents of a file into a Save/Get. But since it only works with "ordinary" S/Gs (A-Z0-9), it's awkward, especially in programs that are intended for public dissemination. You've got to jump through hoops to make sure that you're not overwriting the user's S/G contents. U2 has facilities that automate the hoop-jumping, that simulate saving the file directly to a programming S/G, like 01. There's SVfile: <SV50,01,d:\path\filename>JM 2.SVfileQ2 , and there's one that I use most of the time SV50: <SV50,d:\path\filename>JM 2.SV50Q2 , which puts the file contents into S/G 50. Both of these frames use LDPM in the background. They've got to; there's no other way.

Very recently, however, I discovered that there _is_ another way, if you're running XyWrite under 4DOS. Look at the new frame SV50v. It uses a 4DOS batch file, FILE2628.BTM, which writes the contents of a specified file directly to S/G 628, in DOS. SV50v then passes the contents of 628 to S/G 50 and zeroes out 628 (to save memory). It's a tad slower than SVfile or SV50, but it steers clear of LDPM and the user's ordinary Save/Gets; and, as user programming, it's pretty nifty. Here's the batch file

rem FILE2628.BTM
@echo off
set /a s=%@filesize[%1]
set n=%@fileopen[%1,r,b]
echos «SV628,%@fileread[%n,%s]» >%2
set c=%@fileclose[%n]
exit

I'd better encode that, since it includes 1-byte guillemets:

XPLeNCODE v2.0 (ENCODE.EXE)
b-gin [UNTITLED]
@echo off[cr|lf]set /a s=%@filesize{091}%1{093}[cr|lf]set n=%@
fileopen{091}%1,r,b{093}[cr|lf]echos {<}SV628,%@fileread{091}%
n,%s{093}{>} >%2[cr|lf]set c=%@fileclose{091}%n{093}[cr|lf]exi
t[cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxxxx

Other related posts: