Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Operator/Operand Type Mismatch?
Message
De
27/03/2001 00:07:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00488822
Message ID:
00488828
Vues:
10
Steve,

Want a hint?

If you are unsure of the type of variable because of massive use of macro substitution - and I'm not criticizing that on it's own merits because, well, sh*t happens - then consider using TRANSFORM() to make everything a Char coming into the routine.

>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.
>
>
>FOR ii = 1 TO 3
>      SELECT attempts
>      GO TOP
>      DO WHILE .NOT. EOF()
>		person = "attempts.personnel" + ALLT(STR(ii))
>		IF !EMPTY(&person)
>			rtrimpers = RTRIM(&person)
>			PersID=RIGHTC(rtrimpers,12)
>			IF RIGHTC(PersID,6) = "ACTIVE"
>				PersID=LEFTC(&person,5)
>			ELSE
>				PersID=RIGHTC(rtrimpers,5)
>			ENDIF
>*		ENDIF
>		  IF IsNull(PersID)
>				PersID = ""
>		  ENDIF
>         IF PersID=&OMDID1
>            IF ATTEMPTS.ROUTE="ORAL"
>                O_ATT = "O_ATT" + ALLT(STR(ii))
>               &O_ATT=&O_ATT+ATTEMPTS.ATTS1
>                T_ATT = "T_ATT" + ALLT(STR(ii))
>                &T_ATT=&T_ATT+ATTEMPTS.ATTS1
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform