I load the types of the database columns I am going to save the data type in an array
aTipos [ n ]:= oGrid:aCols[ n ]:cDataType
however, it often happens that a text is displayed in a column but the field in the archive is numeric
but xbrowse it returns me the type of the given character
but if the field is numeric it gives me an error
How can I check if the field in the archive is numeric?
When I create the xbrowse I make an array with all fields aCols
- Code: Select all Expand view RUN
local aCols := { ;
{ "CODICE" , "Codice" ,, 40, },;
{ "DESC" , "Descrizione" ,, 150, },;
{ "NUM7" , "Tipo Codice" ,, 80, },; //Num7
{ "ALFA1" , "Iva Cee" ,, 80,AL_CENTER },; //alfa1
{ "ALFA1" , "Partecipa Platfond" ,, 80,AL_CENTER },; //alfa1
{ "NUM1" , "% aliquota" ,"999.99", 80,AL_RIGHT },;
{ "NUM2" , "% Ventilazione" ,"999.99", 80,AL_RIGHT },;
{ "NUM5" , "% Indetraibile" ,"999.99", 80,AL_RIGHT },;
{ "ALFA1" , "Iva non esposta" ,, 80,AL_CENTER }} //alfa1
then on Xbrowse I use
@ 110,10 XBROWSE oBrw SIZE -2,-10 PIXEL OF oTabDlg ;
DATASOURCE oDbf COLUMNS aCols ;
AUTOSORT ;
NOBORDER CELL LINES
WITH OBJECT oBrw:aCols[3]
:bEditValue :={ || TipoIva(oDbf:NUM7,oDbf) }
END
when I make the order it not take the type of field on archive but the current rows ( string)
but if I made
WITH OBJECT oBrw:aCols[3]
:bStrData :={ || TipoIva(oDbf:NUM7,oDbf) }
END
then the order run ok without error because it take the right type of data ( numeric)
But Nages sad me not use :bStrData , so how I can resolve ?