Post Reply 
Conversion from CASIO-basic to RPL
09-04-2017, 06:37 PM
Post: #5
RE: Conversion from CASIO-basic to RPL
Here's a "proof of concept" of the approach I described above. It's a directory containing several separate programs, and you start the app by executing "GOBV".

The first time it runs, it creates a GROB for the display. Subsequent runs will use the existing one that gets stored in the directory.

The menu keys simply cause a random number to be displayed beside the appropriate category in the list.

I'm not suggesting that this is necessarily the best approach, but I thought an example would be better than me simply describing it.

Code:
DIR

GOBV
\<<
  2 FIX
  IFERR 'BVDISP' RCL THEN DROP NEWDISP END
  PICT STO

  {
    { "Vege" Vege }
    { "Meat" Meat }
    { "Misc" Misc }
    { "Dairy" Dairy }
    { "Clean" Clean }
    { "EXIT" ExitApp }
  } TMENU

  REFDISP
\>>

NEWDISP
\<<
  ERASE
  { #82d #0 } { #82d #72d } LINE
  { #0 #7d } { #82d #7d } LINE
  { #0 #47d } { #82d #47d } LINE
  { #82d #39d } { #131d #39d } LINE

  PICT { #0 #0 } "Last" 1 \->GROB REPL
  PICT { #30d #0 } 0 RJnum REPL

  PICT { #0 #9d } "Veges" 1 \->GROB REPL
  PICT { #0 #17d } "Meat" 1 \->GROB REPL
  PICT { #0 #25d } "Misc" 1 \->GROB REPL
  PICT { #0 #33d } "Dairy" 1 \->GROB REPL
  PICT { #0 #41d } "Clean" 1 \->GROB REPL

  PICT { #0 #50d } "Grand Total" 1 \->GROB REPL
  PICT { #30d #58d } 0 RJnum REPL

  PICT { #85d #0 } "P" 1 \->GROB REPL
  PICT { #85d #8d } "Q" 1 \->GROB REPL
  PICT { #85d #16d } "R" 1 \->GROB REPL
  PICT { #85d #24d } "S" 1 \->GROB REPL
  PICT { #85d #32d } "T" 1 \->GROB REPL

  PICT { #85d #41d } "I% 15.00" 1 \->GROB REPL
  PICT { #85d #49d } "Tax 0.00" 1 \->GROB REPL

  PICT RCL DUP 'BVDISP' STO
\>>

REFDISP
\<<
  {#0 #0} PVIEW 3 FREEZE
  PICT RCL 'BVDISP' STO
\>>

Vege
\<<
  PICT { #30d #9d } RAND 25 * 2 RND RJnum REPL
  REFDISP
\>>

Meat
\<<
  PICT { #30d #17d } RAND 50 * 2 RND RJnum REPL
  REFDISP
\>>

Misc
\<<
  PICT { #30d #25d } RAND 200 * 2 RND RJnum REPL
  REFDISP
\>>

Dairy
\<<
  PICT { #30d #33d } RAND 10 * 2 RND RJnum REPL
  REFDISP
\>>

Clean
\<<
  PICT { #30d #41d } RAND 30 * 2 RND RJnum REPL
  REFDISP
\>>

RJnum
\<<
  #50d #6d BLANK
  SWAP \->STR 1 \->GROB DUP SIZE DROP
  #50d SWAP - #0 2 \->LIST SWAP REPL
\>>

ExitApp
\<<
  2 MENU
\>>

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


Messages In This Thread
RE: Conversion from CASIO-basic to RPL - DavidM - 09-04-2017 06:37 PM



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