Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DISPXY along with INPUT

33 views
Skip to first unread message

Gurveer

unread,
Oct 21, 2009, 1:02:54 AM10/21/09
to
Hi

I have a string on stack containing some text say "ABCDEF". I want to
invert the graphics. So, the inverted graphic will have it's
background as black colored and the text itself in white. How can I do
that(in a program)? And once I'm done with that, I want it to appear
at a particular coordiantes on the screen using DISPXY (because I want
the string to be in minifont) but with the INPUT command line active.
In other words, when I'm entering the data in, I should be prompted
for by that string which should not disappear until I hit enter. User
RPL is preferred but SysRPL is ok as well. Thanks a lot for any help
you provide.

Gurveer

Yann

unread,
Oct 21, 2009, 4:34:22 AM10/21/09
to
> I have a string on stack containing some text say "ABCDEF". I want to
> invert the graphics. So, the inverted graphic will have it's
> background as black colored and the text itself in white. How can I do
> that(in a program)?

SysRPL ==>
#2609Eh : INVGROB ( grob > grob’ )
Inverts grob data bits. Bang type.


> And once I'm done with that, I want it to appear
> at a particular coordiantes on the screen using DISPXY (because I want
> the string to be in minifont)

SysRPL =>
#25F0Eh : XYGROBDISP ( #x #y grob > )
Stores grob in HARDBUFF with upper left corner
at (#x,#y). HARDBUFF is expanded if necessary.

Note 1 : #x and #y are BINT type
Note 2 : not sure if it remains visible while INPUT is active.
My guess is that the header part of the screen is not refreshed.
So if you put your grob there, it should remain while INPUT is active.

Virgil

unread,
Oct 21, 2009, 4:47:49 AM10/21/09
to
In article
<d248e03a-5b99-402a...@x5g2000prf.googlegroups.com>,
Gurveer <gurve...@gmail.com> wrote:

To get a string, or substring of a longer string, to display in bold,
italic, underline or REVERSE, or some combination thereof, one must
enclose the desired stringlet between two 3-character strings, one pair
of such strings for each desired of 4 possible modifications.

The first and last character of both of these 3-character strings is
character 19 regardless of which display you want.

The center character of both enclosing strings is
character 1 for bold,
character 2 for italic,
character 3 for underline, and
character 4 for REVERSE.

What you seem to be asking for is the REVERSE display, a bright letter
on a dark background, so you want the last option above.

So supposing your string is on the stack and you are in RPN mode then
the following series of steps will modify it to display in REVERSE:
19 CHR 4 CHR + 19 CHR + SWAP OVER + +

If you want both bold and reverse , you would need to wrap your
stringlet with both something like
19 CHR 4 CHR OVER + + SWAP OVER + +
and something like
19 CHR 1 CHR OVER + + SWAP OVER + +

Hope this helps.

Mark Power

unread,
Oct 21, 2009, 2:18:58 PM10/21/09
to
Yann wrote:
>
> SysRPL ==>
> #2609Eh : INVGROB ( grob > grob� )

> Inverts grob data bits. Bang type.


Surely "ABCDEF" 1 ->GROB NEG is easier?


Regards,
Mark.

Gurveer

unread,
Oct 22, 2009, 1:17:01 AM10/22/09
to
Thanks a lot for the feedback. That's exactly what I was trying to do.
But half of the problem still exists. I was thinking about using
DISPXY to display that string in a minifont. I think it would work as
well if there's a way to shrink the contents of string to minifont but
the object type still being string, not a grob.(Of course not changing
the system font to minifont which would make everything appear in
minifont). This would help as I could directly use this string as an
argument for INPUT command.

And yeah, I did mean to display the string in REVERSE. Sorry about
that! Didn't know that's what it is called. Thank you for correcting
me. But just wondering, where did you read the documentation about
those bold, italic, etc. characters?

Gurveer

Jacob Wall

unread,
Oct 22, 2009, 1:30:32 AM10/22/09
to
Hello,

To really customize an INPUT type of interface, you can create a POL
(parameterized outer loop) environment that will be capable of exactly
what you like. There is a great series of articles at
http://www.hpcalc.org/details.php?id=5432 that can give you the
general structure of how to start going about it. After the ground
work is in place, you're free to customize as you like! Also, with
the POL route, there's tons of other things you can implement that you
could never do with INPUT.

Jacob

Andreas Möller

unread,
Oct 22, 2009, 4:04:23 AM10/22/09
to
Hello,

> To really customize an INPUT type of interface,
> you can create a POL

as you might know INPUT is in fact a POL.

> where did you read the documentation about
> those bold, italic, etc. characters?

This is very briefly explaind in the Machine Language entry point
DISPLAY_SBR.

Use the characters
19,1,19 BOLD 19,1,19
19,2,19 ITALIC 19,2,19
19,3,19 UNDERLINED 19,3,19
19,4,19 INVERTED 19,4,19
around your string in SYS-RPL

HTH,
Andreas
http://www.software49g.gmxhome.de

John H Meyers

unread,
Oct 22, 2009, 2:02:30 PM10/22/09
to
On Thu, 22 Oct 2009 00:17:01 -0500, Gurveer wrote:

> where did you read the documentation
> about those bold, italic, etc. characters?

See "The Style sub-menu" (of the built-in editor),
near page 857 of the HP50G User's Guide.

While editing a string, for example,
after NXT NXT [Style] to enter that menu,
you could press the following keys
(menu keys and "Alpha" letters):

[Bol] B [Bol]
[Itali] I [Itali]
[Unde] U [Unde]
[Inv] R [Inv]

Completing the edit, you now see displayed
each letter, with its corresponding effect.

You could now directly make a "grob" (image)
for that string, using

1 \->GROB @ minifont
or
2 \->GROB @ current "stack" font

You could also, to analyze the string in detail,
do DUP HEAD SWAP TAIL
to obtain each individual character in turn,
and NUM to get the numeric value of any character,
or use this complete program to "explode" an entire string
into a list of individual characters, with numeric values
for any low-end characters:

\<< DUP \-> s \<< 1 s SIZE FOR n
s n DUP SUB NUM DUP 31 > { CHR } IFT
NEXT s SIZE \->LIST \>> \>>

My result is:

{
19. 1. 19. "B" 19. 1. 19. @ [Bol] B [Bol]
19. 2. 19. "I" 19. 2. 19. @ [Itali] I [Itali]
19. 3. 19. "U" 19. 3. 19. @ [Unde] U [Unde]
19. 4. 19. "R" 19. 4. 19. @ [Inv] R [Inv]
}

And there you have the rest of the documentation :)

[r->] [OFF]

John H Meyers

unread,
Oct 22, 2009, 7:38:29 PM10/22/09
to
On Wed, 21 Oct 2009 13:18:58 -0500, Mark Power wrote:

> Surely "ABCDEF" 1 ->GROB NEG is easier?

That's certainly the easiest way
to make an "inverse/reverse" minifont grob from text,
and works as well on all HP48/49/50.

No need for "style" codes in text
when entire style is "inverse/reverse,"
and when desired end product is a grob,
with no other use for a "styled text" string itself.

One can, however, use a "styled text" string directly
as an argument for PROMPT and INPUT commands, if desired.

Such a string will remain displayed during editing via INPUT,
until that line is needed to scroll up what is being entered,
and will also remain during command-line entry after PROMPT,
no matter how many lines are entered.

In those cases, prompt text will be displayed
in the current stack font; however, if the stack font
is set to "small" (minifont) and the editor font to normal
(see flags -72 and -73), then this pretty closely accomplishes
everything originally desired, all in straightforward UserRPL!

[r->] [OFF]

Gurveer

unread,
Oct 22, 2009, 8:13:41 PM10/22/09
to
That's freaking awesome! Exactly what I wanted to do. Thanks a lot.
And yeah, I look forward to learn POL in System RPL too. I went
through a few examples from the Queensland surveyors' documents. A
really good place to start with.

Now I know the significance of those big dot kinda characters . I knew
that I can type them in the editor but was unaware of how it worked in
RPL.

Thanks once again.

Regards,

Gurveer

0 new messages