if urltxt.text.contains “https” then
label2.text = “SAFE”
label2.textcolor = color.green
label2.text = “Unknown”
label2.textcolor = color.orange
I get three errors on this code. First:
it says my if urltxt (that is a combobox).text.contains “https” is incorrect code. It says my color.green and color.orange are also incorrect.
Sam, what happens when you replace it with this code?
if instr(0, urltxt.text, "https") > 0 then
label2.text = "SAFE"
label2.textcolor = &C00ff00 // green
label2.text = "Unknown"
label2.textcolor = &cff9c00 // orange
Alwyn beat me to it.
The reasons your code doesn’t compile are:
contains is not a keyword in Xojo. You can add it with a package like my free M_String module, but it is not native.
color.green is not a constant that returns the color green. Instead, when you have a color, it returns the value of the green component of that color.
color.orange doesn’t exist at all, so Alwyn gave you the constant values to use for both orange and green.
Thanks guys, that works. Big help!