Displaying A Binary Integer; Pad (Pad With Leading Spaces) - HP -28S Manual

Advanced scientific calculator
Hide thumbs Also See for HP-28S:
Table of Contents

Advertisement

Displaying a Binary Integer
This section contains three programs:
• PAD is a utility program that converts an object to a string for
right-justified display.
• PRESERVE is a utility program for use in programs that change the
calculator's status (angle mode, binary base, and so on).
• BDISP displays a binary integer in HEX, DEC, OCT, and BIN bases.
It
calls PAD to show the displayed numbers right-justified, and it
calls PRESERVE to preserve the binary base.
PAD (Pad With Leading Spaces)
Convert an object to a string and, if the string contains fewer than 23
characters, add spaces to the beginning.
When a short string is displayed by using DISP, it appears
left-justi-
fied:
its first character appears at the left end of the display. The
position of the last character is determined by the length of the string.
By adding spaces to the beginning of a short string, PAD moves the
position of the last character to the right. When the string is 23 char-
acters long, it appears
right-justified:
its last character appears at the
right end of the display.
PAD has no effect on strings that are longer than 22 characters.
Arguments
Results
1 : object
1 :
"
object"
Techniques:
• WHILE ... REPEAT ... END (indefinite loop). The WHILE clause
contains a test that determines whether to execute the REPEAT
clause and test again (if true) or to skip the REPEAT clause and exit
(if false).
28: Programming Examples
257

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents