Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with UDF within BROWSE FIELDS
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Error with UDF within BROWSE FIELDS
Miscellaneous
Thread ID:
00196393
Message ID:
00196393
Views:
60
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)
Next
Reply
Map
View

Click here to load this message in the networking platform