Wish: Function to show any type of data
Wish: Function to show any type of data
A function that acts like Alert() but show:
Objects(name, type)
String(value,len,OEM/ANSI)
Numeric(value)
Date(value)
Array(value of each data, even if multidimensional)
Null(show a message tha it's nil with a different color)
I think that it can be done easily and will give a help to many developpers.
Objects(name, type)
String(value,len,OEM/ANSI)
Numeric(value)
Date(value)
Array(value of each data, even if multidimensional)
Null(show a message tha it's nil with a different color)
I think that it can be done easily and will give a help to many developpers.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio, some of these functions returns the value of multidimensional array?
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
If I ain't wrong, some of these functions don't accept null too....
I im thinking in a universal function to show values, maybe a upgrade in the functions or a new function....
I know that I can do it myself, but I'm not thinking only im me...
It will help me to avoid add a procedure at each project only.
Thanks, merry christmas and happy new year!
I im thinking in a universal function to show values, maybe a upgrade in the functions or a new function....
I know that I can do it myself, but I'm not thinking only im me...
It will help me to avoid add a procedure at each project only.
Thanks, merry christmas and happy new year!
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
Maurizio, is something like that but why not change the actual functions to do this?
or add a procedure: Analyse( uVar )
that send message( like Alert(), Msg() ) with the type of the data(in the title) and the value.
All I want is to group already done functions to a better result.
or add a procedure: Analyse( uVar )
that send message( like Alert(), Msg() ) with the type of the data(in the title) and the value.
All I want is to group already done functions to a better result.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
-
- Posts: 1033
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
Re: Wish: Function to show any type of data
Hello,
you can start with this tiny example, and extend for other data types
regards
Marcelo
you can start with this tiny example, and extend for other data types
Code: Select all
#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
viewdata( {"a","b","c", {"A","B","C", {1,"2", DATE() } } } )
return nil
//----------------------------------------------------------------------------//
FUNCTION viewdata( data )
//----------------------------------------------------------------------------//
IF VALTYPE( data ) = "A"
viewarray( data )
ELSE
msginfo( data )
ENDIF
RETURN NIL
//----------------------------------------------------------------------------//
STATIC FUNCTION viewarray( aArray )
//----------------------------------------------------------------------------//
LOCAL oBrw, oDlg, aData := {}, i
FOR i := 1 TO LEN( aArray )
DO CASE
CASE valtype( aArray[i] ) = "D" ; AADD( aData, {i, "D", DTOC( aArray[i] ) } )
CASE valtype( aArray[i] ) = "N" ; AADD( aData, {i, "N", STR( aArray[i] ) } )
CASE valtype( aArray[i] ) = "L" ; AADD( aData, {i, "L", IF( aArray[i], ".T.", ".F." ) } )
CASE valtype( aArray[i] ) = "C" ; AADD( aData, {i, "C", aArray[i] } )
CASE valtype( aArray[i] ) = "A" ; AADD( aData, {i, "A", "ARRAY" } )
ENDCASE
NEXT
DEFINE DIALOG oDlg FROM 1,1 TO 20,28
@ 0,0 XBROWSE oBrw ;
OF oDlg ;
ARRAY aData ;
HEADERS "Ind", "Tipo", "Valor" ;
JUSTIFY .T., 2, .F.;
COLSIZES 30,30,100 ;
AUTOCOLS ;
ON CHANGE oDlg:aEvalWhen()
oBrw:lHScroll := .F.
oBrw:lVScroll := .T.
oBrw:nMarqueeStyle := 5
oBrw:nRowHeight := 20
oDlg:oClient := oBrw
oBrw:CreateFromCode()
@ 7,01 BUTTON "Array" OF oDlg WHEN aData[ oBrw:nArrayAt, 2 ] == "A" ACTION viewarray( aArray[oBrw:nArrayAt] )
@ 7,12 BUTTON "Salir" OF oDlg ACTION oDlg:end()
ACTIVATE DIALOG oDlg ON INIT oBrw:SetFocus()
RETURN NIL
Marcelo
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Wish: Function to show any type of data
Now
XBrowse( <anydatatype> )
works
XBrowse( <anydatatype> )
works
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Wish: Function to show any type of data
Samir,
I find ValToPrg() helps me a lot in my debugging. It's a function in xHarbour. I normally use it to inspect arrays
I find ValToPrg() helps me a lot in my debugging. It's a function in xHarbour. I normally use it to inspect arrays
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC