HP48 program improvement. . .
#1

Hi, HP48 users!

I have a remote control program that includes a
lot of questions in this type of form:

j 6 == i 1 == AND IF THEN 7 'k' STO END
j 12 == i 23 == AND IF THEN 8 'k' STO END
j 17 == i 45 == AND IF THEN 9 'k' STO END
j 56 == i 67 == AND IF THEN 10 'k' STO END
j 34 == i 89 == AND IF THEN 11 'k' STO END
j 37 == i 111 == AND IF THEN 12 'k' STO END
.
.
.
.

I would appreciate it if you could convert these
questions so they will operate faster.

Best regards,
Tal

#2

Hello;

It seems, in a first look, a CASE...THEN... END structure would fit better. If you have problems implementing, send me an e-mail.

Cheers.

#3

Tal,

Assuming the local variables i and j are set elsewhere, the following code works. The original code has no default value or action if an i & j pair is not found, or if neither value is not within the tested values.

{ 7 8 9 10 11 12 }
{ 6 12 17 56 34 37 } j POS
{ 1 23 45 67 89 111 } i POS
OVER == OVER 0 /= AND
IF
THEN GET
ELSE DROP@
END

This simplifies the code, I'm not sure about the speed. The =/ above is the HP48 not equal test.

Joe



Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,616 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  ANN: A MacOSX Kermit program for HP48/49/50 calculators Paul Onions 2 1,564 09-08-2013, 04:55 AM
Last Post: Paul Onions
  A suggestion for easy improvement of the HP17bII+ Jose Gonzalez Divasson 1 900 07-10-2011, 10:38 AM
Last Post: Tim Wessman
  HP-41 MCODE: Making an MCODE program call another MCODE program Geir Isene 10 2,772 01-13-2008, 05:58 AM
Last Post: Raymond Del Tondo
  For those saying that 35s screen is an improvement over 33s romeo_charlie 25 4,711 09-28-2007, 09:33 AM
Last Post: Chris Haltiner
  HP48 Program Development Link and Proper Fonts Les Wright 4 1,402 05-12-2006, 11:33 AM
Last Post: Les Wright
  Improvement on HP-45. r. d. bärtschiger. 13 2,983 09-25-2003, 06:45 PM
Last Post: dbrunell
  "NUM LOCK" program for the HP48... tal 0 730 04-09-2000, 05:32 AM
Last Post: Tal
  HP48 PROGRAM tal 0 592 03-28-2000, 06:41 AM
Last Post: Tal
  HP48 - PROGRAM HELP tal 0 627 03-26-2000, 03:21 AM
Last Post: Tal

Forum Jump: