home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!cs.utexas.edu!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!unidui!rrz.uni-koeln.de!not-for-mail
- From: aeg03@rrz.uni-koeln.de (Jan T. Kim)
- Newsgroups: comp.sys.atari.st.tech
- Subject: GFA: Compiled program bombs at SWAP *x%,x$()
- Date: 22 Nov 1992 15:55:50 +0100
- Organization: Regional Computing Center, University of Cologne
- Lines: 60
- Message-ID: <1eo71mINN1889@rs1.rrz.Uni-Koeln.DE>
- Reply-To: kim@vax.mpiz-koeln.mpg.dbp.de
- NNTP-Posting-Host: rs1.rrz.uni-koeln.de
-
- Hi tech folks,
-
- I have run into an annoying problem with the GFA basic 3.6TT
- system. The command mentioned in the subject causes the compiled
- program to exit with two bombs, or sometimes to exit wit an
- "Error 64" alert box. However, in the interpreter the program
- runs without such a problem.
- This takes place on a TT, in TT med resolution, no matter whether
- the TT ram bits are set or not.
- I have tried to write a short program that reliably reproduces
- the error, without success. Therefore, I include an outline of
- what I do in the program that causes the trouble:
- The program is GEM-based and menu driven. It loads stuff from
- files into string arrays, and this stuff can then be displayed in
- windows. There can be several windows, which can all be redrawn
- by the same routine. Therefore, I chose to store the the pointer
- to the array which is shown in a window in some window-specific,
- MALLOC()'ed chunk of memory. When it comes to redrawing, the
- redraw routine retrieves the pointer, called p_st%, from the
- memory. It creates a dummy array, swaps the pointers, draws the
- window acessing the dummy array which is the real array because
- of the swapping. When redrawing is done, the arrays are swapped
- again and the dummy array is erased. In GFA code, that is:
-
- PROCEDURE redraw(w_handle&,x&,y&,w&,h&)
- LOCAL p_st%, ...
- DIM d$(0)
- a%=@w_adr(w_handle) !determine pointer to window-specific stuff
- p_st%={a%+176}
- ~FORM_ALERT(1,"[1]["+STR$(p_st%)+"|"+str$(*stb$())+"][ Ok ]")
- SWAP *p_st%,d$()
- .
- . (redraw the stuff)
- .
- SWAP *p_st%,d$()
- ERASE d$()
- RETURN
-
- The alert box reveals that p_st% and *stb$() are identical, so
- the problem is not that GFA basic has shuffled the array around
- and the pointer once stored is no longer pointing to the current
- location of the array descriptor.
- Unfortunately, it doesn't seem to be possible to write a function
- for swapping arrays manually. The problem is, swapping seems to
- swap the internal pointers to the array descriptors rather than
- the descriptors themselves. But maybe, I'll have to work on this.
- I'll post to the net if I can find the reasons for the problem or
- ways to work around it anyway.
-
- BTW, a while ago someone mentioned he had a list of known GFA
- bugs. I'd appreciate if this could be mailed to me.
-
- Thanx in advance
-
- Greetinx, Jan
-
- +- Jan Kim -- X.400: S=kim;OU=vax;O=mpiz-koeln;P=mpg;A=dbp;C=de -+
- | Internet: kim@vax.mpiz-koeln.mpg.dbp.de |
- | |
- *----=< hierarchical systems are for files, not for humans >=-----*
-