Post Reply 
Custom Text Formatting (Previously: Getting long results in a program)
04-14-2024, 07:33 PM (This post was last modified: 04-14-2024 08:02 PM by komame.)
Post: #78
RE: Getting long results in Program
(04-14-2024 01:22 PM)Tyann Wrote:  Do you have something like this in mind?
[...]

When it comes to the version with 10 parameters, you're pretty close! However, it can be done even more compactly.
Here's my version:

Code:
EXPORT ATEXTOUT_P(...l)
BEGIN
 LOCAL d:=SIZE(l);
 IF TYPE(l(2))≠8 THEN 
  l(−2):=G0;
  d:=d+1;
 END;
 IF 2<d<7 THEN
  LOCAL f:=STRING(l);
  RETURN EXPR("TEXTOUT_P("+SUPPRESS(f,{1,DIM(f)}));
 END;
 IF d<10 THEN
  l:=CONCAT(l,SUB({0,320,−1},d-6,3));
 ELSE
  IF d>10 THEN Err(0); END;
  IF l(10)<0 THEN Err(2); END;
 END;
 atextout(l(1),l(2),l(3),l(4),l(5),l(6),l(7),l(8),l(9),l(10));
END;

Maybe it's worth trying to achieve a version with different alpha values for text and background (so ultimately 9 parameters and both colors in the {color,alpha} format)?

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Getting long results in Program - komame - 04-14-2024 07:33 PM
RE: Custom Text Formatting - Tyann - 04-15-2024, 06:55 PM
RE: Custom Text Formatting - komame - 04-15-2024, 07:42 PM
RE: Custom Text Formatting - Tyann - 04-16-2024, 04:38 AM
RE: Custom Text Formatting - komame - 04-16-2024, 06:02 AM



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