Information générale
Titre:
Error with UDF within BROWSE FIELDS
I'm getting an error in VFP that I cannot replicate in a 2.6 app. Wondering if anyone has run into this?
A numeric field (representing time of day in 24hour format) is being transformed to a character field showing AM/PM. When user mouses into the field, VFP error fires (variable is not found).
Code below will duplicate error:
CREATE CURSOR tmpData ;
(compid C(14), ;
phonenum C(14), ;
calltime N(4))
SELECT tmpData
INSERT INTO tmpData ;
(compid, ;
phonenum, ;
calltime) ;
VALUES ;
("100-000-000", ;
"407-313-9900", ;
1430)
BROWSE FIELDS compid, phonenum, y=FmtTime(calltime) NOEDIT
******************************************************************
FUNCTION fmttime(lnTimeValue)
PRIVATE timestrg
IF lnTimeValue < 10
timestrg = SPACE(2)+PADL(STR(lnTimeValue,1),2,"0")
ELSE
timestrg = STR(lnTimeValue,4)
ENDIF
RETURN LEFT(timestrg,2)+":"+RIGHT(timestrg,2)
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement