If Label1_Caption = "hello"

General discussion on Visual TFT Software.
Post Reply
Author
Message
jasonmbeamer
Posts: 9
Joined: 21 Jan 2012 05:57

If Label1_Caption = "hello"

#1 Post by jasonmbeamer » 27 Jul 2021 01:22

I am trying to use the if statement like I normally would in most other basic programming languages however I have not figured out the problem with not allowing the operand in this statement.
the reason for this type of statement is for a flip flop button text. If its "English" then make it "Spanish" and if its "Spanish" make it "English" like this

if ButtonRound1_Caption = "Espanol" then
ButtonRound1_Caption = "English"
else
ButtonRound1_Caption = "Espanol"
end if

Any help on what I'm doing wrong would be greatly appreciated, thank you.....

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: If Label1_Caption = "hello"

#2 Post by filip » 27 Jul 2021 10:40

Hi,

Try using strcmp or similar function for comparing strings, see String library section in the help file more information.

Regards,
Filip.

jasonmbeamer
Posts: 9
Joined: 21 Jan 2012 05:57

Re: If Label1_Caption = "hello"

#3 Post by jasonmbeamer » 30 Jul 2021 02:31

After becoming bald from frustrations and pulling all my hair out, I realized I had to click on string in the system library to add the string procedures. Now it makes much more sense lol.......

Post Reply

Return to “Visual TFT General”