CompuServe Messages

MODULA-2

    02-Jan-87 20:13:24
Sb: #46823-MODULA-2
Fm: Jim Vogel 73177,441
To: Daryl Anderson 70416,1046
(*To: Michael St. Laurent 72017,235 Michael, though it really feels like cheating, this is how I would do the code you had a question on.*) MODULE Test; FROM Strings IMPORT Assign, String; TYPE DaysArray = ARRAY [0..7] OF String; VAR DayOfWeek : String; DayList : DaysArray; PROCEDURE IniArray(VAR days : DaysArray); VAR n : CARDINAL; BEGIN days[1] := ("SUNDAY"); days[2] := ("MONDAY"); days[3] := ("TUESDAY"); days[4] := ("WEDNESDAY"); days[5] := ("THURSDAY"); days[6] := ("FRIDAY"); days[7] := ("SATURDAY"); END IniArray; PROCEDURE AssignDay (VAR dayname : ARRAY OF CHAR;daynum : CARDINAL); BEGIN Assign(dayname,DayList[daynum]); END AssignDay; BEGIN (*MAIN*) IniArray(DayList); AssignDay(DayOfWeek,3) END Test. (*This code compiles, links, and runs(though it doesn't do much!).Its only 1768 K when compiled.Hope this is some help in what you are trying to do, though there are probably better way's, as I'm stoll learning Mod-2 also. Like all the other reply's, all I can tell you is you can't assign two different TYPE decleration's to each other. Though maybe someone out there with the commercial version can tell us how TDI did it, to make the Strings.Assign procedure?*) (*Jim Vogel*)