Quantcast
Channel: MaplePrimes - MapleSim Posts and Questions
Viewing all articles
Browse latest Browse all 321

Two linked questions about printf and length commands

$
0
0

Hi everybody, 

Neither of these questions is vital but answers will be greatly appreciated

-------------------------------------------------------------------------------------------------
Question 1 :
Is it possible to manage programatically the character fonts in a printf command ?
(for instance to print some piece of text in bold font ... without selecting it and clicking the bold B of the toolbar)

-------------------------------------------------------------------------------------------------
Question 2 :

In order to have a nice render, I use to create my own format for printf command. For instance, when I have to “printf” some text I usually compute its length L and my “printf” format constructor contains a command  like  MyFormat := cat(“%”, L, “a”)

Unfortunately the length(…) command seems to be sensitive to accented characters :
                                     For people not familiar with french, "dégénéré"  (note the acute accents) means "degenerate".
length(“dégénéré”) returns 12
length(“degenere”) returns 8
… which of course leads to a very inelegant render, which is all I wanted to avoid

Why does “length” behave this way ?
Is it possible to bypass this annoyance while ensuring “dégénéré” has length 8 ?



Thanks in advance

 


Viewing all articles
Browse latest Browse all 321

Trending Articles