FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible, to get a real VALTYPE-Info from inside xBrowse ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Possible, to get a real VALTYPE-Info from inside xBrowse ?
Posted: 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 :


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 :-)
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.
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Possible, to get a real VALTYPE-Info from inside xBrowse ?
Posted: 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
valtype( fieldget( nOrder ) )


hth,
Detlef
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
VALTYPE in xBrowse
Posted: 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.

Continue the discussion