The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Hp 50g, SDLIB, SDFiler and moving HPDIR on the SD
09-04-2017, 07:43 PM (This post was last modified: 09-04-2017 07:43 PM by pier4r.)
Post: #1
Hp 50g, SDLIB, SDFiler and moving HPDIR on the SD
I am doing data collection with the 50g since almost 90 days now. I am slowly realizing a project I always want to do but being too lazy to implement it until David started his ListExt library that convinced me to use the 50g plus lists to collect data. The final idea is in the same category of the one exposed in this article. I hope I'll write a topic about it.

Anyway for the moment I just collect data. The process is enough to expand my knowledge of the hp 50g, its built in functions, third party programs and possible limits.

For example I employ shortcuts that I read in a post in this General forum (surely they were known before, but the earliest record in my mind is a forum post in this new forum): "right shift + var_name on the soft menu" to recall the content of a variable, modify those, "left shift + var_name on the soft menu" to store the modified content back in the variable.

Of course, since there is little input check, I may, by mistake, save the content of a variable in another. Therefore I do a daily backup (plus recall of the backup, one has to check if the backups are all fine!).

I tried a backup program employing SDLIB, but while saving the HPDIR works, moving the file on the SD or recalling it sometimes hangs the calculator. I'll have to check if I can fix it with multiple calls to Xreset.

The workaround so far is to use a program to store the HPDIR with built-in calculator commands. The following is the current version of this program:

Code:

\<<
    @in input one puts a string with the time like "201708201116"
    @then the STO command is going to save the LIFEG directory
    @ (one executes the program within the directory)
    @with the name LGB201708201116
    @but while STO puts the entire name, only the first 8(?) letters
    @are important for it. So often there is a conflict with
    @existing files
    @and we need a workaround.
    
    "" "filenameStr" DROP
    
    \->
    @input
    inputStr
    @local var
    filenameStr
    
    \<<
      @check input
      IF
        inputStr TYPE 2 \=/
      THEN
        "argument as string please"
        DOERR
      END
      
      @save all the variables for later comparisons with the backup
      {HOME LIFEG} EVAL
        @move in the directory
        
      @clean up 'allvars' from the existing list
      @it is needed a "delete" command actually from a list, so it can be safer
      IFERR
        'allListVars' PURGE
      THEN
        "var likely does not exist" DROP
          
        @drop the commands if last argument is enabled.
        IF
          -55 FC?
        THEN
          DROP
        END
      END
        
      5 TVARS  @collect all the lists
      'allListVars' STO
        @global var
        
      
      
      
      inputStr
      @generate a random number with 4 digits
      10000 RAND * IP
      DUP 
      9000 <
        @returns 0 or 1
      1000 * +
        @add 1000 to the number only if that is lower than 9000
      R\->I
        @no trailing points
      \->STR  
      "LGB" + 
        @we have nnnnLGB
        @that can be cleaned later.
      SWAP + 
      @3. \->TAG 
      'filenameStr' STO
        @lesson learned, it seems that tags are not saved in variables
      
      UPDIR 'LIFEG' RCL 
      filenameStr 
      3. \->TAG 
      STO
      
      filenameStr 
      3. \->TAG 
      RCL 
        @check the result after storing.
    \>>
  \>>

This works very well so far, and generates a file called:
<4randomDigits>LGB2017MMDDHHMM
on the main root of the SD.

Then with SDfiler I first rename the saved file, getting only "LGB2017MMDDHHMM" then I move (or copy when I want to feel safe) it in a directory called LIFEGBACKUP .

Since a couple of days, though, the HPDIR object resulting by the move or copy of the original file is a file that is readable but has less data.

What I mean is, for example, the original HPDIR saved on the SD has a list holding days from mid June to September (this list is still there if I recall the object on the stack). The copied/moved HPDIR has days until the early August, when I recall it on the stack. So it is like the object is trucated.
Therefore I may do backups but the actual data is lost.

Does anyone know why or know a workaround?
Another side problem is that the SDfiler not always shows all the files/subfolders in a folder if those are many (say: 40+). Sometimes I have to open the folder a couple of times to see all content.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Hp 50g, SDLIB, SDFiler and moving HPDIR on the SD - pier4r - 09-04-2017 07:43 PM



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