webu
Full Member
Posts: 149
|
Post by webu on Nov 20, 2022 15:53:35 GMT 1
Please try this example: OpenW 1, , , 100, 150 AutoRedraw = True SetFont 16 // nonprop
'Examples from the help-Part for "Format()":
Print Format$(3.14, "###.###;;") // " 3,14" NO leading spaces! :-( Print Format$(3.14, "###.##0;;") // " 3,140" NO leading spaces! :-( Print Format$(3.14, "###.###**;;") // "**3,14*" Print Format(0.14, "###.###;;") // " ,14" NO leading spaces! :-( Print Format(0.14, "##0.##0;;") // " 0,140" NO leading spaces! :-( Print Format(0.14, "###.###**;;") // "***,14*"
' What is wrong? The command or the help?
Do you get leading spaces?
|
|
|
Post by dragonjim on Nov 20, 2022 16:10:59 GMT 1
Interesting. My first instinct is to say that the help file is correct and GB32 is broken...
I will get back to you on this one.
|
|
webu
Full Member
Posts: 149
|
Post by webu on Nov 20, 2022 16:30:18 GMT 1
By the way, the Using command works as expected. Try this: Message ">" + Using$("###,###", PI) + "<" // "> 3,142<" In this case I have to work with comma. With Format(), it has to be a decimal point for it to work. I don't understand it and I have to try each time which command works like how I need it.
|
|
|
Post by dragonjim on Nov 20, 2022 21:41:53 GMT 1
I am waiting for definite confirmation, but I think I may have got it the wrong way around: the help page is most likely wrong and GB32 is working correctly. The reason I say this is, if you compare the help page with that for the Virtual Basic function Format() ( here), you will notice that the text for most of the descriptions is almost word for word. This occurred a lot in the English help file and most occurrences should have been rooted out (SendKeys was the latest), but this one has obviously slipped through the net. As I said, once I have confirmation, I will let you know and either GB32 or the help file will be updated.
|
|
|
Post by dragonjim on Nov 20, 2022 21:51:33 GMT 1
It looks like I was correct in my second surmise: checking the old German Help File, this is the description of the # wild card:
The last bit is a bit unclear and should be read as: "while # does not output a character unless * is used and then the character following * is output instead.
In other words, relating to your initial query, to get spaces rather than null characters, output Format(3.14,"###.###* "). The example from the old German help file is below:
Print Format$(3.14, "###.###;;") // prints aus 3,14") Print Format$(3.14, "###.##0;;") // prints aus 3,140") Print Format$(3.14, "###.###**;;") // prints aus **3,14*") Print Format(0.14, "###.###;;") // prints aus ,14") Print Format(0.14, "##0.##0;;") // prints aus 0,140")
Just as a after note, the Format command can also be used to create a string of a date or number. Hence Format(Date) prints the current date and Format(3) prints 3 as a string without the leading space.
A corrected Help File will be released soon...
...and as I am writing this, I have confirmation that this is the correct behaviour for GB32 when handling # in Format().
|
|
|
Post by (X) on Nov 23, 2022 2:42:04 GMT 1
I kinda forgot about Print Using... Thanks for the reminder.
|
|
|
Post by dragonjim on Nov 25, 2022 19:18:11 GMT 1
The new Format help page is now included in the latest Help file, downloadable from this forum page
|
|
|
Post by Roger Cabo on Nov 28, 2022 18:08:35 GMT 1
Message ">" + Format("###,###", PI) + "<" // "> 3,142<" Message ">" + Using$("###,###", PI) + "<" // "> 3,142<" Unfortunately I can not get the old help file to work on my windows 10. Any idea what this cause?
|
|
|
Post by dragonjim on Nov 29, 2022 9:59:07 GMT 1
Message ">" + Format(PI, "###.###* ") + "<" // "> 3,142<" Message ">" + Using$("###,###", PI) + "<" // "> 3,142<"
|
|
|
Post by dragonjim on Nov 29, 2022 22:19:05 GMT 1
For a new version of the old German help file, see herePlease note: this has not been updated in the last 20+ years.
|
|
|
Post by Roger Cabo on Dec 3, 2022 22:12:41 GMT 1
For a new version of the old German help file, see herePlease note: this has not been updated in the last 20+ years. unfortunately the link is broken...
|
|
|
Post by (X) on Dec 7, 2022 15:37:49 GMT 1
|
|
|
Post by (X) on Dec 7, 2022 16:17:21 GMT 1
|
|
|
Post by dragonjim on Dec 8, 2022 18:34:15 GMT 1
He was a very nice man and a great contributor to the help file. I did wonder why I had not heard from him for a while...
|
|
webu
Full Member
Posts: 149
|
Post by webu on Dec 18, 2022 22:43:02 GMT 1
Where is the newest german help-file? Is there a newer one than Jan. 2016?
|
|
|
Post by dragonjim on Dec 19, 2022 10:38:48 GMT 1
Not that I am aware. In 2016, I converted the old .hlp to .chm format so the 2016 file is just the old German Help File in a new format.
|
|