HDTenEightyP/NetNews huggingface dataset:
From: ecec@quads.uchicago.edu (Eric Cabot)
Subject: Re: Resetting IOResult
Reply-To: ecec@midway.uchicago.edu
Organization: University of Chicago Computing Organizations
Date: Wed, 15 Apr 1992 14:51:08 GMT

As previous posters have pointed out, a call to ioresult resets
its value to 0.  For this reason, to perform mulitple checks
of the value returned from a single IO-operation  you should use your
single call to ioresult to set some word variable.

Here's what I mean:

var ierr:word;
 ...
 ...
 repeat 
   readln(f,x);
   ierr:=ioresult;            
   if ierr<>0 then writeln('IO error')
              else {do something}
 until ierr<>0;



 
-- 
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    Eric Cabot                      CHICAGO: City of fire, wind and water. 
ecec@midway.uchicago.edu
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Newsgroups: comp.lang.pascal
From: jeb2@po.CWRU.Edu (Jared E. Bendis)
Subject: Help: Fast Graphics Output
Reply-To: jeb2@po.CWRU.Edu (Jared E. Bendis)
Organization: Case Western Reserve University, Cleveland, OH (USA)
Date: Fri, 10 Apr 92 03:44:12 GMT



I Have seen a lot of people avoiding using functions like
Line and putpixel with functions like regs?? which I just
dont know how to use beyond faking what someone has sent me.

Does anyone have a good place to explain this, or could someone
send me some information here or in email :) on the hows and why's

Im just loooking to getthe graphics written faster, thats all.

Thanks

JAred


-- 
But come ye back when Summer's in the meadow,   | Jared Bendis aka Gigolo
Or when the valley's hushed and white with snow.| Depts Psychology & Physics
'Tis I'll be there in sunshine or in shadow.    | Composer and Conductor
Oh Danny Boy, Oh Danny Boy I love you so.       | Computer Consultant
Newsgroups: comp.lang.pascal
From: friesenda@skyfox.usask.ca
Subject: RE: Units using Units
Organization: University of Saskatchewan
Date: Mon, 6 Apr 1992 08:07:52 GMT

In a previous article, J_SCHULL@acc.haverford.edu (Jonathan Schull) wrote:
> 
>Suppose MyProgram Uses UnitShallow;
> 
>Suppose UnitShallow Uses UnitDeep;
> 
>To create MYPROGRAM.EXE, do 
>  I need to have UNITDEEP.TPU as well as UNITSHALLOW.TPU, 
>  or  can I do it with just MYPROGRAM.PAS and UNITSHALLOW.TPU  ?
> 
>I seem to be needing both, but I want to only need UnitShallow.

I think you need them both.  My understanding is:

a)  Compiler looks at MYPROGRAM.PAS and sees the USES UnitShallow
    clause.  It decides it better compile UnitShallow.

b) compiler looks at UnitShallow and sees the Uses UnitDeep clause.
   It decides it better compile UnitDeep.

c) Compiler compiles UnitDeep. Return to UnitShallow and finishes
   compiling it. Returns to MyProgram.pas and compiles it into
   MyProgram.exe.

Wait, I could be wrong. You said you have UnitShallow.TPU? Try the
Compile command under the Compile menu (ie. not Build or Make). I 
think the compiler checks the dates (or something) of the UnitShallow
PAS and TPU files. If UnitShallow.PAS hasn't been changed since the
TPU was made then it should do what you want. I could be wrong though.
It's happened before :-)

There's an answer, for what its worth.

Darryl Friesen
friesenda@sask.usask.ca
Univ. of Saskatchewan
From: llopisar@ecs.umass.edu
Newsgroups: comp.lang.pascal
Subject: Re: In TP6, How can CTRL-BREAK be shut off?
Date: 11 Apr 92 22:55:07 GMT

I would use some assembly there (using TP 6 is a piece of cake). Just redirect the INT 1B to another address with a RETI into it and then just restore it back to the original when you are done.
For more info or the full source code on how to do it you can give a call to BINARY CODE @ 413-546-0090 from 6:00PM to 11:00PM any day. (that's if you want it really bad :)
In article <92094.091154LHZ100@psuvm.psu.edu>, Louis Zechtzer <LHZ100@psuvm.psu.edu> writes:
> Hi,
>   I am trying to find a way to shut off Ctrl-Break while using TP6.  I
> looked at the SetCBreak command in the DOS unit, but I am reading a key
> (using ReadKey) from the console, so SetCBreak won't work for me.
> 
> -Lou Zechtzer
> -LHZ100@PSUVM.PSU.EDU
From: sab@reef.cis.ufl.edu (Shawn Berg)
Newsgroups: comp.lang.pascal
Subject: Fast Get/Put Pixel routines needed
Date: 11 Apr 92 21:54:40 GMT
Organization: Univ. of Florida CIS Dept.

I'm looking for some code that will have the same behavior as GetPixel
and PutPixel, but is much faster, to use with TP6 in VGA mode.  Can 
anyone tell me where I could find something like that?

Thanks,
Shawn Berg
Newsgroups: comp.lang.pascal
From: ts@uwasa.fi (Timo Salmi)
Subject: Re: Source to do exponents needed!(Long)
Organization: University of Vaasa, Finland
Date: Mon, 6 Apr 1992 17:51:08 GMT

In article <1992Apr2.212753.2571@vax1.umkc.edu> khill@vax1.umkc.edu writes:
>	A recent inquiry requested code to perform the function y=a^b in
>Pascal.  There have been many replies in this group -- I even e-mailed a

[Ken's interesting and instructive treatise of the subject deleted]

>	Well, I've wasted enough bandwidth on a topic that is in the FAQ.
>However, with all the bad info floating around I figured I'd better straighten
>some things out.

>| Ken Hill              | The opinions in this letter are not mine.  They were |
>| Amateur Mathematician | created by an evil computer with a mind of its own!  |

My best compliments to Ken.  He did a very nice thing here, and
there is NOTHING wrong with discussing a FAQ in depth on the net. 
No bandwidth was certainly wasted. 

People are sometimes a bit too sensitive about FAQs.  It is useful
and ok to point to a FAQ collection (I do it all the time), but
there is nothing intrinsicly bad about asking a FAQ.  How else could
a FAQ become a FAQ anyway. 

...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.87.1
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun
Newsgroups: comp.lang.pascal
From: clane@libws1.ic.sunysb.edu (Charles F Lane)
Subject: TSPEECH.ZIP, Digitized sound with Turbo Pascal
Originator: clane@libws1.ic.sunysb.edu
Organization: State University of New York at Stony Brook
Date: Tue, 14 Apr 1992 17:59:44 GMT

    Anyone able to get TSPEECH.ZIP (on FTP sites) to work?  No documentation
is included.  Is a sound card needed to use it?  A .bin file is included.
I assumed it had to be converted to .obj using BIN2OBJ.exe and declared
external.  When a test program is run the computer hangs.
    Anyone know of any digitized-sound-file packages for Turbo Pascal
that use the PC speaker?  Maybe where you mail away tapes of sounds and 
they send 'em back in digitized files to use in Turbo Pascal programs.

-- 
                          |"There are pearls to be had here, but you have to
Charles F. Lane           |break open the oysters."  My geology prof to a class
clane@Libws1.ic.sunysb.edu|w/no questions at a review 2 days before an exam.
From: exuhag@exu.ericsson.se (James Hague)
Newsgroups: comp.lang.pascal
Subject: Re: Norbert Juffa's bug list (part 1 of 2)
Date: 8 Apr 92 16:57:39 GMT
Organization: Ericsson Network Systems, Richardson, TX

Excellent list--thanks for posting it.  I'm compiling a
similar list for Stony Brook Pascal+.  Yes, it has some
major improvements over TP, but it also has some problems
of its own.  If anyone is interested, let me know.  I
might also write down some of my impressions of this
lesser known system if I receive any positive replies.
--
James Hague   
exuhag@exu.ericsson.se
Newsgroups: sbcs.cse114,comp.lang.pascal
From: clane@libws1.ic.sunysb.edu (Charles F Lane)
Subject: Re: pascal trouble
Organization: State University of New York at Stony Brook
Distribution: na
Date: Mon, 13 Apr 1992 18:29:45 GMT

In article <1992Apr12.024103.27635@sbcs.sunysb.edu> dtiberio@csws7.ic.sunysb.edu (David Tiberio) writes:
>
>	I have to do a database option where the user presses
>RETURN if he does not want the data changed. The string read
>in is an array of length 9. This is what I tried:
>
>	if string = '         ' then data_does_not_change;
>
>	This line is not being read for some reason the way
>I would expect it to. Should this work? It could be that I forgot
>something somewhere else, but I have had problems like this
>throughout this program.
     Well fellow Stony Brooker, I think the above means if the user
presses the spacebar 9 times and presses return then data_does_not_change.
A better test would be to see if the length of the string is zero.  This
is done by checking string[0].  The 0th index of a string contains it's
length.  But I'm not sure if this value is always 9 since you said the
string has length 9 (declared in type declaration I'm assuming).  Another
way would be to save the string before return is pressed and do:
 if StringBeforeReturn = StringAfterReturn then data_does_not_change;
This is assuming readln leaves a string unchanged if only return is pressed.
To be sure, you can writeln the string to screen before return, press
just return, and writeln the string again.  See what happens.  If the string
is untouched you can use the last method I described.
Maybe someone who knows more about strings can verify/add to all this! :-)
But do experiment a little like suggested above.  You can find out a lot
if you peek at what's going on with variables before/after things happen...

>      //   David Tiberio  SUNY Stony Brook 2-3662  AMIGA  DDD-MEN   
>     //  Not the llama! Come here Earl; I want to tell you something...
>   \X/  Liverpool, New York	flames to suggestions@cbmvax.commodore.com

-- 
~~~~~~~ I'm (sine)waving goodbye!  | Bo knows football, basketball, baseball,
Charles F. Lane                    | hockey, diddley, etc.  But does he know
clane@Libws1.ic.sunysb.edu         | computers?!
From: ldstern@rodan.acs.syr.edu (Larry Stern)
Newsgroups: comp.lang.pascal
Subject: simple TP CAD problem
Date: 11 Apr 92 04:47:41 GMT
Organization: Syracuse University, Syracuse, NY

I have written a simple program in TP 5.5 which draws logic gates and performs
Boolean minimization. I am somewhat stuck on my next step, which is to move the
drawing to another part of the screen. I would like the program to prompt the
user "Place gate:", and have the user use arrows to go to any part of the
screen, press "Enter" and have that gate drawn there.

TIA for any suggestions.

							-L. Stern

--

Larry Stern                                  LDSTERN@RODAN.ACS.SYR.EDU
From: magid@ocf.berkeley.edu (Paul Magid)
Newsgroups: comp.lang.pascal
Subject: What is a .lib file?
Date: 15 Apr 1992 06:19:45 GMT
Organization: University of California, Berkeley
NNTP-Posting-Host: headcrash.berkeley.edu
Originator: magid@headcrash.berkeley.edu

Excuse my ignorance but my programming platform of choiceis TPW.  There is a 
program in the SDK which I am trying to port to TPW that uses a .lib file.
What is this files format and how can I use it in TPW?
Thank you.


Paul
From: rind@binoc.bih.harvard.edu (David Rind)
Newsgroups: comp.lang.pascal
Subject: Re: Help with pointers
Date: 7 Apr 92 13:19:04 GMT
Article-I.D.: hsdndev.590
Reply-To: rind@binoc.bih.harvard.edu (David Rind)
Followup-To: comp.lang.pascal
Organization: Beth Israel Hospital, Harvard Medical School, Boston Mass., USA

In article <riou4INNpr6@matt.ksu.ksu.edu>
 holland@matt.ksu.ksu.edu (Rich Holland) writes:
>I just started using Huge Array's in a pascal program, and I'm having
>trouble with something.  I've got a procedure (InitBigArray) that
>makes sure there's enough room on the heap and allocates a pointer to
>a record, for a certain number of records (5000 in this case).

>I have a second procedure (KillBigArray) which just goes through the
>5000 elements and does a Dispose() on the pointers.
>"Error 204:  Invalid pointer operation"

I've just had to deal with this problem in a similar program that
was turning off range checking and using getmem to produce large
arrays.  The Error 204 can occur if your array is larger
than the amount of memory allocated by getmem.  If this occurs,
then you can step on the HeapPtr such that the next allocation of
a variable from the heap will be invalid.  When you go to dispose
the pointer you get the Error 204.

I would suggest checking very carefully that you've allocated
enough space for the array and are not indexing past the point
in the array that you had planned for.
-- 
David Rind
rind@binoc.bih.harvard.edu
From: o-vinje@hsr.no (Odd E. Vinje)
Newsgroups: comp.lang.pascal
Subject: ExecView in TV
Date: 13 Apr 92 12:23:04 GMT
Organization: Rogaland University Centre

In my TV-program I have a problem with the ExecView -procedure. I'm trying
executing a modal dialogbox (a MessageBox) in the program's Init -procedure 
(which is a constructor).

The program is hanging at this point. What is wrong ??

Odd
From: jon@phsbbs.princeton.nj.us (Jonathan Ellis)
Newsgroups: comp.lang.pascal
Subject: Memory error involving graphics mode
Date: Tue, 07 Apr 92 14:02:01 EDT
Organization: Princeton High School, Princeton, New Jersey

        I recently posted the following question:

>
>        I have a problem with using graphics in Turbo Pascal 6.0:
>when repeatedly going into graphics mode and coming out of it with 
>restorecrtmode, after about 10 times I get an out of memory error.  This 
>causes the program to crash, but I can run it again and repeat the 
>process an addition ten times or so before it crashes again.  Can anyone 
>advance a hypothesis as to why this happesns?

        Thomas Bullinger, Duncan Murdoch, Richard Scrivens, and Paul 
Bryant wrote me about it.  It turns out the Initgraph, which I was 
calling every time, allocates memory for the BGI each time it is called.  
Eventually, one runs out of memory.  After calling initgraph once, 
SetGraphMode should be used.



-----
Jonathan Ellis, Princeton High School BBS
DNS: jon@phsbbs.princeton.nj.us      UUCP: ...!princeton!phsbbs!jon
Disclaimer: Author bears full responsibility for this message.
From: jkorpela@vipunen.hut.fi (Jukka Korpela)
Newsgroups: sbcs.cse114,comp.lang.pascal
Subject: Re: file of data_type?
Date: 14 Apr 92 07:35:57 GMT
Organization: Helsinki University of Technology, Finland

Please specify your problem in some detail, instead of just
saying "that did not work". An isolated line of code (a declaration)
cannot work, of course. People will try to guess the context,
the error message, the compiler used, etc. ad nauseam.

In general, one can use 'file of t' where 't' is a type if one is
using a standard-conforming implementation which happens to support
such files (it need not). One can do Reset, Rewrite, Get, Put,
Read, and Write in their simple versions. If you need e.g. random
access (you might if you have a database application!), you need
some extensions, which tend to depend on the implementation.

* Jukka "Yucca" Korpela			     *  Jukka.Korpela@hut.fi      *
* Manager of User Support						  *
* Helsinki Univ. of Technology Computing Centre, Finland		  *
From: tamari@bimacs.BITNET (tamari zvi)
Newsgroups: comp.lang.pascal
Subject: TV : TListViewer problem
Keywords: TV, pascal
Date: 14 Apr 92 10:01:06 GMT
Organization: Math & CS, BarIlan U, Ramat-Gan, Israel

Hi,

   I have a problen using TListViewer Object ( I get a blank rectangle
on the screen when I call it.

   Does anyone knows why does it happen, or can send me a demo of using
TListViewer because it seems to be a problem caused by  my inexprience.

Here are a few statments from the program that will sure help you to help me :

PNamesView = ^TNamesView;
TNamesView = Object(TListViewer)
   procedure GetText( item : Integer; MaxLen : Integer ) : String; virtual;
end;

Name : Array[1..65] of String[12];

Procedure TMyApp.DisplayNames;
  Var

      Control : Word;
      NamesSB : PScrollbar;
      NamesListView : PNamesView;

  Begin

    R.Assign( 30, 5, 31, 20 );
    NamesSB := New( PScrollBar, Init(R) );
    Insert( NamesSB );

    R.Assign( 5, 5, 30, 20 );
    NamesListView := New( PNamesView, Init( R, 1, nil, NamesSB ));
    Insert( NameListView );

    Control := DeskTop^.ExecView( NamesListView );

   End;

   Procedure TNamesView.GetText( item : Integer; MaxLen : Integer ) : string;
     Begin


        GetText := Name[ Item ];

     End;


  Thanks for your help,
                        Zvika.
Newsgroups: comp.lang.pascal
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Subject: Re: TP 6.0 constructors (bug?)
Organization: University of Waterloo
Date: Wed, 15 Apr 1992 22:18:22 GMT

In article <14021@star.cs.vu.nl> sbakker@cs.vu.nl (Bakker S) writes:
>I don't know if this qualifies as a bug, but anyway:
>When calling (unqualified) constructors from within another constructor,
>the VMT field is not always set properly.
>
>In the programmer's manual it is said that a constructor is called with
>a VMT parameter, pointing to the object's VMT. When a constructor call is
>qualified, the VMT parameter is nil, indicating that the constructor should
>not initialize the VMT field.

As you noted, it's behaving as documented, so it's not a bug, but it's not
a very good default behaviour.  If I ever get around to writing my style 
checker, it'll give a warning every time you call a constructor without
a qualifier.

Duncan Murdoch
From: conrad@wvnvms.wvnet.edu
Newsgroups: comp.lang.pascal
Subject: TP5 and disk labels
Date: 13 Apr 92 15:58:52 GMT
Organization: West Virginia Network for Educational Telecomputing


I'm trying to write a routine that can read/modify a disk label. 
I can read the label by using the FindFirst function and specifing the
VolumnId file attribute.  The problem occurs when I try to modify the label.
I've tried numerous combinations of SetFAttr and file name but without luck.

Any suggestions?

I'm using TP v5

Thanks in advance.

Patrick Conrad
Newsgroups: comp.lang.pascal
From: tpehrson@javelin.sim.es.com (tim clinkenpeel)
Subject: How Can I Delete An Entire Directory?
Reply-To: tpehrson@javelin.sim.es.com
Organization: Evans & Sutherland Computer Corporation
Date: Thu, 16 Apr 1992 00:46:37 GMT

i would like to do the equivalent of 'delete c:\msg\*.*' from TP5.0.
unfortunately, i was not able to nail down exactly how to do this.  my nifty
manual pointed me in the direction of FSEARCH; however, it appears as though
wildcards are not accepted.

how would you, the pascal guru, solve this troubling dilemma?

please use e-mail.  i actually read it.

-- 
warning: my messages are offensive to morons |R| a person is only equal to all 
disclaimer: i exclusively represent myself! ||F|| others when s/he treats them
__________ lick bush in '92! _____________ |||R||| as such; inferior otherwise
>>>==-----+ i am tpehrson@javelin.sim.es.com, tim clinkenpeel i am +-----==<<<
From: clane@libws1.ic.sunysb.edu (Charles F Lane)
Subject: Re: How do you tell when a user has lifted a finger OFF of a key?
Organization: State University of New York at Stony Brook
Date: Fri, 17 Apr 1992 17:15:05 GMT

In article <30070@adm.brl.mil> J_SCHULL@acc.haverford.edu (Jonathan Schull) writes:
>I'm using Turbo Pascal...

    The IO port for the keyboard contains a certain keycode depending on
which key has recently been pressed OR released.  Each key has a MAKE code 
and a BREAK code.  Make is when it's pressed, break is when it's released.
Accessing the port is very easy: 
 port[$60] := CodeOfSomeKey;

    CodeOfSomeKey, preferably a byte sized variable, will then contain
either a make code or break code of whatever key was used last.
The following code is a handy little program you can use to find out the 
make and break codes for any key on your keyboard:

 program keycodes;
 begin
  repeat
   writeln(port[$60]);
  until port[$60] = 1;  {If ESCAPE key pressed, then exit loop}
 end. 

    Just run it in dos and you should see a number somwhere in the 200's 
(I don't remember right now) being writeln'ed infinitely on screen.  That's
the break code for the return key because the last key you pressed AND then
released was return at the dos prompt.  Hold return down and you'll see it's
make code.  Press any other keys and you'll see their codes, too.  Note how
it can also sense weird keys like shift and control -- a pretty good feature.
To exit press ESCAPE.  Note that the make code for the escape key is 1.  I
don't know the break code for it, but to find out you'll have to change which
key you want to use to exit the loop in order to find out.  Also note that
you can make the loop exit only if you *release* a certain key, too.  You
just need to know it's break code.  Also, any keycode (make or break), will
remain at port[$60] until another key is released or pressed.

Hope this helps.

-- 
                          |"There are pearls to be had here, but you have to
Charles F. Lane           |break open the oysters."  My geology prof to a class
clane@Libws1.ic.sunysb.edu|w/no questions at a review 2 days before an exam.
From: ormsby@ohstpy.mps.ohio-state.edu
Newsgroups: comp.lang.pascal
Subject: For Sale: Borland TP Toolboxes
Date: 9 Apr 92 19:05:08 GMT


   FOR SALE:
   Borland Turbo pascal Toolboxes.  Numerical methods and Graphix
Toolboxes.  Diskettes contain subroutines to work into programs.
Complete manuals.  email if interested.
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Newsgroups: comp.lang.pascal
Subject: Re: Units using Units
Date: 7 Apr 92 13:23:24 GMT
Organization: University of Waterloo
 ath: s4mjsot ahrk!mole-end!uunet!uunet!cs.utexas.edu!utgpu!watserv1!watdragon!watstat.waterloo.edu!dmurdoch

In article <29903@aAm.brl.mil> J_SCHULL@acc.haverford.edu (Jonathan Schull) writes:
>
>Suppose MyProgram Uses UnitShallow;
>
>Suppose UnitShallow Uses UnitDeep;
>
>To create MYPROGRAM.EXE, do 
>  I need to have UNITDEEP.TPU as well as UNITSHALLOW.TPU, 
>  or  can I do it with just MYPROGRAM.PAS and UNITSHALLOW.TPU  ?
>
>I seem to be needing both, but I want to only need UnitShallow.

You can't do that.  When a unit uses another unit, it is compiled with all
sorCs of references to the other .TPU, but nothing is copied into the new
.TPU.  In your example, UNITSHAL.TPU won't contain any code from UNITDEEP.TPU,
but it'll contain all sorCs of references to offsets in the UNITDEEP.TPU file.

When you compile MyProgram, it'll link both units in.  If UNITSHAL.TPU doesn't
really need UNITDEEP.TPU, you'll still need the file present to satisfy the
linker.  

The only way I know of to get all the code from two .PAS files into one .TPU 
is to use include files, not separate units.  

Duncan Murdoch
Newsgroups: comp.lang.pascal
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Subject: Re: Units using Units
Organization: University of Waterloo
Date: Tue, 7 Apr 1992 13:23:24 GMT

In article <29903@adm.brl.mil> J_SCHULL@acc.haverford.edu (Jonathan Schull) writes:
>
>Suppose MyProgram Uses UnitShallow;
>
>Suppose UnitShallow Uses UnitDeep;
>
>To create MYPROGRAM.EXE, do 
>  I need to have UNITDEEP.TPU as well as UNITSHALLOW.TPU, 
>  or  can I do it with just MYPROGRAM.PAS and UNITSHALLOW.TPU  ?
>
>I seem to be needing both, but I want to only need UnitShallow.

You can't do that.  When a unit uses another unit, it is compiled with all
sorts of references to the other .TPU, but nothing is copied into the new
.TPU.  In your example, UNITSHAL.TPU won't contain any code from UNITDEEP.TPU,
but it'll contain all sorts of references to offsets in the UNITDEEP.TPU file.

When you compile MyProgram, it'll link both units in.  If UNITSHAL.TPU doesn't
really need UNITDEEP.TPU, you'll still need the file present to satisfy the
linker.  

The only way I know of to get all the code from two .PAS files into one .TPU 
is to use include files, not separate units.  

Duncan Murdoch