Post Reply 
50G - L-Shift STO secure.
11-17-2020, 12:02 PM
Post: #1
50G - L-Shift STO secure.
HP-50g dangerous L-Shift STO shortcut
Hi,guys

Back to school, I'm back to 50g too. Great machine!

Well, creating some programs for working with LaPlace, I accidentally rewrite an important program in a variable, using the L-shift soft var key.

It is a great short cut for STO key, but it is very dangerous!

After that incident, I searched for some LIB that makes L-shift STO more secure to use.
I could find only one lib, but it worked in a different manner of what I would like.

So, here my results: when you use the shortcut to store values in variables, if these variables contains programs, lists, array, etc, it will be asked a confirmation before replacing the variable.

In next versions, I'll try to make a variable backup before updating the var.


SSTO version with backup - the main routine. It will be applyed to STO key itself and to softmenu keys when l-shif pressed (short cut for STO):

<<
RCLMENU
--> o n m
<< {-1 0 1 10 28}
n VTYPE POS
0 > //zero!
<< o n STO>>
<< m o n CLLCD n
->STR " is:" + 1 DISP
n RCL ->STR 2 DISP //here I need to use smallest font!
3 FREEZE
{
{ "BKP" //if you don't want the possibility of bakup, remove this internal list
<< DUP DUP RCL SWAP "SSTOBK/" SWAP +
3 ->TAG
IFERR STO
THEN DUP PURGE STO
END STO MENU>>
} //if you don't want the possibility of bakup, remove this internal list up to here
{ "Y" << STO MENU>>}
{ "N" << ROT MENU >>} //in next versions, add BKP function.
} TMENU
>>
IFTE
>>
>>

This version with backup will show a menu asking: BKP Y N on softkeys.
If you choose BKP, it will save the actual content of variable in SD Card (port 3), under SSTOBK menu, and then save the new data over actual variable. Only one copy will exist, ok?

KSTO - the program that makes assigments to top keys, STO, VAR, CONVERT and UNITS (these last two because they have shortcuts too in the form of l-shift or r-shift soft menu).
Please, see if your 50g menu codes for CONVERT and UNITS confere with the ones listed bellow.


<<
<< SSTO >> 32 ASN //the STO key
<< KDEL 131.01 MENU >> 84.2 ASN //the CONVERT l-shift 6
<< KDEL 42.01 MENU >> 84.3 ASN //the UNITS r-shift 6
<< 1 6
FOR a
"<<a KSTO1>>" "a" a ->STR SREPL DROP
OBJ-> a 10.2 +
NEXT
12 ->LIST STOKEYS
2.01 MENU
>> 31 ASN
>>


KDEL - the subroutine that clears the key assigments
<<
1 6 FOR I
10.2 I +
NEXT
6 ->LIST DELKEYS
>>

KSTO1 - subroutine that adjusts the pages of vars menus
<<
VARS SWAP RCLMENU
FP 100 * 1 -
6 * + GET
SSTO
>>

You need to run the KSTO and put the calculator in USR mode, permanently.
Any better ideas will be appreciated!
Best wishes
Artur - Brazil

ARTUR MARIO JUNIOR
BRAZIL
Find all posts by this user
Quote this message in a reply
Post Reply 




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