October 11, 200223 yr I just learned something and thought I'd share. In the past whenever I wanted to use a field as a toggle (on, off) I would write a script that would check if on/true/1 then set it set it to off/false/0 , else set it to the other on/true/1. This can all be replaced with just ONE set field and no [if's] inside. Lets say we had the field called "Toggle" and it's a number field. Since this technique only uses the 0, and 1 (0=off, 1=on), then a number field makes sense to me. If we simply make a set field command like this: Set Field ["Toggle", "Not Toggle"] This automatically flips the 0 to a 1, or a 1 to a 0. The only problem is if the field is empty to start, then it doesn't enter anything. I thought it could be useful and wanted to share.
October 11, 200223 yr To deal with the null field issue, you can use the slightly less "streamlined" version: Set Field ["toggle", "Case(toggle, not toggle, 1)"]
Create an account or sign in to comment