Search on this forum is confusing. I searched for "else" or "if" (with and without quotes) with all topics selected and returned no results.
Anyway, here's my dilemma. (spell checked and doesn't look right) :P
I'm trying to go through a string of bits flipping every other one. Like so:
Code: Select all
t1=""
for i=1 to 7 step 2
if mid(t,i,1)="0" then t1=t1+"1"
if mid(t,i,1)="1" then t1=t1+"0"
t1=t1+mid(t,i+1,1)
next i
Of course you see the problem. If the first condition is true then both lines get executed accomplishing nothing. I went through help looking for if/else formats trying every combination I can think of and keep getting "Else without If" errors. Can someone point me in the right direction? It's been several years and starting to enjoy this stuff again.
Regards