by FranciscoA » Sat Jun 09, 2012 3:37 pm
ukoenig, you are right.
Many years ago, I coded a function with a get to 4 decimal places and I've always done it this way:
Function TcUSpVenta()
local nTasausPVta:=Val(GetPvProfString("config","TasaPVta","0.0000",cIniFile))
if MiGet4Dec("TCambio US$ para Ventas","","Introduzca el Tipo de Cambio US$",@nTasausPVta,"config",.t.) //4 decimals get
WritePProString("config","TasaPVta", alltrim(str(nTasausPVta)), cIniFile)
endif
Return nil
Then in another part of the code
nTcambio := val(GetPvProfString( "Config", "TasaPvta" , "1", cInifile ) )
//---------------------------------------------------------------------------
Function MiGet4Dec( cTitDlg, cTexto, aTitGet, aGet, cBmp,lDecim)
local lOK:=.F., oDlg, oBtn1, oBtn2, oBmp, oBmpF, oBrush,cBrush:=".\wall.bmp"
local oTitGet1, oTitGet2, oTitGet3, oTitGet4, oTitGet5, oSayText
local oGet1, oGet2, oGet3, oGet4, oGet5
local uTemp:=aGet
DEFAULT lDecim:=.f.
if !Empty(cBrush) .and. file(cBrush)
DEFINE BRUSH oBrush FILENAME cBrush
endif
DEFINE DIALOG oDlg RESOURCE "BUSCADOR1" TITLE cTitDlg FONT oWnd:oFont BRUSH oBrush Transparent
REDEFINE SAY oTitGet1 PROMPT aTitGet ID 101 OF oDLG
REDEFINE GET oGet1 VAR uTemp ID 201 OF oDLG PICTURE "999,999.9999"
if ! Empty( cBmp )
REDEFINE BITMAP oBmp RESOURCE cBmp ID 400 OF oDlg
endif
REDEFINE BUTTONBMP oBtn1 ID 312 OF oDLG ACTION ( lOK:=.t., oDlg:End() ) BITMAP "ACEPTAR" TEXTRIGHT
REDEFINE BUTTONBMP oBtn2 ID 313 OF oDLG ACTION ( lOK:=.f., oDlg:End() ) CANCEL BITMAP "CANCELAR" TEXTRIGHT
ACTIVATE DIALOG oDlg CENTERED
if lOK
aGet:=uTemp
endif
oBrush:End()
Return lOK
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql