SRL Archive - Delphi/FPC Help and Tutorials

If a color is not on screen?


Leyser

2012-05-14 11:33:00

Is there a method or something similar if a color wasent on the screen then it would react?

~Leyser

ShawnjohnSJ

2012-05-14 12:18:46

Use
if(not(FindColorTolerance(params))) then
//do stuff
end;

Brandon

2012-05-14 12:19:54


if (NOT FindColorTolerance(.......)) then..


Not the other way around.. I've never seen Not If before :S

ShawnjohnSJ

2012-05-14 12:24:11

From: Brandon

if (NOT FindColorTolerance(.......)) then..


Not the other way around.. I've never seen Not If before :S


Lol I corrected myself within a minute or two after posting that.

Sirenia

2012-05-14 14:41:05

why so many brackets?
if not FindColorTolerance(stuff) then
is much easier

Brandon

2012-05-14 15:03:02

From: Sirenia
why so many brackets? Simba Code:
[LEFT]if not FindColorTolerance(stuff) then
[/LEFT]

is much easier


Most coders use brackets to differentiate ambiguity.

What if I had like 20 functions embedded between brackets and-ing the results?

Example:

Result:= (not Meh and Not bleh and Not what and not this and not that);

well You'd probably want to do:


Result:= ((Not Meh) and (Not Bleh) and (Not What) and (Not this) and (Not That));

Also I used that many brackets because I'm too used to coding in C where the if statement MUST have brackets.


if (this) //Without these brackets in the C Languages, it's not going to compile.
{
}