error text format

This forum is meant for questions and discussions about the X# language and tools
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

error text format

Post by Karl-Heinz »

Hi Chris

no show-stopper, but when a error is thrown its annoying that the MsgBox content is not formatted. To overcome the issue i simply added horizontal tabs to the Error:Tostring() method.

e.g.

...
sb:AppendLine( e"Descriptiont: " + SELF:Description)
sb:AppendLine( e"SubSystemt: " + SELF:SubSystem )
sb:AppendLine( e"GenCodett: " + nGenCode:ToString() )
sb:AppendLine( e"GenCodeTextt: " + SELF:GenCodeText )

...

What do you think ?

attached you find a viaef that shows the default and the modified Tostring() behaviour.

regards
Karl-Heinz
Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

error text format

Post by Chris »

Hi Karl-Heinz,

Thanks, I agree it is better this way (provided the tabs do not get disturbed when people use different system font sizes!), but I would prefer to put the ":" just after the captions, not tabbed with the values as well, do you agree?

What everybody else thinks? Those are the 3 options, first one is the current one:
Attachments
Error3.png
Error3.png (6.85 KiB) Viewed 618 times
Error2.png
Error2.png (6.85 KiB) Viewed 618 times
Error1.png
Error1.png (6.9 KiB) Viewed 618 times
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FFF
Posts: 1580
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

error text format

Post by FFF »

I like #3, but shrink the tab width to the possible minimum...Or, add a dotted line between to lead the eye from key to value. Eyes and brain are getting older ;)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

error text format

Post by wriedmann »

Hi Chris,

I would vote for #3.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

error text format

Post by lumberjack »

#3
______________________
Johan Nel
Boshof, South Africa
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

error text format

Post by Karl-Heinz »

Hi Chris,

#3 is the best

regards
Karl-Heinz
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

error text format

Post by Chris »

#3 it is then, thanks to all for your input!

Unfortunately printing Error:ToString() to the console does not look as nice (extra tabs are shown as extra tabs...), but I think it's still better than before.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

error text format

Post by robert »

Karl-Heinz,

The fact that you are now reporting that the format of the error message is incorrect means to me that have indeed reached a mature product!

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

error text format

Post by Karl-Heinz »

robert wrote:Karl-Heinz,

The fact that you are now reporting that the format of the error message is incorrect means to me that have indeed reached a mature product!

Robert
Hi Robert,

yes, with every new build it's getting harder and harder to find bugs - at least in the areas I'm investigating ;-)

Seriously: There are problems with some round() results, but i´ll open a new thread on that.

regards
Karl-Heinz
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

error text format

Post by Karl-Heinz »

Chris wrote:Unfortunately printing Error:ToString() to the console does not look as nice (extra tabs are shown as extra tabs...), but I think it's still better than before.
Hi Chris,

I´m not convinced ;-) i think the better choice is that the window view looks good. So it´s IMO better to keep the two tabs in the following lines.

Code: Select all

sb:AppendLine(e"GenCode :tt" + nGenCode:ToString()  )
sb:AppendLine(e"SubCode :tt" + SELF:SubCode:ToString() )
sb:AppendLine(e"OsCode :tt" 	+ SELF:OsCode:ToString() )
sb:AppendLine(e"FuncSym :tt" 	+ SELF:FuncSym   )
sb:AppendLine(e"Severity :tt" + sev:ToString() )
sb:AppendLine(e"CanRetry :tt"	+ SELF:CanRetry )
sb:AppendLine(e"Tries :tt" 	+ SELF:Tries:ToString()    )
sb:AppendLine(e"ArgType :tt" 	+ TypeString(SELF:ArgType    ) )
sb:AppendLine(e"ArgNum :tt" 	+ SELF:ArgNum:ToString()    )
sb:AppendLine(e"Arg :tt" 	+ SELF:Arg)
sb:AppendLine(e"Args :tt" + cArgs)
attached are two images. The first one shows how the error text is currently shown in a window with single tab stops only. The second one shows the console and window output with two tab stops where it´s neccessary.

regards
Karl-Heinz
Attachments
ErrorTwoTabStops.jpg
ErrorTwoTabStops.jpg (63.21 KiB) Viewed 618 times
ErrorTabstopsCurrent.jpg
ErrorTabstopsCurrent.jpg (35.61 KiB) Viewed 618 times
ErrorTwoTabStops.jpg
ErrorTwoTabStops.jpg (63.21 KiB) Viewed 618 times
ErrorTabstopsCurrent.jpg
ErrorTabstopsCurrent.jpg (35.61 KiB) Viewed 618 times
Post Reply