On 20/10/2018 22:22, Scott Hemphill wrote:
Isaac Mateo Sarzosa Valencia <mateosarzosa@gmail.com> writes:
Thanks so much for replying.
What does '\•<-' mean?
Especially the upper-mid dot.
You don't have those characters in the correct order. It should be
'•\<-'
Whenever you encounter a backslash, it begins a three character code
that describes a single HP48 character. \<- is the visible left arrow character. The single quotes surround a variable name, which in this
case is comprised of a center dot and a left arrow. This is the name of
a function, which is defined as part of the directory.
The suggestion to start from the DIR and go to the END omitted to
mention that this just gives you a directory object on the stack. You'll
then need to to STO it - which will create a sub-directory.
E.g.
DIR A 33 END
'ZZ' STO
will create a sub-directory called ZZ in the current directory and it
will contain a variable 'A' containing the value 33.
Also, the HP Museum thread notes that the program as listed won't work
on the 48G (because it uses the COL+ command) and an alternate version
is supplied. I've incorporated that below.
The program as listed is actually two, so it might be easier just to
enter those one at a time and STO them individually.
First program:
« VARS 1 OVER '·\<-' POS 1 - SUB PURGE »
'.\<-' STO
(To enter '.\<-' I suggest pressing ' then CHARS then select char 183
ECHO followed by char 142 ECHO)
WARNING: DO NOT RUN THE .\<- PROGRAM AS IT WILL DELETE ALL YOUR
VARIABLES INCLUDING THE FOLLOWING 'SYS' PROGRAM WHICH TAKES AN AGE TO
ENTER ON THE CALCULATOR!!! Just delete the variables manually when you
move to a new problem.
Second program:
«
DUP SIZE \-> l n
«
n \->LIST 'EQS' STO
0 n FOR i
1 n FOR j
i j == 1 0 IFTE
l j GET STO
NEXT
1 n FOR j
'EQS(j)' \->NUM
NEXT
n \->ARRY
i IF NOT THEN
NEG 'VET' STO
ELSE
VET + ARRY\-> DROP
END
NEXT
{ n n } \->ARRY
l PURGE
TRN CONJ 'MAT' STO
VET MAT /
n 1 FOR i
DUP i GET l i GET STO
-1 STEP
VET ARRY\-> DROP {n 1} \->ARRY
'VET' STO DROP
»
»
'SYS' STO
They aren't the best written programs in the world because (a) one uses
PURGE (which is asking for trouble at the best of times) to remove all variables from the current directory (except itself) (except it doesn't)
so use a separate directory (from your other work) to store both in
otherwise you WILL lose work; and (b) the second creates variables which
is not best practice - mostly because they're hard to clean up safely.
The PURGE in the ./<- program simply doesn't work as intended. At the
very least it needs to check for '.\<-' and 'SYS' and not purge those.
Also the line "i j == 1 0 IFTE" could become "i j ==" since the IFTE is
only returning true or false (1/0) which the == command does anyway.
Hmm.
--
Bruce Horrocks
Surrey
England
(bruce at scorecrow dot com)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)