home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- 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
- From: cjh@holmes.acc.Virginia.EDU (Carol J. Hughes)
- Subject: Re: Clipper 5.01 array problem
- Message-ID: <1992Nov18.164021.3300@murdoch.acc.Virginia.EDU>
- Sender: cjh@virginia.edu
- Organization: University of Virginia
- References: <1992Nov17.102200.12123@fwi.uva.nl>
- Date: Wed, 18 Nov 1992 16:40:21 GMT
- Lines: 57
-
- In article <1992Nov17.102200.12123@fwi.uva.nl> timmer@fwi.uva.nl (Ralf Timmer (I89)) writes:
- >Hi,
- >
- >I've got a Clipper 5.01 question about passing array elements by
- >reference.
- >To manage this I use Straleys :
- >
- > #xtranslate @@<exp> => {|x| IF( x = NIL, <exp>, <exp> := x) }
- >
- >I use this as follows:
- >
- > IF aExtra[1,1] != ""
- > @ nRegel++,47 GET aExtra[1,2] VALID Control(@@aExtra[1,2], nX)
- > ENDIF
- >
- >where Control is like:
- >
- > Function Control(Item,X)
- > ...
- > LOCAL nTemp,....
- >
- > IF VALTYPE(Item) = "B"
- > nTemp := EVAL(Item)
- > ELSE
- > nTemp := Item)
- > ENDIF
- > ....
- > ...
- > ..
- > RETURN .T.
- >
- >This works.
- >
- >But, if I place the above IF..GET..ENDIF in a FOR..NEXT loop, with
- >the index of aExtra is the same as the loop counter it doesn't work
- >anymore!?
- >
- > FOR i:= 1 TO 6
- > IF aExtra[i,1] != ""
- > @ nRegel++,47 GET aExtra[i,2] VALID Control(@@aExtra[i,2], nX)
- > ENDIF
- > NEXT
- >
- >I get an array boundary error at the EVAL call, why?
- >
- >
- >--
- >Ralf Timmer Department of Computer Science
- >Email: timmer@fwi.uva.nl University of Amsterdam
- >--
-
- I think the answer to your question is in Nantucket News
- Volume 5, Number 3 April/May 1992 on page 22.
- There is a similar example there.
-
- Joan Hughes
-
-