1 Reply Latest reply on Sep 22, 2006 1:11 PM by Newsgroup_User

    Using a checkbox with fileio and printomatic

    Mike Crisp

      I am building a project using fields to save and open user inputted details e.g. name , address etc...

      And i am using printomatic to print them.. no problems with this I have done several projects like this.

      However in this particular project I have a checklist (using director checkbox buttons) that I also want to save and print in the same way as my fields... Can this be done, if not what options an I use ?

      Thanks in advance
        • 1. Re: Using a checkbox with fileio and printomatic
          Level 7
          The approach I would use, would be to scan the checkbox sprites, testing
          the hilite state of each checkbox member, inserting an X in your print
          output for each checkbox set.

          If you had a predefined form recorded in a field, placeholder symbols
          could be used to locate the X chars, Say you have 5 check boxes, the
          form could have place holders X1 to X5.

          -- here's a psuedo code fragment

          repeat with check = 1 to 5
          if member("checkbox" & check).hilite then insertCheck check, true
          else insertCheck check, false
          end repeat

          on insertCheck checkNum, state
          checkPos = offset("x" & checkNum, field "form")
          if checkPos then -- found placeholder
          if state then member("form").char[checkpos..checkpos +1] = "X "
          else member("form").char[checkpos..checkpos +1] = "_ "
          put "Missing placeholder for " & "x" & checkNum -- error to msg
          end if

          This is untested code the offset arg order may be wrong, the .char set
          function may not work with field members.