On Sat, May 9, 2015 at 6:51 PM, Geoff Canyon <[email protected]> wrote:
> function sumPermute S,T
> repeat
> put offset(",",line 1 of S) into F
> put F into fld 1
> wait 0 ticks
> if F = 0 then exit repeat
> put empty into newS
> repeat with i = 1 to 3
> put char i of "+- " into C
> repeat for each line L in S
> put C into char F of L
> put L & cr after newS
> end repeat
> end repeat
> put char 1 to -2 of newS into S
> end repeat
> repeat for each line L in S
> replace space with empty in L
> if value(L) = T then put L & cr after R
> end repeat
> return R
> end sumPermute
>
Debug code snuck in. That should be:
function sumPermute S,T
repeat
put offset(",",line 1 of S) into F
if F = 0 then exit repeat
put empty into newS
repeat with i = 1 to 3
put char i of "+- " into C
repeat for each line L in S
put C into char F of L
put L & cr after newS
end repeat
end repeat
put char 1 to -2 of newS into S
end repeat
repeat for each line L in S
replace space with empty in L
if value(L) = T then put L & cr after R
end repeat
return R
end sumPermute
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode