Custom Text Formatting (Previously: Getting long results in a program)
|
04-03-2024, 07:27 PM
(This post was last modified: 04-03-2024 07:29 PM by komame.)
Post: #36
|
|||
|
|||
RE: Getting long results in Program
(04-03-2024 05:15 AM)Tyann Wrote: Thanks for your help, my approach is the same as yours, the same function with a different number of parameters. There is another way to handle default parameter values. I'm not sure if it will be better, but it doesn't require creating separate functions with different numbers of parameters. For this purpose, you can use a variable-length argument. This solution allows passing from 1 to 16 values to the function. Then it's just a matter of checking the types of the passed values, which can be done by comparing entire lists. For example (inside the "CASE", all permissible scenarios should be listed): Code: EXPORT DRAWTEXT_P(...par) (04-03-2024 05:15 AM)Tyann Wrote: Yes, the superbold is very nice, but one question comes to mind: these different attributes should be able to be combined: bold and underlined for example. There are many possibilities here. It's a matter of preference. It could even be a string where each character corresponds to enabling a specific format, for example: B - bold, U - underline, I - italic, S - strikethrough, D - double-bold, F - framed. If any of these letters appear in the string (using INSTRING), then it's clear that a specific format needs to be set. But decimal presentation is also fine. Piotr Kowalewski |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 68 Guest(s)