fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: error text format

error text format 5 months 3 weeks ago #8526

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372
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"Description\t: " + SELF:Description)
sb:AppendLine( e"SubSystem\t: " + SELF:SubSystem )
sb:AppendLine( e"GenCode\t\t: " + nGenCode:ToString() )
sb:AppendLine( e"GenCodeText\t: " + SELF:GenCodeText )

...

What do you think ?

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

regards
Karl-Heinz
Attachments:

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8529

  Chris Pyrgas's Avatar Chris Pyrgas Offline Posts: 1402
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:
XSharp Development Team
chris(at)xsharp.eu
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Chris Pyrgas.

error text format 5 months 3 weeks ago #8531

  Karl Faller's Avatar Karl Faller Offline Posts: 712
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

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8532

  Wolfgang Riedmann's Avatar Wolfgang Riedmann Online Posts: 1789
Hi Chris,

I would vote for #3.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8533

  Johan Nel's Avatar Johan Nel Away Posts: 568
#3
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8535

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372
Hi Chris,

#3 is the best

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8537

  Chris Pyrgas's Avatar Chris Pyrgas Offline Posts: 1402
#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.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8546

  Robert van der Hulst's Avatar Robert van der Hulst Offline Posts: 1217
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

Please Log in or Create an account to join the conversation.

error text format 5 months 3 weeks ago #8547

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372

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

Please Log in or Create an account to join the conversation.

error text format 3 months 1 week ago #9680

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372

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.

sb:AppendLine(e"GenCode :\t\t" + nGenCode:ToString()  )
sb:AppendLine(e"SubCode :\t\t" + SELF:SubCode:ToString() )
sb:AppendLine(e"OsCode :\t\t" 	+ SELF:OsCode:ToString() )
sb:AppendLine(e"FuncSym :\t\t" 	+ SELF:FuncSym   )
sb:AppendLine(e"Severity :\t\t" + sev:ToString() )
sb:AppendLine(e"CanRetry :\t\t"	+ SELF:CanRetry )
sb:AppendLine(e"Tries :\t\t" 	+ SELF:Tries:ToString()    )
sb:AppendLine(e"ArgType :\t\t" 	+ TypeString(SELF:ArgType    ) )
sb:AppendLine(e"ArgNum :\t\t" 	+ SELF:ArgNum:ToString()    )
sb:AppendLine(e"Arg :\t\t" 	+ SELF:Arg)
sb:AppendLine(e"Args :\t\t" + 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:

Please Log in or Create an account to join the conversation.

error text format 3 months 1 week ago #9681

  Robert van der Hulst's Avatar Robert van der Hulst Offline Posts: 1217
Karl,
This depends on what you choose to display the error.
If you use the built in ErrorDialog() function then the message with 2 tabs look ugly.
There is no way we can format this so that it looks Ok in all circumstances...
I personally think that the MessageBox that you are using is not the best way to display the error...
Maybe we should add a method / function that returns a 2 dimensional array with descriptions and values, so you can format it yourself.

Robert
XSharp Development Team
The Netherlands

Please Log in or Create an account to join the conversation.

error text format 3 months 1 week ago #9682

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372
Hi Robert,

yes, it´s currently only a MsgBox. But i see the tab problems when i use a painted window and write the e:ToString() content to a mle- or txtControl instead. The idea to retrieve a 2 dim array instead sounds interesting. Then it would be e.g. possible to avoid tabs and simply add two txt controls to a form. The error descriptions go to the left and the error values to the right control.

But first of all, I´ll take a look at the possibility to split the current e:ToString() content.

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

error text format 3 months 1 week ago #9687

  Karl-Heinz Rauscher's Avatar Topic Author Karl-Heinz Rauscher Offline Posts: 372
Hi Robert,

i´ve looked at the ErrorDialog sources and added the possibility to position a tab. Because it doesn´t make much sence to pass an array of INTs i´m using a single INT only. i think the marshalling is ok.

PUBLIC METHOD SetTabStop ( i AS INT ) AS LOGIC  
LOCAL tabPosPointer AS IntPtr
LOCAL lOk AS LOGIC 
		
    tabPosPointer := Marshal.AllocHGlobal( 1 * Marshal.SizeOf(typeof(INT)))		
        
    // NOTE: zero based !
    Marshal.WriteInt32( tabPosPointer, 0 * Marshal.SizeOf(typeof(INT)), i )
 
    lOk := ( Sendmessage ( SELF:ErrorText:Handle , EM_SETTABSTOPS , 1  ,  tabPosPointer )  == 1 ) 	 
	
    Marshal.FreeHGlobal(tabPosPointer)	
  
    RETURN  lOk

END METHOD 

Now the TextBox content might even look like in the attachment :-)

regards
Karl-Heinz
Attachments:

Please Log in or Create an account to join the conversation.

  • Page:
  • 1