Jump to content

Adrian R. Foltyn

Newbies
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Adrian R. Foltyn

  1. I usually never use repeating fields but this time it seemed like the perfect solution. I usually start every FMP file with a database that I wrote a while back and has all the basic stuff already in it like sorting, searching and so on. One of the things that I customize after making a copy of this template is to give it a unique number. This way the database can identify itself to other files that I might implement later on and will do different tasks depending what file runs a script. A customer needs some kind of multi user feature on a single machine without logging in or out of user accounts (we're talking about Mac OS X 10.2, no fast user switching yet). It seemed like a perfect idea to have the privileges stored in a repeating field and every time a database needs to know if the user has the right privilege to access one of its features it would get the repetition of a repeating field by it's unique database number. Turns out this works great as more databases come in I just change the unique database number and add a repetition to the repeating field holding the privileges. So this would be my little addition to the question "What are repeating fields for?" But there was one big problem that I just found out how to solve. I like my databases to have the feature that users can undo all their editing to a record by simply pressing one button. It's odd that the revert record step only reverts the current field so I had to have a global field corresponding to every field that a user can put data in himself. So when the user goes to edit a record he actually writes the data into global fields and then if he chooses to save his modifications the data is swapped into the fields for the actual record. Well. In the case of the privileges I had to swap data around from one repeating field to the other. Would be most logical if you have a script step like this to swap the data: Set Field ["FIELD_User_privileges"-<repetitionnumber>,"GetRepetition(FIELD_Temp_privileges,<repetitionnumber>)] If you do this 8 times for 8 different repetitions you get your first repetition set, all other repetitions are cleared out. This next example however works: Set Field ["FIELD_User_privileges"-n,FIELD_Temp_privileges] How in heaven's name does FMP know that I want to set the n-th repetition of FIELD_User_privileges to the n-th repetition of FIELD_Temp_privileges? Seems to me like the last script step I showed you should set the value of the first repetition of FIELD_Temp_privileges to any repetition of FIELD_User_privileges I target with n. P.S. Is there a way to compose FMP script by typing rather than clicking? Flash has this basic mode where you get a FMP like experience when doing your scripts but also an advanced mode where you can actually copy and paste your code. I find myself doing a lot of repetitive mindless actions a lot simply because I can't generate the code in a text editor or because FMP doesn't allow to use variables for such script steps as Go to Field.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.