Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data type mismatch
Message
De
31/08/2004 09:16:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00935887
Message ID:
00937981
Vues:
24
Hi,

I found one error repeated many times, namely that you used UPPER and not LOWER. That means that all the text after = also must be lower case. I have taken the liberty to beautify your code, and change cRes to nRes since c usually means characterm and n means number. I guess you will find my code more readable:
SELECT 17
scan
   c3=LEFT(ALLTRIM(CHRTRAN(examcode,"0123456789","")),3)
   replace nmonth WITH Rep2(c3)
ENDSCAN




FUNCTION Rep2
  PARAMETERS cMes
  LOCAL nRes
  * cRes =0
  DO case 
    CASE LOWER(cMes) = "nov02" 
      nRes = 11 
    CASE LOWER(cMes) = "oct02" 
      nRes = 10 
    CASE LOWER(cMes) = "dec 02" 
      nRes = 12 
    CASE LOWER(cMes) = "annual" 
      cRes = 2 
    CASE LOWER(cMes) = "april3" 
      nRes = 4 
    CASE LOWER(cMes) = "june03" 
      nRes = 6 
    CASE LOWER(cMes) = "august 03" 
      nRes = 8 
    CASE LOWER(cMes) = "sep 2003" 
      nRes = 9 
    CASE LOWER(cMes) = "oct 2003" 
      nRes = 10 
    CASE LOWER(cMes) = "nov 2003" 
      nRes = 11 
    CASE LOWER(cMes) = "december 03" 
      nRes = 12 
    CASE LOWER(cMes) = "annual04" 
      nRes = 2 
    CASE LOWER(cMes) = "april 04" 
      nRes = 4 
    CASE LOWER(cMes) = "june 04" 
      nRes = 6 
  ENDCASE
RETURN nRes
>see this
>
>SELECT 17
>scan
>
> c3=LEFT(ALLTRIM(CHRTRAN(examcode,"0123456789","")),3)
>
> replace nmonth WITH Rep2(c3)
>ENDSCAN
>
>
>
>
>FUNCTION Rep2
> PARAMETERS cMes
> LOCAL cRes
> * cRes =0
> DO case
>CASE UPPER(cMes) = "nov02"
>cRes = 11
>CASE UPPER(cMes) = "Oct02"
>cRes = 10
>CASE UPPER(cMes) = "Dec 02"
>cRes = 12
>CASE UPPER(cMes) = "Annual"
>cRes = 2
>CASE UPPER(cMes) = "April3"
>cRes = 4
>CASE UPPER(cMes) = "June03"
>cRes = 6
>CASE UPPER(cMes) = "August 03"
>cRes = 8
>CASE UPPER(cMes) = "sep 2003"
>cRes = 9
>CASE UPPER(cMes) = "Oct 2003"
>cRes = 10
>CASE UPPER(cMes) = "Nov 2003"
>cRes = 11
>CASE UPPER(cMes) = "December 03"
>cRes = 12
>CASE UPPER(cMes) = "Annual04"
>cRes = 2
>CASE UPPER(cMes) = "April 04"
>cRes = 4
>CASE UPPER(cMes) = "June 04"
>cRes = 6
>ENDCASE
>RETURN cRes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform