home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / atari / st / tech / 5763 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  2.3 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!unidui!rrz.uni-koeln.de!not-for-mail
  2. From: aeg03@rrz.uni-koeln.de (Jan T. Kim)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: GFA: SWAP *x%,x$() problem worked around
  5. Date: 23 Nov 1992 03:05:37 +0100
  6. Organization: Regional Computing Center, University of Cologne
  7. Lines: 49
  8. Message-ID: <1epe9hINN1oc8@rs1.rrz.Uni-Koeln.DE>
  9. References: <1eo71mINN1889@rs1.rrz.Uni-Koeln.DE>
  10. Reply-To: kim@vax.mpiz-koeln.mpg.dbp.de
  11. NNTP-Posting-Host: rs1.rrz.uni-koeln.de
  12.  
  13. In <1eo71mINN1889@rs1.rrz.Uni-Koeln.DE> aeg03@rrz.uni-koeln.de (Jan T. Kim) writes:
  14.  
  15. [description of trouble deleted]
  16.  
  17. One more observation: GFA seems to fail to keep track what data types are stored in which area. The result of
  18.  
  19. PRINT TYPE(*stb$())
  20.  
  21. is -1, which is supposed to indicate that the passed pointer does
  22. not  point  to  any valid data type. However, it should be 5 (for
  23. pointer to an array of strings). I still don't know what's  going
  24. wrong, but then, that's Richter's or GFA's business...
  25.  
  26. >Unfortunately, it doesn't seem to be possible to write a function
  27. >for  swapping  arrays manually. The problem is, swapping seems to
  28. >swap the internal pointers to the array descriptors  rather  than
  29. >the descriptors themselves. But maybe, I'll have to work on this.
  30. >I'll post to the net if I can find the reasons for the problem or
  31. >ways to work around it anyway.
  32.  
  33. Today, I don't see what made me post that a  working  around  the
  34. problem  by  swapping  the  array descriptors won't work. I found
  35. that it works perfectly. Instead of the  swap  command,  you  can
  36. use:
  37.  
  38. PROCEDURE swapstrarr(VAR p_x%,y$())
  39.   LOCAL p_y%,arrbase_x%,arrbase_y%,anzdim_x&,anzdim_y&
  40.   p_y%=*y$()
  41.   arrbase_x%={p_x%}
  42.   anzdim_x&=INT{p_x%+4}
  43.   arrbase_y%={p_y%}
  44.   anzdim_y&=INT{p_y%+4}
  45.   SWAP arrbase_x%,arrbase_y%
  46.   SWAP anzdim_x&,anzdim_y&
  47.   {p_x%}=arrbase_x%
  48.   INT{p_x%+4}=anzdim_x&
  49.   PRINT {p_x%+4},anzdim_x&
  50.   {p_y%}=arrbase_y%
  51.   INT{p_y%+4}=anzdim_y&
  52. RETURN
  53.  
  54. At least, this seems to do the trick for me now.
  55.  
  56. Greetinx, Jan
  57.  
  58.  +- Jan Kim -- X.400:    S=kim;OU=vax;O=mpiz-koeln;P=mpg;A=dbp;C=de -+
  59.  |             Internet: kim@vax.mpiz-koeln.mpg.dbp.de               |
  60.  |                                                                   |
  61.  *----=<  hierarchical systems are for files, not for humans  >=-----*
  62.