home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7685 < prev    next >
Encoding:
Internet Message Format  |  1992-12-25  |  1.4 KB

  1. Path: sparky!uunet!haven.umd.edu!mimsy!nocusuhs!nmrdc1!frmug!lill!vanney.raphael
  2. From: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
  3. Newsgroups: comp.lang.pascal
  4. Subject: BRAINS REQUIRED HERE PLEA
  5. Message-ID: <1027.6.uupcb@lill.frmug.fr.mugnet.org>
  6. Date: 23 Dec 92 21:43:00 GMT
  7. Reply-To: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
  8. Organization: Li'LL BBS - Paris, France
  9. Lines: 33
  10.  
  11. Hello !
  12.  
  13. MC>Okay all you intelligent, wonderful, experts out there....,
  14.  
  15. Hey, did we happen to meet before ?
  16.  
  17. MC>why is it that
  18. MC>when I add more than one record in this procedure, the value of Index
  19. := 0
  20. MC>and then another procedure states, out of Range.....error when I try
  21. MC>to access it.
  22.  
  23. Make sure the GLOBAL version of your Index variable is initialized...
  24.  
  25. MC>procedure add_a_record(Movies : Collection; Index : Integer);
  26.  
  27. Looks like your "Index" parameter is passed by value, not by address ;
  28. hence,
  29. any modification made down here do not affect the global variable, but
  30. only
  31. the copy created by the compiler for the procedure's use.
  32. Try changing to :
  33.  
  34. MC>Procedure Add_a_Record(Movies : Collection; Var Index : Integer) ;
  35.  
  36. Merry Christmas,
  37.  
  38. Alp,                                              Raphael.
  39.  
  40.  * OLX 2.1 TD * On dirait que mon olmr fonctionne, non ?
  41. --- FMail 0.92
  42.  * Origin: ICEBERG - La Garenne * FRANCE * Tel:(33)-1-47699261 (2:320/1)
  43.                                                                   
  44.