home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / ada / 2507 < prev    next >
Encoding:
Text File  |  1992-09-01  |  1.4 KB  |  34 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!decwrl!csus.edu!beach.csulb.edu!elliottm
  3. From: elliottm@beach.csulb.edu (Mike Elliott)
  4. Subject: pragma INTERFACE to MTH$RANDOM in DEC ADA?
  5. Message-ID: <ELLIOTTM.92Sep2032817@beach.csulb.edu>
  6. Lines: 18
  7. Sender: elliottm@beach.csulb.edu (Mike Elliott)
  8. Organization: Cal State Long Beach
  9. Date: Wed, 2 Sep 1992 10:28:20 GMT
  10.  
  11. I've gotten stuck trying to interface to the VMS math library routine
  12. MTH$RANDOM, which takes the address of an integer seed as its argument, and
  13. returns a FLOAT.  Ada rightly complains if I declare my routine as a function
  14. taking an in out INTEGER parameter, but my other attempts to trick DEC ADA into
  15. iterfacing to this routine have also failed.  They include
  16.  
  17.    1) declaring the function to take a parameter of type access INTEGER, which
  18.       points to an actual intger which can be changed (the INTEGER pointed to
  19.       remains immutable),
  20.  
  21.    2) declaring the function to take a parameter of type SYSTEM'ADDRESS, and
  22.       passing it the address of some integer (the INTEGER at said address
  23.       remains stubbornly unchanged).
  24.  
  25. I'm sure there's some way to do this, but my only two DEC ADA manuals shed no
  26. light on how.  They do illustrate how to interface to routines like MTH$SQRT,
  27. which rightly take a parameter of type in FLOAT, and these attempts have been
  28. successful. 
  29. -- 
  30.  
  31.  
  32.                                            Mike Elliott
  33.                                            elliottm@beach.csulb.edu
  34.