home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / 7905 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.5 KB  |  61 lines

  1. Newsgroups: comp.databases
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!gene.fwi.uva.nl!timmer
  3. From: timmer@fwi.uva.nl (Ralf Timmer (I89))
  4. Subject: Clipper 5.01 array problem
  5. Message-ID: <1992Nov17.102200.12123@fwi.uva.nl>
  6. Sender: news@fwi.uva.nl
  7. Nntp-Posting-Host: gene.fwi.uva.nl
  8. Organization: FWI, University of Amsterdam
  9. Date: Tue, 17 Nov 1992 10:22:00 GMT
  10. Lines: 49
  11.  
  12. Hi,
  13.  
  14. I've got a Clipper 5.01 question about passing array elements by
  15. reference.
  16. To manage this I use Straleys :
  17.  
  18.   #xtranslate @@<exp> => {|x| IF( x = NIL, <exp>, <exp> := x) }
  19.  
  20. I use this as follows:
  21.  
  22.   IF aExtra[1,1] != ""
  23.      @ nRegel++,47 GET aExtra[1,2] VALID Control(@@aExtra[1,2], nX)
  24.   ENDIF
  25.  
  26. where Control is like:
  27.  
  28.   Function Control(Item,X)
  29.      ...
  30.      LOCAL nTemp,....
  31.  
  32.      IF VALTYPE(Item) = "B"
  33.         nTemp := EVAL(Item)
  34.      ELSE
  35.     nTemp := Item)
  36.      ENDIF
  37.      ....
  38.      ...
  39.      ..
  40.    RETURN .T.
  41.  
  42. This works.
  43.  
  44. But, if I place the above IF..GET..ENDIF in a FOR..NEXT loop, with
  45. the index of aExtra is the same as the loop counter it doesn't work
  46. anymore!?
  47.  
  48.    FOR i:= 1 TO 6
  49.       IF aExtra[i,1] != ""
  50.          @ nRegel++,47 GET aExtra[i,2] VALID Control(@@aExtra[i,2], nX)
  51.       ENDIF
  52.    NEXT
  53.  
  54. I get an array boundary error at the EVAL call, why?
  55.  
  56.  
  57. -- 
  58. Ralf Timmer                                     Department of Computer Science
  59. Email: timmer@fwi.uva.nl                        University of Amsterdam
  60. --
  61.