xsharp.eu • error text format - Page 2
Page 2 of 2

error text format

Posted: Wed Jul 03, 2019 9:30 am
by robert
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

error text format

Posted: Wed Jul 03, 2019 6:11 pm
by Karl-Heinz
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

error text format

Posted: Thu Jul 04, 2019 4:20 pm
by Karl-Heinz
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.

Code: Select all

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