How to use a if(with for loop variable) statement inside for?

For eg.

if I want to write number from 1 to 100 skipping every multiple of 3. How can we write it ?

I tried $fl(1, 100, "i + 1", if(i % 3 = 0, "", i), " ")$

But it didn't worked. It gave output from 1 to 100 without skipping any number.

I know this is a long time ago, but I found a solution to your question. Your question helped me solve my problem too!!! thank you!

  • Wrap the if statement in double quotes "
  • Do not use double quotes inside your if statement "
  • If you want an empty string, change your logic to only capture the stuff you want to print so you avoid needing to print empty strings.
$fl(1, 100, "i+1", "if(i%3>0, i)", " ")$ 


Some of my testing.

  • Single quotes will not work for empty strings (').
  • Mine works because I only included something when the condition is True
  • Most of the time, it seems the app will interpret things as strings when you're inside this deep. See my problem which I solved finally below.

MY PROBLEM:

I want to do something when a certain app has a notification. So I must loop through the notifications, and if one of them is the app I am looking for I can then respond... Here is what I came up with:

$if(
  fl(0, ni(count)-1, "i+1",
    "if(ni(i, app)=BlackPlayer EX, true)",
  "")
=true, ALWAYS, NEVER)$

Hopefully my formatting makes it easier to read. If the for loop produces the string "true" we can act on it. In this case I want to make something visible or not.

Hi everyone :-) I have another question to this topic:

Is it possible to apply the same if-condition to the separator of the for-loop?

$fl(1,20,"i+1","if(i%3!=0,i)","if(i%3!=0,x)")$

I hope anyone can help me.