home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7774 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.0 KB  |  43 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!slip204.telnet1.QueensU.CA!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: Using streams
  5. Message-ID: <dmurdoch.274.725823872@mast.queensu.ca>
  6. Lines: 31
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <34848@adm.brl.mil>
  10. Date: Thu, 31 Dec 1992 17:44:33 GMT
  11.  
  12. In article <34848@adm.brl.mil> astoner@mcis.messiah.edu writes:
  13. >1.  Is there a way to tell what type of object is being read from a stream?
  14. >I know the stream has to know because it uses the Object ID to call the
  15. >correct Get method, but I haven't been able to determine if my main program
  16. >can tell.  I thought I had read at one place in the manual that you needed
  17. >to keep track of the order things were put on the stream but haven't been
  18. >able to find it again.
  19.  
  20. You can read the signature word yourself, and look it up in your own table.
  21. Alternatively, you can load the object, and call some "self-identify" method 
  22. that you've put in all objects.  There isn't any support for either of these 
  23. in TurboVision, but they aren't hard to add.
  24.  
  25. 2.  Is there a way to conditionally uses a different type of stream in a
  26. >different environment?  For example, my machine has about 5 meg of EMS,
  27. >so an EMS streams is nice.  But if I take it down the hall the computer
  28. >may not have any EMS so a disk based stream would be the solution.  Is
  29. >there a way to determine what type of stream to use in these situations?
  30. >Maybe using compiler directives or something.
  31.  
  32. I did this in my Stream13.zip unit (in garbo.uwasa.fi:/pc/turbovis) by 
  33. creating a function (not an object method) called TempStream, that would 
  34. try to create various streams (EMS, XMS, ram, disk) until it found one that 
  35. worked, and return a pointer to that as a PStream pointer.  It works pretty
  36. well.
  37.  
  38. The new (as yet incomplete) version of the unit lets you create a single 
  39. stream made up of bits and pieces from different sources.
  40.  
  41. Duncan Murdoch
  42. dmurdoch@mast.queensu.ca
  43.