Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data type mismatch
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00935887
Message ID:
00935889
Views:
20
Try this:
SELECT test1
scan
   c3   = ALLTRIM(LEFT(examcode ,5))
   replace nmonth WITH Rep1(c3)
ENDSCAN

FUNCTION Rep1
   PARAMETERS cMes
   LOCAL cRes
   cRes = 0
   DO case 
      CASE UPPER(cMes) = "NOV02" 
           cRes = 11 
      CASE UPPER(cMes) = "OCT02" 
           cRes = 10 
   ENDCASE

RETURN cRes
When You define cRes as public VFP automaticly creates that variable as bolean & cRes = .f.
If cRes is not assigned to numeric value (program not go in any CASE) cRes is still bolean. Therefor You Get Data Type Missmatch.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform