HP Forums
HP41CX - Naive' question - "Current File" - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP41CX - Naive' question - "Current File" (/thread-19303.html)



HP41CX - Naive' question - "Current File" - TomC - 12-16-2022 04:42 PM

Hi:

In working with the Extended Memory in the HP41CX, there are references to the 'current file'.

How does one ensure that there is not a current file selected/enabled?

I have studied both Vol1 and Vol2 manuals and the only reference I see to 'no current file' is after a 'PURFL' command is executed.

On a related question - how does one query the machine for what is the 'current file'.

Thank you,
TomC


RE: HP41CX - Naive' question - "Current File" - Sylvain Cote - 12-16-2022 07:00 PM

To my knowledge, the CX nor the XF module have a function that returns the current/working XM file.
Some of Ángel modules adds the WORKFL function that does what you are searching for.
See: (XMTW) XMEM Twin Manual or (XMXF) XMEM X-Functions Manual.


RE: HP41CX - Naive' question - "Current File" - TomC - 12-16-2022 07:56 PM

Thank you Sylvain!!!

Happy Holidays!!!

TomC

(12-16-2022 07:00 PM)Sylvain Cote Wrote:  To my knowledge, the CX nor the XF module have a function that returns the current/working XM file.
Some of Ángel modules adds the WORKFL function that does what you are searching for.
See: (XMTW) XMEM Twin Manual or (XMXF) XMEM X-Functions Manual.



RE: HP41CX - Naive' question - "Current File" - rprosperi - 12-16-2022 09:09 PM

IIRC, using FLSIZE (or maybe GETSUB?) on a filename which does not exist sets the 'current file' to some undefined state (so probably close to what you're looking for) rather than falling back to the previously current file. At least this is easy to check...


RE: HP41CX - Naive' question - "Current File" - Gene - 12-16-2022 11:35 PM

NOTE: DO NOT use this code if your extended functions plug-in module is version 1B. This can be see by doing a CAT 2 when plugged into your HP-41.

If you have a version later than 1B, such as 1C, etc. OR if you are using an HP-41CX or DM-41, then the code below is safe.




If you use RCLPT and there is no working file, the message "FL NOT FOUND" is displayed.

In a program, this code:

LBL 01
SF 25
RCLPT
FS? 25
This step is executed if there is no current file.

Is that what you need ?

Gene


RE: HP41CX - Naive' question - "Current File" - J-F Garnier - 12-17-2022 09:33 AM

(12-16-2022 11:35 PM)Gene Wrote:  If you use RCLPT and there is no working file, the message "FL NOT FOUND" is displayed.

In a program, this code:

LBL 01
SF 25
RCLPT
FS? 25
This step is executed if there is no current file.

I'm surprised nobody seem to remember that it's dangerous to have no working file with the Extended Functions module 1B.
From the Ext-Fcn manual Addendum 82180-90026, April 82 (not on Eric's site, but can be found elsewhere ...):
"After a file in extended memory is purged, there is no working file.
[...] you should always define a working file before executing functions that operate on it;
otherwise, all files in extended memory will be lost".

The above code is risky.

J-F
(still using an Ext-Fcn 1B on my 41CV)


RE: HP41CX - Naive' question - "Current File" - rprosperi - 12-17-2022 01:14 PM

(12-17-2022 09:33 AM)J-F Garnier Wrote:  I'm surprised nobody seem to remember that it's dangerous to have no working file with the Extended Functions module 1B.
From the Ext-Fcn manual Addendum 82180-90026, April 82 (not on Eric's site, but can be found elsewhere ...):
"After a file in extended memory is purged, there is no working file.
[...] you should always define a working file before executing functions that operate on it;
otherwise, all files in extended memory will be lost".

Thanks J-F, I certainly did not recall this particular warning's effects, but it may be because of this effect that I recalled some functions can leave it undefined??

Was this bug fixed in the 1C version included in the CX, or did they simply add the warning into the User Manual (no longer requiring an addendum)?


RE: HP41CX - Naive' question - "Current File" - J-F Garnier - 12-17-2022 03:15 PM

I believe (but that I don't really remember) that it have been fixed in the revision 1C of the module for the 41C/CV, and so in the 2D revision of the 41CX X-F too.
This also applies to the other bugs of revision 1B, see the addendum, sorry I can't put a link due to TAR (That Archaic Rule).

The reason I remember so well the 1B bugs is that I was a bit disappointed when I bought the expensive X-F module at the time and discovered the addendum inserted with the manual. Such bugs for such an expensive module...

J-F


RE: HP41CX - Naive' question - "Current File" - Sylvain Cote - 12-17-2022 03:20 PM

(12-17-2022 01:14 PM)rprosperi Wrote:  Thanks J-F, I certainly did not recall this particular warning's effects, but it may be because of this effect that I recalled some functions can leave it undefined??
Was this bug fixed in the 1C version included in the CX, or did they simply add the warning into the User Manual (no longer requiring an addendum)?
Easy to test.

Validate that XM is empty
Code:
EMDIR         → "DIR EMPTY" 
              → 124.0000

Create a bunch of text files in XM
Code:
10
"ABC"
CRFLAS
"DEF"
CRFLAS
"XYZ"
CRFLAS

Validate that XM is not empty
Code:
EMDIR         → "ABC     A010"
              → "DEF     A010"
              → "XYZ     A010"
              → 88.0000

Select a XM file and add data to it
Code:
0
"DEF"
SEEKPTA
"AAAA"
APPREC

Delete a XM file and append a record without a XM selected file
Code:
"DEF"
PURFL
"BBBB"
APPREC        → "FL NOT FOUND"

Using a 41CV with XF 1B
Code:
EMDIR         → "DIR EMPTY"
              → 124.0000

Using a 41CX with XF 2D
Code:
EMDIR         → "ABC     A010"
              → "XYZ     A010"
              → 100.0000

Edit:

(12-17-2022 03:15 PM)J-F Garnier Wrote:  I believe (but that I don't really remember) that it have been fixed in the revision 1C of the module for the 41C/CV, and so in the 2D revision of the 41CX X-F too.
Unfortunately, I am not able to test the 1C, all my XFM modules are 1B (~10 modules).
Thank you Jean-François for reminding us of this bug and also why, as a rule, I was always using one of the SEEK function before using a XM data/text file.


RE: HP41CX - Naive' question - "Current File" - Sylvain Cote - 12-17-2022 03:33 PM

(12-16-2022 07:56 PM)TomC Wrote:  Thank you Sylvain!!!
Happy Holidays!!!
You are welcome, same to you. Happy Holidays!!! Smile


RE: HP41CX - Naive' question - "Current File" - J-F Garnier - 12-17-2022 03:49 PM

(12-17-2022 03:20 PM)Sylvain Cote Wrote:  Unfortunately, I am not able to test the 1C, all my XFM modules are 1B (~10 modules).

Really, something missing in your collection?
Smile

Edit: Actually, the revision 1A did exist too but is probably much harder to find.

J-F


RE: HP41CX - Naive' question - "Current File" - Sylvain Cote - 12-18-2022 02:41 PM

(12-17-2022 03:49 PM)J-F Garnier Wrote:  
(12-17-2022 03:20 PM)Sylvain Cote Wrote:  Unfortunately, I am not able to test the 1C, all my XFM modules are 1B (~10 modules).
Really, something missing in your collection?
Smile
Edit: Actually, the revision 1A did exist too but is probably much harder to find.
J-F
However hard I try, I have learned to live with the fact that my collection will never be complete. Wink
Sylvain