Custom properties with variable names.
Posted: Sun Oct 07, 2012 3:59 am
I'm writing a program to check a student's schedule, based on the output of our student management software. I don't want to depend on an external file to read this information every time, so I am planning on doing the launcher-mainstack combo when I create my standalone app so that I can save the schedule in a custom property or other field in the mainstack of my application and have it persist from session to session. I cannot depend on the output of that software to be consistently formatted, so I need to detect which header columns in the source file contain the word "Period." I am having some trouble using a repeat to create my custom properties for this information. Here is what I am trying to do:
In case it isn't clear, what I'm trying to do is create 7 custom properties, each of which is called "periodOffset" + the number of occurrences of the word so far in the loop.
When I try to run the command this way, I get an error:set: no property specified. If I take out the attempt at concatenation of i, it works fine. The same thing applies to the last argument in the wordoffset function, where I get an error: Expression: bad factor.)
First off, is it possible to do what I'm trying to do, and if so, how do I do it?
Second, is this the correct way to go about this task? Apparently my account is not allowed to post links, but the lesson titled "How do I save custom properties in a standalone application?" suggests that using custom properties to save information between sessions, but I'm wondering why this can't just be done with a hidden text field. They seem much easier to work with.
Code: Select all
repeat with i = 1 to 7
set the periodOffset & i of this stack to wordoffset("Period", line 1 of allschedules, the periodOffset & i of this stack)
end repeat
When I try to run the command this way, I get an error:set: no property specified. If I take out the attempt at concatenation of i, it works fine. The same thing applies to the last argument in the wordoffset function, where I get an error: Expression: bad factor.)
First off, is it possible to do what I'm trying to do, and if so, how do I do it?
Second, is this the correct way to go about this task? Apparently my account is not allowed to post links, but the lesson titled "How do I save custom properties in a standalone application?" suggests that using custom properties to save information between sessions, but I'm wondering why this can't just be done with a hidden text field. They seem much easier to work with.