Post Reply 
HP-41 ExFunctions SEEKPT and SEEKPTA
04-27-2015, 06:52 PM (This post was last modified: 04-27-2015 07:07 PM by Dieter.)
Post: #2
RE: HP-41 ExFunctions SEEKPT and SEEKPTA
(04-27-2015 03:54 PM)4ster Wrote:  I don't fully understand how SEEKPT and SEEKPTA works in a program.

They work the same as in run mode.

(04-27-2015 03:54 PM)4ster Wrote:  I've got a program that works sometimes, but often it doesn't. My 41CV has an Extended Functions/Memory module and I have an HP-IL printer attached.
...
I place the name of the data file in the Alpha register

...but the program does not do anything with that file name.

You are using SEEKPT to place the file pointer to a specific position of the current working file. Not the file you entered in Alpha – that file name is completeley ignored and there is not a single command in your program that makes the calculator access that particular file. It's always the file that happens to be the current working file. So it's no wonder you get a FL TYPE ERR.

There also is no need to set the pointer to the next value in every loop. GETX reads a value from a X-Memory data file and automatically advances the pointer to the next one. So GETX GETX GETX will read three consecutive values.

You may try this one:

Code:
01 LBL "XDATA"
02 SF 21
03 SEEKPTA  // Set pointer to record# in file specified in Alpha
04 LBL 01   // This way it becomes the working file
05 FIX 0
06 INT      // now record# moves to LastX
07 ACX
08 " : "
09 ACA
10 GETX     // get next value from file
11 FIX 3
12 ACX
13 PRBUF
14 LastX    // recall pointer from LastX
15 ISG X
16 GTO 01
17 END

Cave – this is completely untested code, and I have no printer for my 41.

The basic idea is this: SEEKPTA (or RCLPTA) makes the file specified in Alpha the working file. All following operations then can be done with SEEKPT (or RCLPT). Until you want to access another file which then again is made the working file by another SEEKPTA or RCLPTA.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-41 ExFunctions SEEKPT and SEEKPTA - Dieter - 04-27-2015 06:52 PM



User(s) browsing this thread: 1 Guest(s)