Possible, to get a real VALTYPE-Info from inside xBrowse ?

Possible, to get a real VALTYPE-Info from inside xBrowse ?

Postby ukoenig » Sat Mar 01, 2008 12:49 am

Hello

There is a problem i have in xBROWSE :

For some reasons, i have to get the VAL-TYPE of a database.
No cols are defined.
When I do :
msgalert( VALTYPE( FIELDNAME( nOrder )) )
in a for next loop, the message returns allways < C >
maybe because of the functions in the xBROWSE-Class


Sample :


Code: Select all  Expand view

for nFor := 1 to Fcount()
      oBrw5:aCols[ nFor ]:bRClickHeader := ;
      {|r,c,f,o| cFELD := o:cHeader, ;            // = oCol:cHeader
        nOrder := o:nCreationOrder, ;            // = Header-Click-Col
       msgalert( VALTYPE( FIELDNAME( nOrder )) ), ; // all Fields are  C
       oBrw5:Refresh(), ;
       oBrw5:SwapCols( 1, nOrder ), ;          // Bring selected col to 1
       oBrw5:GoLeftMost(), ;                        // Go to 1. Col ( indexed )
       oBrw5:nFreeze := 1 }                        // Freeze 1. Col
next


cValToChar !!!!!
// -------------------
//----------------------------------------------------------------------------//

STATIC FUNCTION AdoGenFldBlk(oRs,nField)
RETURN {|| cValToChar( oRs:Fields(nField):Value) }

//----------------------------------------------------------------------------//

STATIC FUNCTION GenFieldBlock( cAlias, nField )

RETURN {|| cValToChar( ( cAlias )->( FieldGet( nField ) ) ) }

//----------------------------------------------------------------------------//

STATIC FUNCTION GenArrayBlock( bBlock, nCol, lAsString )

   local block

   if lAsString
      block :=  {|| cValToChar( Eval( bBlock )[ nCol ] ) }
   else
      block :=  {|| Eval( bBlock )[ nCol ] }
   endif

RETURN block



How can i findout the correct VAL-Type of a field,
inside of a xBrowse ?

Regard
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Detlef Hoefner » Sat Mar 01, 2008 10:07 am

Uwe,

i don't know much about xBrowse.
But
msgalert( VALTYPE( FIELDNAME( nOrder )) ), ; // all Fields are C
The function fieldname will return the name of a field which is indeed always of valtype 'C'.

Maybe you should ask for
Code: Select all  Expand view
valtype( fieldget( nOrder ) )


hth,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

VALTYPE in xBrowse

Postby ukoenig » Sat Mar 01, 2008 12:31 pm

Hello Detlef,

It is true, it was just the wrong call
VALTYPE( Fieldget( nOrder ) ) returns the
correct value.
It seems, after working till late at night,
i loosing a bit the concentration.

Thanks
Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 76 guests