HP Forums
(49G) ISBN Check Character - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (49G) ISBN Check Character (/thread-4024.html)



(49G) ISBN Check Character - Gerald H - 05-30-2015 01:16 PM

The programme takes a nine digit string from the stack & returns the original string & the ISBN check character.

eg for input

"019530818"

the programme returns

"019530818"
2

Code:
::
  CK1&Dispatch
  BINT3
  ::
    DUPLEN$
    BINT9
    #=
    NcaseSIZEERR
    BINT0
    BINT10
    ONE_DO
    OVER
    ISTOP-INDEX
    SUB$1#
    BINT48
    #-
    INDEX@
    #1+
    #*
    #+
    LOOP
    BINT11
    #/
    DROP
    DUP#0=csedrp
    Z0_
    BINT11
    SWAP#-
    BINT10
    #=casedrop
    'IDX
    FPTR2 ^#>Z
  ;
;