HP Forums

Full Version: (49G) ISBN Check Character
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
  ;
;
Reference URL's