home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3240 < prev    next >
Encoding:
Text File  |  1992-11-05  |  1.6 KB  |  47 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!bdwheele
  3. From: bdwheele@silver.ucs.indiana.edu (Brian Wheeler)
  4. Subject: Re: visual basic question 
  5. Message-ID: <Bx8yJs.M8K@usenet.ucs.indiana.edu>
  6. Sender: news@usenet.ucs.indiana.edu (USENET News System)
  7. Nntp-Posting-Host: silver.ucs.indiana.edu
  8. Organization: Indiana University
  9. References: <BwwBnt.Ju5@undergrad.math.waterloo.edu>
  10. Date: Thu, 5 Nov 1992 14:21:28 GMT
  11. Lines: 34
  12.  
  13. In <BwwBnt.Ju5@undergrad.math.waterloo.edu> rcsteele@cantor.math.uwaterloo.ca (Robert C Steele) writes:
  14.  
  15. >Hi.  Why cant an array be passed as both BYVAL and as call by reference?
  16. >When i try to do something like:
  17.  
  18. >    sub test(Byval Data_Array() as integer)
  19.  
  20. >it doesnt work.  The manual & help says that all user defined types are passed
  21. >BYVAL but nothing about arrays.
  22.  
  23. >Thanks in advance,
  24. >Rob
  25.  
  26. Why do you need to pass an array by BYVAL?  If you're wanting to alter a copy
  27. of the array in the sub but don't want to alter the original, I think you can
  28. put parens around the variable and it will make a copy of it (it works for
  29. non arrays).
  30.  
  31. ex:  
  32. Sub Test (Index as Integer, AnArray() as Integer)
  33. ...
  34. End Sub
  35.  
  36. Test 5,(AnArray())
  37.  
  38. This might work.  
  39.  
  40.     Brian Wheeler
  41.     I could be wrong, ya know!
  42. -- 
  43. ******************************************************************************
  44. * Brian 'Nautical' Wheeler - These are my opinions, do you hear me?  MINE!
  45. * "Wombats are our friends" - Me
  46. ******************************************************************************
  47.