Jump to content
Excelsior Forums

oo

Members
  • Content count

    0
  • Joined

  • Last visited

    Never

Everything posted by oo

  1. Thanks a lot

    Hi, I just wanted to say thank you for all the help I received in this forum. I needed to help my professor compile some of his old Modula 2 code written for TopSpeed Modula2. I think I finished this job at the end of last week. I did have some problems ? but I think they are with the code itself ? not with the compilation. I would like to especially thank sleepyhead for helping me through all of this. I don?t think I would get back into Modula2 at least for the next few months ? or possibly forever. Regards, O.O.
  2. Thanks a lot

    You are welcome sleepyhead O.O.
  3. Hi, Thank you guys for helping me in the past. I have yet not got my thing to work ? but I have a question: How do I call an external executable from Modula 2? In TopSpeed my code has FROM Lib IMPORT Exec; --> For the Import Statement And i:=Exec("hh_prog",as,NIL); For calling the external executable ?hh_prog.exe? Is this correct?, because it seems that my external executables are not getting called. Thanks again for your help. O.O.
  4. Dear sleepyhead, Thanks for your reply. I am sorry I could not get back to you earlier ? I am in the middle of my exams. I think the addition of the *.exe was the problem. Another problem was one of the executables was being called with the wrong parameters ? I don?t know why this was wrong though. This thing still does not work completely ? but I am working on it. Thank you for your help O.O.
  5. Hi, I wanted to add that as is defined as: as:Strin and from another module: Strin = ARRAY [0..inlen] OF CHAR; I looked into Lib.def inside TS and it shows me: PROCEDURE Exec (command :ARRAY OF CHAR; Params :ARRAY OF CHAR; Env :ExecEnvPtr) :CARDINAL; So is the problem with as or with the NIL for Env? Thanks a lot. O.O.
  6. Hi, I am trying to get some old Top Speed Modula 2 Code to work. It had a lot of For-Loops where it used a global variable as the control variable. It also tried to assign the control variable inside the loop ? in order to make a quick exit out of the loop. For example it had something of the form: FOR i5:=0 TO Pbdim DO IF (Something here) THEN i5:= Pbdim; END; END I have declared a new local variable i5_extra, and a Boolean breakLoop locally. I have modified my loop as breakLoop:=FALSE; FOR i5_extra:=0 TO Pbdim DO IF breakLoop = FALSE THEN IF (Something here) THEN breakLoop:=TRUE; END; END; END; i5:=i5_extra; My program crashes at the last line i.e. i5:=i5_extra; Is it because the local variable somehow disappears?? I feel that it should be in scope as it is defined for the entire procedure. I get the error of the form: ?RTS Exception #3: invalid location? The above is an example ? my code is much longer than this. Thanks for your help. O.O.
  7. Thanks to the two of you for your comments. I never expected that the variable would end up being undefined after the loop. Just a last question before I consider making huge modifications to my code Is there a way to prematurely exit from a For loop? I know that Exit works to get out of a While loop. Does something analogous exist for a For loop. Thanks a lot to you guys. O.O.
  8. Hi, I am compiling some old TopSpeed Modula 2 Code with the XDS Compiler. I compiled the individual modules after making some modifications and they compiled. I then compiled the Main Module ? and got the executable. However, when I run the exe ? I simply get a blank screen. The program does not crash or anything ? but I get nothing there. The beginning of the program does absolutely nothing other than write some text to the screen and then wait for the user to input the name of a file. So I copied the first 2 lines from the program (in addition to some include statements) into the ?Hello World? example that you have ? I compiled this with the same flags that I compiled my program. This ?Hello World? seemed to output the text ? however the executable does not seem to be able to do it i.e. it has a blank screen. Does anyone have an idea what I might be doing wrong? I then deleted all of the lines in the original Module and just put in something like IO.WrStr("Hi?); I compiled it ? but still I don?t get any output? Any ideas?? Thanks a lot to you guys. O.O.
  9. Hi, I have a project that I have managed to compile using the XDS Native x86 Compiler (though it does not quite execute.) I then tried the C compiler without changing anything in the files, and it complains that it could not find ?IO.sym?. My errors look like * [parallel.mod 3.06 F425] * file open error: "IO.sym" no such file FROM $IO IMPORT WrStr; My command line looks like: xm =m -WOFF+ +STORAGE +topspeed +M2 +M2EXTENSIONS OMAIN.MOD I would be grateful if someone has some ideas on how to get rid of this error. Thanks a lot. O.O.
  10. Thanks again sleepyhead. This did it for me. I went thorough all of my files replacing IO with IO_ and everything compiled. I now have to read your ReadMe file to see how to get this to further compile in C or C++. Perhaps I would do that over the weekend. Thanks again. O.O.
  11. Dear sleepyhead, I hate to be telling you this ? because actually in your very first post ? you had suggested that I do this. I had the module WINDOW in one of the Implementation Modules. This screwed things up Big Time. I can swear that I searched all of my modules ? but I don?t know how I did not catch this. I guess the first time I searched through the Windows Explorer telling it to search for the text in all of the files in the compilation directory ? this did not work, because it somehow recognizes the MOD files as some kind of movie files and considers them binary. I then searched using a text editor ? but then my import had ?Window? instead of WINDOW (which I copied from your post) ? and I missed it again. Yes, I do get the output on the screen ? but now my program crashes somewhere. I would have to spend time debugging it now. Thank you for your persistent help. O.O.
  12. Thanks sleepyhead for clarifying this, but then I don?t know what I might be doing wrong here?? O.O.
  13. Hi, I just wanted to add this ? if it would help. Though I have a number of modules, I have not specifically created a ?project? per se. I simply compile the Main Module with the other modules in the same folder ? and the XDS Compiler generates the object files for each of the other modules, and then the executable file for the Main Module. Is this the wrong way to do this?? I am compiling the main module with the following at the commandline: xc =m -WOFF+ +STORAGE +topspeed +m2addtypes +M2EXTENSIONS OMAIN.MOD where OMAIN.MOD is the name of my Main Module. Is this OK? O.O.
  14. Good Question snowman, I did not think of this. However, I did not expect some library modules to screw things up. Below I am trying to make a list of some of the Library Modules that my Modules in totality import: IMPORT Str; IMPORT IO; IMPORT BiosIO; FROM Lib IMPORT Exec, GetTime; FROM FIO IMPORT Open, File, Close, WrStr, WrLn, RdChar, RdStr,RdCard,WrCard, Create; FROM Storage IMPORT ALLOCATE,DEALLOCATE; I think this is all ? but there may be more. I am not sure if I missed any though. O.O.
  15. Dear sleepyhead, Actually none of my modules other than the Main Module have a body. Each of them define functions. So when they import each other ? as none of them have a body, nothing should be executed. Consequently, the program should not be affected. However for me the program does get affected. This is what puzzles me. As I mentioned in my post above, I stepped through it with the debugger ? and I could not find anyline getting executed other than the END statements in each of the remaining modules. O.O.
  16. Hi, In addition to my previous post above, I tried stepping through the program using the debugger. It seems that it first starts with the BEGIN statement in my Main Module. Then it executes the END statements in the ?Implementation Modules??? After it gets through all of the END statements in the ?Implementation Modules? it starts executing the real program i.e. to output a string to the console. So I am still clueless to what exactly gets executed in the ?Implementation Modules??? O.O.
  17. Dear sleepyhead and snowman, Thanks for responding. I am not familiar with Modula 2 ? so take my descriptions and discussions with that in mind. I might just be missing something obvious. I have noticed that if I import modules into my main module ? the main module does not print out anything. Now, snowman seems to say that the body of the imported module gets initialized. What is body? I am not sure if I understood this. My main module does have a body in the sense it has a BEGIN and END statements. My other modules are defined as ?IMPLEMENTATION MODULE module_name;? at the top ? and do not have a BEGIN statement i.e. they just define a bunch of procedures. So where is the initialization?? Yes, I can provide you a sample ? but first I would like to know what gets executed in the ?Implementation Modules?? I am asking this question, because importing these changes the way my program executes. Thanks a lot. O.O.
  18. Dear sleepyhead, I have found that if I include any other module other than IO i.e. any one of my personally created modules, I get no output when the only line in my program is IO.WrStr("Hi?); I don?t see how importing unused modules should cause different program behavior. Is this a bug?? Also I get a blank screen when I double click on the executable in windows ? but when I run it from the command prompt, I simply get a single blank line. Thanks for you help. O.O.
  19. Thanks sleepyhead for your faithful responses. So you mean I should put: IMPORT WINDOW; In the import statements that I already have in my program. Right now it does not have this ?IMPORT WINDOW;? anywhere in any of my modules. Also when I do this I get the following error: * [DECMAIN.MOD 15.14 F194] * module name does not match symbol file name "WINDOW" IMPORT WINDOW$; Thank you for your help. O.O.
  20. I would just like to add that by deleting the big number of imports at the top of the file ? then it obviously works as expected i.e. outputting the Hi. But why would using imports cause it to output nothing. O.O.
  21. Hi, In compiling some old code, I am getting errors of the form: --------------- * [PARTS.MOD 33.22 E029] * incompatible types: "OPEN ARRAY OF CHAR" "CHAR" gl:=Str.StrToCard(dot$[g],10,bool); ----------------------- The corresponding line is gl:=Str.StrToCard(dot[g],10,bool); Here, g1 and g are CARDINAL, dot is defined as dotType where dotType = ARRAY [0..99] OF CHAR; Finally bool is BOOLEAN. Thanks to any one who has ideas? O.O.
  22. Thanks for your quick reply. The +m2addtypes command line options fixed my problem immediately. (Though I have a lot of problems before I can get this to compile.) Thanks again. O.O.
  23. Hi, I hope you guys would not mind another question. I am trying to compile some old code, and I get a number of errors of the form: * [VERIFICA.MOD 55.11 E147] * threatened variable is not allowed here FOR i2$:=0 TO b-1 DO * [VERIFICA.MOD 56.49 E158] * control variable "i2" is threatened here IF presrow^.outd[i2] # "-" THEN ab:=TRUE; $i2:=b-1 END; This means that the compiler does not like the assignment to i2 in the loop where it is the control variable. My professor who wrote this code told me that when he used the TopSpeed Compiler years ago and this was acceptable then. So, is there a way to override this error ? because otherwise there are just too many instances of this in the code? Thank you for your support. O.O.
  24. Thanks sleepyhead for clarifying that this is part of the standard. I think I might have to rewrite some of my code ? if it is not too complicated. I am thinking of simply declaring an extra variable in these circumstances to do the job. But this may not always work. I am busy with some other work now. I would get to this in a week or two. I would let you know when I have a few more questions, or when I get this done or give up. Regards, O.O.
  25. Thanks sleepyhead. So is this standard. If yes, then I might consider rewriting the code. If not then I would try other compilers. Thanks a lot. O.O.
×