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

  1. Newsgroups: comp.databases
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!uvaarpa!murdoch!holmes.acc.Virginia.EDU!cjh
  3. From: cjh@holmes.acc.Virginia.EDU (Carol J. Hughes)
  4. Subject: Re: Clipper 5.01 array problem
  5. Message-ID: <1992Nov18.164021.3300@murdoch.acc.Virginia.EDU>
  6. Sender: cjh@virginia.edu
  7. Organization: University of Virginia
  8. References: <1992Nov17.102200.12123@fwi.uva.nl>
  9. Date: Wed, 18 Nov 1992 16:40:21 GMT
  10. Lines: 57
  11.  
  12. In article <1992Nov17.102200.12123@fwi.uva.nl> timmer@fwi.uva.nl (Ralf Timmer (I89)) writes:
  13. >Hi,
  14. >
  15. >I've got a Clipper 5.01 question about passing array elements by
  16. >reference.
  17. >To manage this I use Straleys :
  18. >
  19. >  #xtranslate @@<exp> => {|x| IF( x = NIL, <exp>, <exp> := x) }
  20. >
  21. >I use this as follows:
  22. >
  23. >  IF aExtra[1,1] != ""
  24. >     @ nRegel++,47 GET aExtra[1,2] VALID Control(@@aExtra[1,2], nX)
  25. >  ENDIF
  26. >
  27. >where Control is like:
  28. >
  29. >  Function Control(Item,X)
  30. >     ...
  31. >     LOCAL nTemp,....
  32. >
  33. >     IF VALTYPE(Item) = "B"
  34. >        nTemp := EVAL(Item)
  35. >     ELSE
  36. >    nTemp := Item)
  37. >     ENDIF
  38. >     ....
  39. >     ...
  40. >     ..
  41. >   RETURN .T.
  42. >
  43. >This works.
  44. >
  45. >But, if I place the above IF..GET..ENDIF in a FOR..NEXT loop, with
  46. >the index of aExtra is the same as the loop counter it doesn't work
  47. >anymore!?
  48. >
  49. >   FOR i:= 1 TO 6
  50. >      IF aExtra[i,1] != ""
  51. >         @ nRegel++,47 GET aExtra[i,2] VALID Control(@@aExtra[i,2], nX)
  52. >      ENDIF
  53. >   NEXT
  54. >
  55. >I get an array boundary error at the EVAL call, why?
  56. >
  57. >
  58. >-- 
  59. >Ralf Timmer                                     Department of Computer Science
  60. >Email: timmer@fwi.uva.nl                        University of Amsterdam
  61. >--
  62.  
  63. I think the answer to your question is in Nantucket News
  64. Volume 5, Number 3 April/May 1992 on page 22.
  65. There is a similar example there.
  66.  
  67. Joan Hughes
  68.  
  69.