Computer Science Canada Claytons' Conundrum With Reading & Writing Complete Type Records To File |
Author: | ClayWall [ Tue Jan 04, 2011 1:51 pm ] | ||
Post subject: | Claytons' Conundrum With Reading & Writing Complete Type Records To File | ||
What is it you are trying to achieve? I have created a type inside of a module, which I'm trying to write to file with another module, by calling a procedure outside of itself. Then I try to read that file. I am only reading and writing the variable of said type, not each of the variables inside the record . What is the problem you are having? When I run the program it writes to file, I then try to read the file and get and warning saying "'whateverVar' is read-only in this scope and cannot be modified by 'read'" Describe what you have tried to solve this problem I run the program anyways, and output the data which shows that it has in fact read the data just fine and placed it in the proper variables with no errors, but the problem is the warning message will interfere every time I run the program, so I'm not sure if maybe I'm missing something or have things in an improper order. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1 Final note If this seems to hard to understand I will post proper code, but I tried to remain short and sweet. Thanks in advance. |
Author: | TokenHerbz [ Tue Jan 04, 2011 3:04 pm ] |
Post subject: | RE:Claytons\' Conundrum With Reading & Writing Complete Type Records To File |
Have you looked into export/import. these are useful things to know when working with modules or classes. |
Author: | DemonWasp [ Tue Jan 04, 2011 3:39 pm ] |
Post subject: | RE:Claytons\' Conundrum With Reading & Writing Complete Type Records To File |
Answer: Turing is probably poorly-implemented. You can probably skip the warning with export var newInfo. |
Author: | ClayWall [ Tue Jan 04, 2011 7:04 pm ] |
Post subject: | RE:Claytons\' Conundrum With Reading & Writing Complete Type Records To File |
TokenHerbz: That was just a pseudo-code example, sorry I should have made better mention of that. DemonWasp: Aha, something so simple, as always. That did the trick, I never thought to add "var". Thanks for the help. |