TRM900@PSUVM.BITNET (Tony R. Marasco) (10/05/89)
I have the Tool Box from Blaise Computing that works with TP 4.0. I am
using the windows and menus applications, which work & look great. However,
I am having a problem with the __ZapWin and __ZapMnu commands. It seems
that when I create several menus using the same pointers, it overlays
into other variables...I will explain what I mean in better detail.
My menu application is a calendar. I convert the dates from integers
to strings so I can insert the numbers into the __ItemMnu command. Anyway,
the calendar displays just fine with the ability to move the highlighted
cursor around with arrows, etc. The calendar is to display the previous/
following calendar by hitting PGUP or PGDN, respectively.
What I do is Zap the current window/menu and reconstruct the window
and menu using the new data. This works fine too...so it seems! I have
a variable called "index". This variable contains a pointer that tells
me how many days are in the month, what day the month starts on, etc.
This is included as a parameter at the procedure that builds the calendar.
It is NOT a VAR parameter.
What happens is this: I start the calendar at an arbitrary month (Feb
1989). I can move up to January 1989 and it stops (like it should).
I can move down UNTIL APRIL! After April, it goes back to January! If I
set the month to August 1992, it locks up.
I know what happens in both circumstances, but I don't know why. The
reason it locks is because the index gets reset back to 0. There is no
way this can happen. That is a typical statement from first year
programmers!!!!!
However, in this case, I am correct. If I remove the window create
procedure calls, the variable is fine - it increments and decrements
fine. In fact, I when I removed all but 2 ROWS of the calendar, it
worked fine too! Once I add more rows, it ceases to work.
Apparently, the memory is being corrupted; I have know idea where,
though. Did I overlook something in the book that states that I need
to set memory at xxxx??
Any ideas? Any directions to look? Should I call Blaise?
Any help is GREATLY appreciated.
-------
P.S. If you need the source, I can send it. You NEED the toolbox to
run this, though.
-------
+-------------------------------------------------------------------------+
| Tony Marasco | UUCP: psuvax1!psuvm!trm900 |
| Penn State University | BITNET: trm900@psuvm.BITNET |
| Schuylkill Haven Highway | - or - |
| Schuylkill Haven, PA 17976 | trm900%psuvm.psu.edu@CUNYVM.CUNY.EDU |
| "Questions are a burden for others. Answers are a prison for oneself." |
| -- The Prisoner |
+-------------------------------------------------------------------------+