Personal record keeping

From Ninerpedia
Revision as of 19:52, 8 October 2014 by Stephen Shaw (talk | contribs) (DEFINE CALL P)
Jump to navigation Jump to search

The Personal Record Keeping (PRK) module enables you to store up to about 10k of data, and provides various handling and output facilities to help you manipulate your records.

A printer is useful but not essential. If you have a printer, greater flexibility of display, as well as additional functions, are provided with the Personal Report Generator module, which requires data prepared with the Personal Record Keeping module.

The PRK sorting routines are slow.

Data is saved in memory image ('program') format, and thus uses less tape (or disk) space, is faster to save and load, and the verify option is available for tape files.

You will not be able to catalog a collection of six thousand records, but small collections can be catalogued with the module . The number of items depends on how many characters you wish to use to describe each item.

It is possible to use the PRK module as a simple diary system, or as a very simple spreadsheet, as it is possible to perform mathematical operations on the data you place in your module.

Enhanced Basic

The Personal Record Keeping and the Statistics modules both extend the range of commands available in TI BASIC. This was not publicised. The term Enhanced Basic was given by Peter Brooks who published a great deal on the extra CALLs.

These extra commands are the only way in which a user can save data in PROGRAM format - used by most TI Modules. Program format permits tape verification, and uses a lot less space on your tape or disk.

With either module inserted, select TI BASIC. You may now use the following commands:

Screen Display CALL D

CALL D(R,C,L,V)

Where R and C are the row and column the word is to start at.
L is the length of screen to be blanked from position
R,C and also sets the maximum length of the display
V is a value or string or variable to be displayed.

If V is longer than L, the display will be curtailed.
R,C and L may be numbers or numeric variables.

Try:
CALL D(10,4,5,1/3)        

Input of data by user CALL A

CALL A(R,C,L,F,A,MN,MX)

R,C and L are as with CALL D, but in CALL A, L sets the
maximum length of the input.
F   MUST   be a NUMERIC VARIABLE. It takes a value of 1 if
ENTER is pressed, and other values if some control keys are used
eg BEGIN:6  REDO:4  AID:3  BACK:7  CLEAR:2
A is the numeric or string VARIABLE to be filled with the
input.
MN and MX are optional when using a numeric variable, and set
the minimum and maximum acceptable values: any input outside
these values is rejected.
      

NB: The CLEAR key is used to clear the input field. It WILL NOT break into the program! Use CALL A with a little care if you think you may need to BREAK the program!


Partition Memory CALL P

CALL P(N) - Partition

This CALL is required if we wish to interact in Basic with a PRK data file loaded into memory. It is not required if you just want to use CALL A or CALL D.

We have to reserve memory to place the PRK data into - it was saved as a memory block and must be loaded as a memory block. Using CALL P splits the memory so that the PRK data can reside safely on its own, and the remainder of memory can be used as normal for our Basic program.

In order to prepare or partition the RAM memory space in two sections the statement CALL P(N) has to be entered in the immediate mode as a first action after the TI BASIC READY prompt from the computer and must be followed by NEW.

Here for convenience we shall use MEM1 (normal RAM) and MEM2 (PRK file memory).

CALL P(N) use as N a number (constant) (an integer between -4 and 13821) which points to the spot in the RAM stack where OLD will start loading a BASIC program instead of what otherwise would have been the starting address reserved for OLD.


The memory space below this point is the thus created MEM2 and consists of N bytes to be used for PRK data.

normal memory:          PARTITIONED MEMORY:
 +-------------+        +----------------+  
 |              |        |                  | 
 |     usual    |        |  MEM1 (basic)   | 
 |     RAM      |        |  16000-N         | 
 |              |        |   bytes          | 
 |    16000     |  -N-  |-----------------| 
 |    bytes     |        | MEM2 (prk data) |     
 |              |        |  N bytes        | 
 +-------------+        +----------------+ 

If you need a large MEM2 (e.g. because a large PRK file has to be loaded) then N must he in the higher range. This obviously at the same time restricts the size of MEM1 for your Basic program.

If on the other hand you have a large TI Basic program or need to load a lot of "normal" data, but still you want to interact with a PRK file as well, then you are best off with a large MEM1 and a small MEM2 when in the CALL P(N) statement you assign a low value to N.

MEM1 is cleared and loaded with programs and data in the usual way with NEW, OLD, SAVE, INPUT and PRINT without affecting MEM2 in any way. PRK data are loaded in MEM2 with the statement:

CALL L("CS1",C) 
(or CALL L("DSK1.FILE",C))

resulting in the usual cassette prompts which will now read data previously generated by the PRK module in its normal mode.

An error message: ERROR DETECTED IN DATA may mean that MEM2 is not large enough to contain the PRK data and a new CALL P(N) with a higher N must be entered (and followed by NEW). The quickest and surest way to remove the previous CALL P is to switch the console off and on again.

Save Memory Image CALL S

CALL S

Load Memory Image CALL L

CALL L

Define Data Header CALL H

CALL H

Data field handling CALL G

CALL G

Transferring PRK data to a Display Variable disk file for TI Writer

This BASIC program requires a Personal Record Keeping module and a disk drive with disk controller.

Console set up:

Insert PRK module and then select TI BASIC (Stats module may also be used)
FIRST: Is disk drive connected? Set buffer location with CALL FILES(1) then NEW -
THEN: type CALL P(10900) then type NEW
Console memory is now set up

RESTRICTIONS:

The disk system and this program use up memory.

It may be necessary to delete some records from the PRK file to be transferred if the PRK file fully utilises system memory.


99 REM Load the PRK file
100 CALL L("DSK1.PRKFILE",Y)
102 REM is file loaded?
110 IF Y=0 THEN 320
111 REM NOW open output file
112 REM NB: do not open output file until after Call L !
120 OPEN #1:“DSK1.TIH_FILE“,DISPLAY,VARIABLE 80
121 REM How many fields in each record?
130 CALL H(1,5,0,F)
140 PRINT "FIELDS":F
141 REM How many records (pages)?
150 CALL H(1,6,0,R)
160 PRINT "RECORDS":R
161 REM Now loop: through each record:
170 FOR J=1 T0 R
171 REM and through each field in turn
180 FOR T=1 TO F
181 REM Is the field a number or a string?
190 CALL H(1,10,T,TP)
200 IF TP=1 THEN 240
201 REM for numeric data:
202 REM get the data in record J,. field T
210 CALL B(1,J,T,Z,RD)
211 REM and print it to disk
220 PRINT #1:RD 
230 GOTO 270
231 REM for string variable data:
240 CALL G(1,J,T,Z,RD$)
250 PRINT J;T;RD$
260 PRINT #1:RD$
270 NEXT T
271 REM insert spacing as required
280 PRINT #1:" "::: 
290 NEXT J
300 CLOSE #1
310 END
320 PRINT "NOT LOADED“

If required, string and numeric data can be concatenated to the preferred format before printing to disk. Read each required field, concatenate, and print.

Each print to disk should be considered as one TI Writer line:

Use of pending outputs is to be avoided, as is the use of a semi colon print divider, due to the complex requirements of DISPLAY format.