From helens!relgyro!shelby!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!liuida!isy!lysator.liu.se!howard Tue Jun 19 11:42:43 PDT 1990
Status: RO

Article 1946 of comp.sys.handhelds:
Path: helens!relgyro!shelby!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!liuida!isy!lysator.liu.se!howard
>From: howard@lysator.liu.se (M V Howard)
Newsgroups: comp.sys.handhelds
Subject: HP48SX database system
Keywords: The Ultimate in personal databases :-) ??
Message-ID: <81@lysator.liu.se>
Date: 18 Jun 90 18:14:54 GMT
Sender: news@isy.liu.se (Lord of the News)
Distribution: comp
Organization: Lysator Computer Club, Linkoping University, Sweden
Lines: 288


%%HP: T(3)A(R)F(.);
DIR
@
@ DATABASE -- A collection of programs which form a personal database for the
@             HP-48SX. Originally written by W.A.C Mier-Jedrzejowicz for
@             the HP-28 (in the book Customize Your HP-28, see below),
@             ported to the HP-48SX and extended by M.V. Howard.
@
@ Instructions:
@
@ There are two ways of using the programs in this package:
@
@   1) Use it as a straight forward HP-48SX program package, moving to
@      one of your DATABASE directories and then pressing CST. To quit,
@      press VAR and move to whatever directory you want to. Uncool.
@
@   2) Take full advantage of the powerful commands available in the
@      HP-48SX and create an environment (seperate from all others) in
@      which to manipulate your databases. Gives you frostbite :-)
@
@ To use the first option, load this file into your HP-48SX. That's it.
@
@ For the second option, a little more preparation is needed. After having
@ loaded this file (calling it, say, DBASE) create a variable DPATH in your
@ HOME directory containing the PATH to the directory NOTES (created when
@ loading this file). Then move the program DBSTART (in this file) to your
@ HOME directory. Next, enter the following on your HP-48SX:
@
@ 2: << DBSTART >>
@ 1: 25.3
@ ASN (blue-shift-CST)
@
@ This assignes the DATABASE auto start program to blue-shift-up-arrow
@ (the key labelled LIBRARY. I use this key because it doesn't have any
@ standard blue-shifted function. If you want another key instead, simply
@ enter a different keycode).
@ When ever you wish to use your database, simply press blue-shift-up-arrow
@ and the program will start automatically, moving you to the DATABASE
@ directory NOTES, but also remembering where you started from, so that when
@ you select QUIT to exit DATABASE, you will automatically be moved back
@ to the directory you started from.
@
@ I have had great use of these programs hand hope that you will find them
@ worthwhile too. The only problem is that I use them so much, I'm going
@ to have to buy a second RAM card soon... ;-)
@
@ If you have any complaints, suggestions, flames or love letters, please
@ email them to me. I will reply to any and all email, provided they
@ offer positive critisism, thoughts, ideas and/or comments. Abuse will
@ be forwarded to /dev/null...
@ The rest you can send to  howard "at" lage.lysator.liu.se
@
@ A big thanks to W.A.C. Mier-Jedrzejowicz for the original programs
@ which appeared in the book Customize Your HP-28. Without that, this
@ would never have been written. If your are interested in getting the
@ book (and I highly recommend it, to both 28/48SX owners) you can get
@ it from EduCALC (CA, USA) or from Mr Mier-Jedrzejowicz (to contact him
@ see the documentation).

  DBSTART
  \<<
    "Entering DATABASE
-- Use QUIT to exit"
    1 DISP 1 FREEZE
    PATH HOME 'DBP' STO
    DPATH EVAL 1 MENU
  \>>

  ADD
  \<<
    DUP DROP RCLF SWAP -56 CF
    IF DUP TYPE 5 ==
    THEN
      \->STR "{" SWAP + STR\->
    END
    IFERR 'NOTEL' RCL
    THEN
      DROP { }
    END
    + 'NOTEL' STO STOF
    1 'POSL' STO
    CURR
  \>>

  FIND
  \<<
    'OBJL' STO 0
    'POSL' STO cont
  \>>

  cont
  \<<
    NOTEL POSL 1
    + OVER SIZE SUB DUP
    OBJL POS
    IF DUP
    THEN 
      'POSL'
      STO+ DROP
      OBJL POSL
    ELSE
      DROP
      SRCH
    END
  \>>

  SRCH
  \<<
    IF DUP SIZE OBJL TYPE 2 == AND
    THEN
      1 1
      DO DROP
        GETI
        IFERR OBJL POS
        THEN 0
        END
      UNTIL OVER 1 == OR DUP END
      IF THEN
        1 -
        IF DUP NOT
        THEN
          DROP
          DUP SIZE
        END
        SWAP OVER GET SWAP
      ELSE
        DROP2 OBJL 0
      END
    ELSE
      DROP
      OBJL 0
    END
    'POSL'
    IF OVER
    THEN
      STO+
    ELSE
      STO
    END
    POSL DROP
    DISPL
  \>>

  CURR
  \<< 
    NOTEL POSL
    GET DISPL
  \>>

  repl
  \<<
    NOTEL POSL
    ROT PUT DUP 'NOTEL'
    STO POSL GET DISPL
  \>>

  EDIT
  \<<
    NOTEL POSL
    GET
  \>>

  ADDL
  \<<
    NOTEL SWAP +
    'NOTEL' STO
    NOTEL SIZE 'POSL' STO
    CURR
  \>>

  DEL
  \<<
    NOTEL 1 POSL
    1 - SUB NOTEL POSL
    1 + OVER SIZE SUB +
    'NOTEL' STO
  \>>

  prev
  \<<
    POSL 1 - DUP
    IF 1 <
    THEN
      DROP NOTEL SIZE
    END DUP
    'POSL' STO NOTEL
    SWAP GET DISPL
  \>>

  next
  \<<
    NOTEL DUP
    SIZE POSL 1 + DUP 3
    PICK
    IF >
    THEN DROP 1 END
    DUP
    'POSL' STO SWAP
    DROP GET DISPL
  \>>

  DISPL
  \<<
    CLLCD 1 DISP
    3 FREEZE
  \>>

  CRDB
  \<<
    CLEAR
    "Enter name: " ""
    INPUT DUP
    \-> N
    \<<
      UPDIR
      N "\<< UPDIR "
      N OBJ\-> "\>>" + +
      OBJ\->
      2 \->LIST
      1 \->LIST
      BASME SWAP + 'BASME' STO
    \>>
    OBJ\-> DUP
    CRDIR EVAL
    { "DUMMY" } 1 ""
    'OBJL' STO
    'POSL' STO
    'NOTEL' STO
    CURR
  \>>

  CST
  { prev next CURR { "FIND" \<< FINME TMENU CURR \>> }
                   { "ADD"  \<< ADDME TMENU CURR \>> }
		   { "EDIT" \<< EDIME TMENU CURR \>> }

                   { "BASES" \<< BASME TMENU \>> }
                   { "" \<< \>> }
                   { "" \<< \>> }
                   { "" \<< \>> }
                   { "" \<< \>> }
                   { "QUIT"  \<< "QUIT selected. Popping
back to old dir"
                                  1 DISP 1 FREEZE
                                  DBP EVAL
                              \>> }
  }

  FINME
  { FIND cont { "EDIT" \<< EDIME TMENU CURR \>> }
              { "" \<< \>> }
              { "" \<< \>> }
              { "TOP"  \<< 1 MENU CURR \>> }
  }

  ADDME
  { ADD ADDL CRDB { "EDIT" \<< EDIME TMENU CURR \>> }
                  { "FIND" \<< FINME TMENU CURR \>> }
                  { "TOP"  \<< 1 MENU CURR \>> }
  }

  EDIME
  { EDIT repl DEL { "ADD"  \<< ADDME TMENU CURR \>> }
                  { "FIND" \<< FINME TMENU CURR \>> }
                  { "TOP"  \<< 1 MENU CURR \>> }
  }

  BASME
  {
    { "EMAIL" \<< UPDIR EMAIL 1 MENU \>> }
    { "NOTES" \<< UPDIR EMAIL 1 MENU \>> }
    { "PHONE" \<< UPDIR PHONE 1 MENU \>> }
    { "FTP"   \<< UPDIR FTP   1 MENU \>> }
  }

  NOTES
    DIR
      NOTEL { "DUMMY" }
      POSL 1
      OBJL ""
    END
END
--
Programming isn't a science,         | EMAIL: howard@lage.lysator.liu.se
it's an art.                         |        howard@lysator.liu.se
Why is it called common sense,       |        Martin_Howard.d89.lith@xns.liu.se
when so few possess it ?             |


