Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution and Picture file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00637840
Message ID:
00637865
Vues:
19
This message has been marked as the solution to the initial question of the thread.
>I get operator/operand mismatch on the following code -
>I declared PhoneBmp and NoPhoneBmp.
>PUBLIC PhoneBMP NoPhoneBMP pictures heights widths
>PhoneBMP = "c:\mydir\phone.bmp"
>NoPhoneBMP = "c:\mydir\nophone.bmp"
>
>
>
>I tired parens around the variables instead of an ampersand as in (pictures),(heights),(widths), but did not help.
>
>I wonder what's wrong? This all worked when I had 14 separate groups of commands, but when I condensed the code down to this it longer works. I will keep working on it.
>
>
> 	IF !EMPTY(hospital.phonecall) OR ;
> 		!EMPTY(hospital.typecall) OR ;
> 		ALLT(hospital.newstatus)<>"OPEN" OR ;
> 		hospital.phonepic = "Y"
>		THIS.lblCallNow.Visible = .T.
> 		*Red phone
>		FOR i = 1 to 14
>			pictures="THIS.ImgPhone"+(i)+".Picture"
>			heights="THIS.ImgPhone"+(i)+".Height=14"
>			widths="THIS.ImgPhone"+(i)+".Width=16"
>			IF recno()=i
>				* Phone
>				&pictures = (PhoneBMP)
>				&heights=14
>				&widths=16
>			ELSE
>				*No phone
>				&pictures = (NoPhoneBMP)
>				&heights=14
>				&widths=16
>			ENDIF
>		ENDFOR
> 	ENDIF
>
In the pictures/Heights/Widths lines you are concatinating a string and a numeric [i]. Below you don't need the = number since you have created them in the strings.

Try this.
IF !EMPTY(hospital.phonecall) OR ;
 !EMPTY(hospital.typecall) OR ;
 ALLT(hospital.newstatus)<>"OPEN" OR ;
   hospital.phonepic = "Y"
   THIS.lblCallNow.Visible = .T.
   *Red phone
   FOR i = 1 to 14
      pictures="THIS.ImgPhone"+alltrim(str(i))+".Picture"
      heights="THIS.ImgPhone"+alltrim(str(i))+".Height=14"
      widths="THIS.ImgPhone"+alltrim(str(i))+".Width=16"
      IF recno()=i
        * Phone
        &pictures = PhoneBMP
        &heights
        &widths
      ELSE
        *No phone
        &pictures = NoPhoneBMP
        &heights
 	&widths
	ENDIF
   ENDFOR
ENDIF
Best of luck
Mark S. Swiencki
EPS Software www.eps-software.com
mark@eps-software.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform