NocturnalTrance
06-09-2007, 05:10 PM
Hi again fellow nerds!
As my MEL application is beginning to take its form, i am now
in the need of programming the preferences for this tool. That
means reading preference data from a file, making the MEL
application act/change according to that data and finally storage
preference configuration data back to this file.
I've been trying to find a way to do this, but i've done something
wrong, it seems. As i see it, the procedure for reading preference
data from another file, would look somewhat like:
- defining a string for the dir/filename
- using the fGetLine and cycle through every line in the file and execute those individual lines (eg. $StartupSubject = 2; - this is supposed to decide which subject should be shown at startup (for instance, subject 1 is 'Animation', subject 2 is 'Modeling' etc.))
- when all lines have been executed it's a matter of attaching the strings to the appropriate controls in the MEL application
writing preference data back to a file, i haven't thought about it yet, but i suppose it would be something like using the fOpen to open the file, deleting it's content, writing all the new content by a print command or something like that.
But, i have a problem with the cycle-through the lines in reading the data. That's my question, how would such code look like? .. mine returns only the first line in the file, it won't cycle through all the lines .. i won't put in my code in this thread as it is not on this computer. But if you know how to get this to work, please tell me! :)
As my MEL application is beginning to take its form, i am now
in the need of programming the preferences for this tool. That
means reading preference data from a file, making the MEL
application act/change according to that data and finally storage
preference configuration data back to this file.
I've been trying to find a way to do this, but i've done something
wrong, it seems. As i see it, the procedure for reading preference
data from another file, would look somewhat like:
- defining a string for the dir/filename
- using the fGetLine and cycle through every line in the file and execute those individual lines (eg. $StartupSubject = 2; - this is supposed to decide which subject should be shown at startup (for instance, subject 1 is 'Animation', subject 2 is 'Modeling' etc.))
- when all lines have been executed it's a matter of attaching the strings to the appropriate controls in the MEL application
writing preference data back to a file, i haven't thought about it yet, but i suppose it would be something like using the fOpen to open the file, deleting it's content, writing all the new content by a print command or something like that.
But, i have a problem with the cycle-through the lines in reading the data. That's my question, how would such code look like? .. mine returns only the first line in the file, it won't cycle through all the lines .. i won't put in my code in this thread as it is not on this computer. But if you know how to get this to work, please tell me! :)
