Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Operator/Operand Type Mismatch?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00488822
Message ID:
00488831
Vues:
7
>It happens on the command line IF PersID = &OMDID1. The code leading up to and including the error command line follows:
>
>It acts like one value is numeric, but in the debugger everything appears to be Char strings. And I see the value of PersID = "20954" and the value of OMDID1 = "21090" when the error stops the execution of the program/form.
>
>This code is in the Init of the Form. When I put in a TYPE() function to troubleshoot the problem, I got an "N" for the type of one of the two variables, but I couldn't tell which one because only one showed even though I had two TYPE() commands, one for each variable. And I tried ALLT(STR()) on the first PersID variable to see if it was Numeric and I got a different error because it was a Char string value. I don't see what's the matter. Thanks for the assistance.
>
>
>Here's my code now! The error IF code is 6 lines up from the bottom. I supplied the other code so you can see where the PersID comes from.
>
Steve, see my comments embedded in your code

>
>FOR ii = 1 TO 3
>      SELECT attempts
>      GO TOP
>      DO WHILE !EOF()
>		person = evaluate("attempts.personnel" + ALLT(STR(ii))) &&value of the field
                wait window vartype(Person) && What's the type of this person: is it male/female, oops, I mean, is it Numeric, Logic or Char
>		IF !EMPTY(Person) && Value of the field
                        if vartype(Person)="C" && Char
>			    rtrimpers = RTRIM(person)
>			    PersID=RIGHTC(rtrimpers,12)
>			IF RIGHTC(PersID,6) = "ACTIVE"
>				PersID=LEFTC(person,5)
>			ELSE
>				PersID=RIGHTC(rtrimpers,5)
>			ENDIF
                        endif && End of vartype check
>*		ENDIF
>		  IF IsNull(PersID)
>				PersID = ""
>		  ENDIF
          
>         IF PersID=&OMDID1
>            IF ATTEMPTS.ROUTE="ORAL"
           store &O_ATT+ATTEMPTS.ATTS1 to ("O_ATT"+transform(LI)) && Name expression, are you sure, the first macro is needed?
               store &T_ATT+ATTEMPTS.ATTS1 to ("T_ATT"+transform(LI)) && Name expression
>         >
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform