Post Reply 
Inout
02-05-2023, 11:36 PM
Post: #6
RE: Inout
(02-05-2023 05:22 PM)Gil Wrote:  Why with
"<B>" @ target
19. CHR 1. CHR OVER + + @ will be replaced by
SREPL DROP

is it that
what is between "<B>" and "<B>" is to be replaced
and not "<B>" itself (normally "abcdef" "bc" "BC" SREPL replaces the second string)?

I deduce THAT "aaaaa"
19. CHR 1. CHR OVER + + SREPL
is a special use of SREPL for replacing between the "aaaa".

There's no special case here. SREPL is simply doing what it always does.

A narrative description of the above code could be as follows:

The program starts with a string in stack level 1. It then replaces all occurrences of the substring "<B>" in that source string with the string created by "19. CHR 1. CHR OVER + +". The number of occurrences (left on the stack by SREPL) is dropped because it is not needed.

The code segment "19. CHR 1. CHR OVER + +" simply creates a string with three "characters" (whose ordinal values happen to be 19, 1, and 19). In this situation, those characters have no distinct graphical representation, so you can't see them. You can, however, see the effect they have on subsequent characters being drawn (whether to the display or to a GROB).

Those characters (19,1,19) tell the text-rendering software that's built into the 50g to toggle the current bold status (turn it on if it was off, or turn it off if it was on). That's why you see the same characters being used regardless of whether the style is being activated or deactivated. Note that this "style mode" only applies to the string as it is being drawn, and all styles are reset by the O/S to "off" as soon as the string being rendered is completed.

SREPL doesn't alter any characters other than the ones specified as the target.

The application of styles to text rendered on a display with limited resolution such as the 50g is always going to be of limited value (IMHO). While the 50g does the best it can with what it's got, it's inevitable that styled text will sometimes be difficult to read in certain situations. That's probably why you don't see many people taking advantage of it.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Inout - Gil - 01-30-2023, 02:42 PM
RE: Inout - DavidM - 02-04-2023, 02:29 PM
RE: Inout - Gil - 02-04-2023, 03:01 PM
RE: Inout - DavidM - 02-05-2023, 04:14 PM
RE: Inout - Gil - 02-05-2023, 05:22 PM
RE: Inout - DavidM - 02-05-2023 11:36 PM
RE: Inout - Gil - 02-06-2023, 12:28 AM
RE: Inout - Gil - 02-06-2023, 10:19 AM
RE: Inout - DavidM - 02-06-2023, 01:47 PM
RE: Inout - Gil - 02-06-2023, 02:26 PM



User(s) browsing this thread: 2 Guest(s)