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