Post Reply 
Custom Text Formatting (Previously: Getting long results in a program)
05-14-2024, 10:48 AM (This post was last modified: 05-17-2024 08:58 PM by komame.)
Post: #117
RE: Custom Text Formatting (Previously: Getting long results in a program)
Hi Tyann,

I've been experimenting with ICON a bit, and it turns out that when I generate a string for ICON as an empty buffer directly on the HP Prime, it's smaller than the one generated using DIMGROBHelper.
Despite increasing the buffer size from 331 pixels to 522 pixels, the string for ICON has decreased by 40 characters (202 => 162).

This is a program I wrote to generate such an empty buffer string:
Code:
EXPORT ICONBUFFER(w,h)
BEGIN
  local iconstring,f:=CHAR(RANDINT(30,97,122));
  DIMGROB_P(G9,w,h,0);
  AFiles(f):=G9;
  iconstring:=ΣLIST(EXECON("RIGHT(0+SUPPRESS(STRING(&1),\"#h\"),2)",SETBASE(AFilesB(f,0,AFilesB(f)),4)));
  DelAFiles(f);
  RETURN "ICON buffer " + iconstring +";";
END;

I want to make it clear right away that this program won't work for any files with graphical content; it can only be used to generate an empty buffer. Perhaps with a bit more experimentation, it might be possible to replace DIMGROBHelper with a program on the HP Prime for normal graphics as well, but for now, I haven't delved into that topic quite so deeply yet.

Additionally, I changed the "Err" function and used PIECEWISE in it, which made it more compact (single-line) and allowed for removing the "Invalid Input" error generation because it is default for PIECEWISE when no condition is met.

I also added translations for Dutch [NLD - Nederlands], Portuguese [POR - Português] and Simplified Chinese [ZHS - 中文(简体)]. However, I encountered an issue with Japanese language, which requires a bit more work to achieve satisfactory results, so I'll address that a bit later.

EDIT (May 17, 2024): A Japanese translation has been added.

The new version v1.03 with the above changes has been published: https://www.hpmuseum.org/forum/thread-21...#pid187156

Best wishes

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


Messages In This Thread
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
RE: Custom Text Formatting (Previously: Getting long results in a program) - komame - 05-14-2024 10:48 AM



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