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
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.
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.
Surely "ABCDEF" 1 ->GROB NEG is easier?
Regards,
Mark.
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
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
> 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
> 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]
> 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]
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