home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 13230 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!portal!sieler
  3. From: sieler@shell.portal.com (Stan Sieler)
  4. Subject: Re: linked pascal proc with C program
  5. Message-ID: <By3ptp.B1r@unix.portal.com>
  6. Sender: news@unix.portal.com
  7. Nntp-Posting-Host: jobe
  8. Organization: Portal Communications Company
  9. X-Newsreader: Tin 1.1 PL3
  10. References: <6814@m1.cs.man.ac.uk>
  11. Date: Sun, 22 Nov 1992 04:58:36 GMT
  12. Lines: 23
  13.  
  14. mbheprg@hpa.ee.man.ac.uk (Raju Gurung) writes:
  15. : Hi,
  16. :     Hope someone can help with this little problem. I'm calling
  17. : typedef double glmma[SPT];
  18. :   glmma a,b;
  19. :   pas(a,b,c);
  20. : ------- testpas.p -----
  21. :         type glmma = array [1..spt] of longreal    ;
  22. :     PROCEDURE pas(VAR m:glmma; VAR n: glmma; p: integer);
  23. : When I checked with the debugger I found that m[0]=a[1],m[1]=a[1],m[2]=a[2]....
  24. : Shouldn't it be m[1]=a[0], m[2]=a[1] ... ?
  25. :    Trying to access m[0] in pas() would give me an error.
  26.  
  27. Your assertion that the debugger shows that m[0]=a[1] troubles me, as
  28. m[0] doesn't exist (the first valid element of m is m[1]), and a[1] is
  29. the second element of a (a[0] is the first).  Are you sure you converted
  30. 0-based to 1-based correctly when using the debugger?  I apologize if this
  31. is an obvious question, but your example made me wonder.
  32.   
  33. Stan Sieler
  34. sieler@allegro.com
  35.  
  36.