HDTenEightyP/NetNews huggingface dataset:
From: kooijman@sun.soe.clarkson.edu (Harry Kooijman,Peyt314a,3808)
Subject: Re: BP/TP OOP is missing something...
Organization: Clarkson University
Date: Tue, 17 Nov 1992 20:08:39 GMT

From article <dmurdoch.282.722020256@mast.queensu.ca>, by dmurdoch@mast.queensu.ca (Duncan Murdoch):
> In article <1992Nov17.153804.21729@news.clarkson.edu> kooijman@sun.soe.clarkson.edu (Harry Kooijman,Peyt314a,3808) writes:
>>Why is it that TP with objects does not have the capability to call the
>>constructors when variables are declared? And when an object goes out of
>>scope it should be destructed automatically. For example:
>>
>>Function DoSomethingWithD;
>>Var D:DoubleObject(1.2);
>>Begin
>>  ... 
>>  Do something with D
>>  ...
>>End; {and here D gets destructed}
> 
> This is there in TP, to a very limited extent:  you can have an initialized 
> variable which is an object, and you needn't call the constructor.  It's 
> initialized at program load time, not each time the variable comes into 
> scope.  The destructor is never called.
> 
> I think the main reason that TP doesn't have automatic constructor/
> destructor calls is because it is descended from Pascal.  In Pascal in 
> general, code doesn't get executed unless you explicitly ask for it.  
> Adding automatic code would be a big change to the flavour of the language.
> 
> It's pretty unlikely that Borland would make such a fundamental change
> that doesn't add any power to the language.  Your code fragment is exactly 
> equivalent to
> 
>  var D:DoubleObject;
>  begin
>    D.init(1.2);
>    ...
>    D.done;
>  end;
> 
> Since what you want to do is already possible with nothing more than a 
> couple of extra lines of code, why make a big change to the language?
> 
> Duncan Murdoch
> dmurdoch@mast.queensu.ca

It is this couple of extra lines that make the difference between using
objects or not. With explicit calls to the constructor/destructor I can
write exactly the same code without objects, and loose all the object
overhead. What if you are adding a vector in a subroutine declaration
list, write the constructor, and use it, but forget to destruct it (an
o so easy and common bug): you start loosing heap. What if you forget
the constructor (worse!) ? If you have only a couple of vectors to
worry about you will probably not make this mistake. However if you are
dealing with 15 vectors and 15 matrices in one routine it becomes a
different matter. And that's why automatic construction and destruction
takes me further.

Your comment about Pascal's flavour is well taken. I have little hope
for any change.

Harry
--
Harry Kooijman: Rigorous dynamic distillation simulation.
Dept. of Chemical Engineering, Clarkson University, Potsdam NY 13699.
kooijman@sun.soe.clarkson.edu
From: S_WERNERT@iravcl.ira.uka.de (|S| Frank Wernert)
Newsgroups: comp.lang.pascal
Subject: Wanted : Scrolling images  on VGA with TP6.0
Date: 19 Nov 1992 12:09:03 GMT
Organization: University of Karlsruhe (FRG) - Informatik Rechnerabt.
Distribution: world
NNTP-Posting-Host: irav1.ira.uka.de
X-News-Reader: VMS NEWS 1.23

Is there anybody who has experience with image-scrolling on VGA. I'd like to
get information on how to load large images and how to make them scroll. This
scrolling should be very FAST (may totally or parts written in assembler). The
resolution should be greater or equal to 640*480*16 (The higher - the better).
If you know a book about the subject, it would be very helpful, too.

Thanx, Magnum
From: kim@Software.Mitel.COM (Kim Letkeman)
Newsgroups: comp.lang.pascal
Subject: Re: Pointer problems...
Date: 23 Nov 92 14:16:23 GMT
Organization: MITEL Public Switching, Kanata, Ontario, Canada
In-reply-to: tcsmith@mta.ca's message of 21 Nov 92 18:10:25 GMT

In article <1992Nov21.181025.18275@jupiter.sun.csd.unb.ca> tcsmith@mta.ca (Tim Smith) writes:

|   I wonder if someone could please explain why these pointer operations don't work...
| {*****problem 1**********************}
| var
|   p1: ^byte;
|   p2: ^byte;
|   p3   : pointer;
| begin
|   getmem(p3,100);
|   p1:=P3;
|   p2:=addr(p1);
| 
|   writeln(p1^,' ',p2^,' ');
|           ^^^-----^^^ Why won't these two values be equal?

p1 is the same as the contents of p3, which is the address of the
chunk of RAM returned by the getmem call. p2 is the address of p1, not
the _contents_ of p1. So, you should get the value of the first byte
of the chunk of RAM at p3, followed by the value of the first byte of
the address p1, which is actually the lowest order byte of the
address.

|   freemem(p3,100);
| end.
| 
| {*****problem 2**********************}
| var
|   P1 : ^Byte;
|   P2 : ^Byte;
| begin
|   new(p1);
|   p2:=p1;   { Why is this illegal }

Compiles fine for me.

|   dispose(p1);
| end.
--
Kim Letkeman	kim@Software.Mitel.COM
Newsgroups: comp.lang.pascal
From: tsullivan@trentu.ca (The OTHER One True God)
Subject: Re: Borland licences (was about old copies of TP)
News-Software: VAX/VMS VNEWS 1.41    
Organization: Trent University Computer Services Department
Date: Mon, 23 Nov 1992 18:42:00 GMT

In article <1992Nov22.233555.1705@lugb.latrobe.edu.au>, CHEGC@LURE.LATROBE.EDU.AU (CROSS,Graeme) writes...

>>> It's that last clause that worries me:  lots of programs I write could be 
>>> seen as "generally competitive with" Borland Language products.  

>* Is a programmer's editor a development tool? Disassemblers? What about my

  Note the phrasing. Any Borland LANGUAGE Product (read: TP, BP, TC++, 
BC++, DBASE IV and Paradox). It doesn't include editors (ie BRIEF), 
debuggers, interpreters, etc. Nor does it include Turbo Vision. It means 
you can't write (using TP) a TP-compatible compiler that does allow .OBJ 
file creation, and is faster than TP, and sell it. Which isn't exactly 
totalitarianism, for the simple reason that you wouldn't WANT to do a 
project like that in Pascal (well, you might want to, but likly wouldn't).

>Today's special sig: As the years go by, Borland go downhill faster & faster...

  I doubt it. Borland puts out the highest quality PC compilers. Unless 
Stonybrook can speed up SBP+ by about 1000%, Borland doesn't have to worry.

   Tim Sullivan
   tsullivan@trentu.ca
   cstes@blaze.trentu.ca

A Disclaimer? Yeah, and people BELIEVE what I write, too...
---
 "Virtual Reality has NOTHING on Calvin."
       - Suzy, from Calvin and Hobbes

Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: Large arrays in BP 7.0
Organization: Queen's University
Date: Wed, 18 Nov 1992 02:47:14 GMT

In article <17NOV199216530331@cc.utah.edu> msfuller@cc.utah.edu (MARC S. FULLER) writes:
>Does anyone know if BP 7.0 with the dos extender will allow larger arrays than 
>the 64kB limit, or is the extender similar to TPW 1.5 where this can only be 
>accomplished through pointers?

No, no help there.  There's now support for allocating more than 64K (as 
in TPW), but no way to handle it once you've got it - the extender still 
uses 16 bit segments.  This is the biggest disappointment of the package, in 
my opinion.  The 386 has been available for something like 6 years; 
you'd think Borland would support it by now.  

(In fact, they do support it a bit:  the RTL uses 32 bit instructions for 
handling longints if it detects a 386.)

Duncan Murdoch
From: wct@po.CWRU.Edu (William C. Thompson)
Newsgroups: comp.lang.pascal
Subject: Minor cosmetic bug with TP6.0
Date: 23 Nov 1992 09:18:40 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Reply-To: wct@po.CWRU.Edu (William C. Thompson)
NNTP-Posting-Host: slc5.ins.cwru.edu


I think I have a discovered a *very* minor cosmetic bug with
TP6.0.  Here's what I did.  Move the mouse pointer to the middle
of the screen.  The mouse is indicated by the different coloring
(red in the standard set I believe).  Exit to the shell.
Immediately return to TP.  Move the mouse again.  What happened
when I did it was that it left a 'mark' where the mouse was and
redrew the mouse elsewhere.  Oops...
-- 
"What do you mean Star Trek isn't real!?" - anonymous
From: spxsjm@thor.cf.ac.uk (Mr S J Morris 92)
Newsgroups: comp.lang.pascal
Subject: Help! Anybody know about TPW Dialog windows?
Summary: Advice required, please.
Date: 20 Nov 92 10:13:23 GMT
Organization: University of Wales College at Cardiff
X-Mailer: Cardiff Computing Maths PP Mail Open News Gateway

Hello, I wonder if I can pick somebody's brains...

I'm a beginner at trying to program in Turbo Pascal for Windows. I have
an application where I want to open a dialog box with just three
checkboxes in it. I managed to get everything working by defining a
descendant object of TDialog which included a method for responding to a
message caused by the clicking of each checkbox individually. However,
this took quite a lot of code to do something really quite simple, and I
read in the manual that I could avoid having to define a descendant
object by using a transfer buffer to determine the states of the check
boxes at the beginning and end of the dialog.

I duly set the thing up, paying close attention to the manual and to the
example program given on the disk. My new program works fine, except for
one thing - when I click the mouse on a check box, the box doesn't
toggle. It registers (i.e. the box is highlighted to show that it is
being clicked), but no check appears. Has anybody else had this problem?
If so, what caused it, and how did you resolve it? I'd be really
grateful for any advice you could give.

Thanks in advance,
Steve Morris,
Department of Physics, Coleg Prifysgol Cymru Caerdydd.
Organization: Valencia University (Universitat de Valencia)   SPAIN
Date: Friday, 20 Nov 1992 20:19:27 EST
From: <LOPEZJ@EVALUN11.BITNET>
Newsgroups: comp.lang.pascal
Subject: subscribe

subscribe
Newsgroups: comp.lang.pascal
From: ecec@quads.uchicago.edu (Eric Cabot)
Subject: Something missing in BP 7.0 Documentation.
Reply-To: ecec@midway.uchicago.edu
Organization: University of Chicago 
Date: Thu, 19 Nov 1992 04:52:07 GMT

Well I just discovered an amazing omission in the dox for BP 7...
there doesn't seem to be a table of keyboard scan codes.  I seem to
recall this table in the manuals of versions 4, 5, and 6. I guess
I'll have to hold onto one of my old manuals.

If somebody finds that I'm wrong on this one, by all means
please flame me, because I wouldn't mind being corrected. 
-- 
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=v=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    Eric Cabot                         |       "Non Nobis Nati Solum" 
ecec@midway.uchicago.edu               | 
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=v=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Newsgroups: comp.lang.pascal
From: tsullivan@trentu.ca (The OTHER One True God)
Subject: Re: I found a compiler bug in TP6.0, maybe...
News-Software: VAX/VMS VNEWS 1.41    
Organization: Trent University Computer Services Department
Date: Mon, 23 Nov 1992 18:49:00 GMT

In article <1992Nov22.192602.16440@crash>, tech@crash.cts.com (Don Bontemps) writes...
> 
>When I attempt to compile the following code, I get a runtime error 202.
>It appears that I am getting an array range check error but the array index
>is within range.  Here an example code listing:
> 
>program range_bug;
> 
>const
> 
>  days : array [-1..6] of string[10] = (' ','Sunday','Monday','Tuesday',
>     {note: integer^}                   'Wednesday','Thursday','Friday',
>                                        'Saturday');
> 
>  num : word = 0;
>         {^--- a WORD is 0-65535. an INTEGER is -32768-32767}
> 
>begin
>  writeln(days[num-1]);
>end.

  Your problem comes with the fact that INTEGER and WORD types are 
incompatible. A word is an UNSIGNED number, any number from 0 to 65535 (an 
8-bit number). An INTEGER is a 7-bit number (0-32767) plus a sign bit, -ve 
or +ve. You are trying to assign a negative value to a type that only 
accepts positive values.

>If I turn off the compiler range checking (ie: {$R-}) the program

  This is because the compiler no longer cares it it's a word or an 
integer, and will treat it as either at this point (in a c-like way).

>executes just fine.  The example code is a small portion of a large application
>that I am currently writing.  If I declare num as an integer, this fixes the
>error but I need num to be declared as a word.  So what gives?  Is this a

   Solution: Declare num as a longint. That will solve both the problems.

   Tim Sullivan
   tsullivan@trentu.ca
   cstes@blaze.trentu.ca

A Disclaimer? Yeah, and people BELIEVE what I write, too...
---
 "Virtual Reality has NOTHING on Calvin."
       - Suzy, from Calvin and Hobbes
From: KDT@newton.npl.co.uk (K D TART CSU BLDG. 93)
Newsgroups: comp.lang.pascal
Subject: Re: ???????  User input of textfile to read ?????????
Date: 23 Nov 92 11:35:54 GMT
Distribution: uk
Organization: National Physical Laboratory, UK
X-News-Reader: VMS NEWS 1.21

> 	Hi, I'm just getting to grips with pascal and have a niggling problem.
> I want to read in a filename using say :
> 
> 	writeln(' Enter filename to read ');
> 	readln(filename);
> 
> and take characters in from the specified file using :
> 
> 	reset(filename)
> 
> Naturally filename must be of type : text.  This clashes with the first step
> where I assigned the name of the file to filename !!!
> 
> 	i.e.   the variable filename must be :
>  
> 	 packed array (* to hold filename *)
> 	 file of text.  (* to access contents of file *)
> 
> 
> 	Can anyone suggest a way around this problem or maybe a new approach to
> achieve the same result.

You need to have 2 variables, one for the filename and the other for the file
itself. The filename variable needs to be some sort of string type or packed
array, and the variable for the file needs to be type TEXT.

eg.

var
  myfile :text;
  filename :packed array [1..80] of char;


begin
  write ('Filename: ');
  readln (filename);

  { You need some command in here to link the MYFILE variable with the external
    file whose name is in FILENAME. This will depend on the version of Pascal
    you are using because standard Pascal does not cater for this. See * below }

  reset (myfile);
  read (myfile, anotherstringtypevariable);

  { ... and so on }
end.


* in Turbo Pascal, you should declare FILENAME as a string and use the ASSIGN
  command to link your file variable with the external file:

       ASSIGN (myfile, filename);
       RESET (myfile);

  In VAX pascal, you need to do OPEN:

       OPEN (myfile, filename, readonly);
       RESET (myfile);

  You need to specify the type of Pascal you are using to get a more complete
  answer.

	Kingsley.
From: roth@oasys.dt.navy.mil (Pete Roth)
Newsgroups: comp.lang.pascal
Subject: Re: Comments on Turbo (Borland) Pascal 7.0?
Date: 20 Nov 92 20:01:26 GMT
Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
Organization: The David Taylor Model Basin

In comp.lang.pascal, exuhag@exu.ericsson.se (James Hague) writes:
[...]
>And on a vaguely related subject, here's a neat idea:  since the
>editor already has to go through the trouble of doing lexical
>scanning (to determing proper colors), maybe it should be taken
>one step further.  Keep the files, both internally and on disk,
>in a tokenized format.  This would allow better memory usage (smaller
>files) and would speed up the compiler.  Many assemblers and a
>few compilers on 8-bit computers used to use such a scheme.

naah, not so neat.

Okay, maybe the new IDE has a bunch of good stuff plugged in - I think
color coded code is cool..., and, alliterative.
But tokenized files should be an option that is not important.
Because frankly, the editor in the IDE is pretty puny.
Most of the time I put my programs together outside of the IDE with
decent tools. And most of us have reasonably quick machines now anyway,
nicht wahr? So where's the beef in a tokenized file?

regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - -
Peter N Roth      roth@oasys.dt.navy.mil
You can take a horse to water, but a pencil must be lead.
Newsgroups: comp.lang.pascal
From: c89ponga@odalix.ida.liu.se (kand. Pontus Gagge)
Subject: Re: Why I am considering Stony Brooks Pascal+ 6.1 over BP7.0
Organization: CIS Dept, Univ of Linkoping, Sweden
Date: Fri, 20 Nov 1992 14:02:07 GMT

Re SBP:

I haven't seen their latest version, but as I've posted earlier (several
months ago) they are more like 99%-compatible with TP6.0. There were some
errors in the handling of typed constant pointers, among other problems.

On your question, generally: don't buy SBP+ alone. What it's primarily
good for is producing that last delivery version of your program. For
developing, use TP/BP. When debugging, you spend more time compiling than
running your program (or attempting to run your program...)
--
/-------------------------+--------------- DISCLAIMER -----------------\
| kand. Pontus Gagge      | The views expressed herein are compromises |
| University of Link|ping | between my mental subpersonae, and may be  |
| c89ponga@und.ida.liu.se | held by none of them.                      |
\-------------------------+--------------------------------------------/
From: roth@oasys.dt.navy.mil (Pete Roth)
Newsgroups: comp.lang.pascal
Subject: Re: BP/TP OOP is missing something...
Date: 19 Nov 92 20:34:29 GMT
Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
Organization: The David Taylor Model Basin

In comp.lang.pascal, bobbe@vice.ICO.TEK.COM (Robert Beauchaine) writes:
[...]
>
>  I'm not an advocate of multiple inheritance.  I think it has many
>  uses, but I'm not sure it's essential to OO programming.  I can't
>  actually say that I've ever needed to resort to it.

The one case I *almost* needed it was when trying to add something to
the tvision hierarchy, without benefit of source code to allow direct
modification. Like, checking what kind of TView object I was dealing with.
If it was one of mine, I wanted it to do special things.

I used the TView Message facility and solved the problem. And now that Borland
is packaging TVision source in with BP7, i'll have direct access.

Anyone else have a perceived need for Multiple Inheritance?
How did you solve the problem?

regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - -
Peter N Roth      roth@oasys.dt.navy.mil
You can take a horse to water, but a pencil must be lead.
From: Paul.Robinson@f417.n109.z1.fidonet.org (Paul Robinson)
Newsgroups: comp.lang.pascal
Subject: String (4/4)
Date: 21 Nov 92 17:21:24 GMT

procedure delete(var s:string; start,span:integer);
 
var     i,limit: integer;
 
begin
 
        if span<0 then begin span:=-span; start:=start-span end;
 
        limit:=start+span;
 
        if start<1 then start:=1;
 
        if limit>s.len+1 then limit:=s.len+1;
 
        span:=limit-start;
 
        if span>0 then begin
 
           for i:=0 to s.len-limit do s.ch[start+i]:=s.ch[limit+i];
 
           for i:=s.len-span+1 to s.len do s.ch[i]:=' ';
 
           s.len:=s.len-span;
 
           end;
 
end;
 
 
 
procedure insert(var s:string;VAR t:string; p:integer);
 
var     i,j: integer;
 
begin
 
        if t.len>0 then
 
           if (p>0) and (p<=s.len+1)
 
              then begin
 
                 if s.len+t.len<=stringmax
 
                    then s.len:=s.len+t.len
 
                    else s.len:=stringmax { overflow } ;
 
                 for i:=s.len downto p+t.len do s.ch[i]:=s.ch[i-t.len];
 
                 if s.len<p+t.len
 
                    then j:=s.len
 
                    else j:=p+t.len-1;
 
                 for i:=p to j do s.ch[i]:=t.ch[i-p+1];
 
                 end
 
              else { error: non-contiguous string }
 
end;
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Newsgroups: comp.lang.pascal
Subject: Re: Saving/Reading BinaryTrees.
Date: 19 Nov 92 21:19:11 GMT
Organization: Queen's University

In article <1egndqINNl2u@usenet.INS.CWRU.Edu> br707@cleveland.Freenet.Edu (Mike L. Melamed) writes:
>
>Does anyone know how to save and then restore a binary tree from a disk?

You don't say what kind of Pascal you're using, but if it's one with objects 
in it, it's very easy.  You'll have two kinds of nodes:  those that branch, 
and those that contain data (or point to data).  To write a branching node 
to disk, just write each of its branches.  To write a leaf node to disk, 
just write the data.

To restore, let the OOP system determine what it sees in the file, and call 
the appropriate loader.  If your branch loader gets called, it loads two 
branches; if your leaf loader gets called, it just loads the data.

Reading and writing mixed structures is one place where OOP coding really 
shines.

Duncan Murdoch
dmurdoch@mast.queensu.ca
Newsgroups: comp.lang.pascal
From: sakkinen@jyu.fi (Markku Sakkinen)
Subject: Re: Comparing record types
Organization: University of Jyvaskyla, Finland
Date: Mon, 16 Nov 1992 14:35:25 GMT

In article <Bxt8BL.LBx@cs.vu.nl> sbakker@cs.vu.nl (Bakker S) writes:
>holland@matt.ksu.ksu.edu (Rich Holland) writes:
>
>>sakkinen@jyu.fi (Markku Sakkinen) writes:
>
>>>>That's right. '=' only applies to atomic types (scalar, floating point, 
>>>>string, set).
>
>>>I wouldn't call sets and strings 'atomic', but that's nit-picking.
>
>>Okay, someone wanna clue me in here?  What's an "atomic" type?  I'd only
>>heard of ordinal and scalar until now...
>
>Right, sorry. It's vague. I should've said `certain types'. 

'Atomic' is not a term that abounds in Pascal literature,
but more generally it means that each value of the type is
'indivisible' or 'non-composite', i.e. does not consist of
meaningful parts.
Thus, among the constructed types of Pascal, enumerations and
pointers are atomic, while arrays, records, files, and sets are not.
(Strings are a special case of arrays.)

>Anyway, isn't it time for a real Pascal++, pardon me, Inc(Pascal) ?

How about Trellis/Owl (TM) and Eiffel (TM) ?
Certainly, neither of them is
  record base: Pascal; enhancement: classes end
but they are rather Pascal-like (or Ada-like) in spirit and syntax.

----------------------------------------------------------------------
Markku Sakkinen (sakkinen@jytko.jyu.fi)
       SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------
From: tech@crash.cts.com (Don Bontemps)
Newsgroups: comp.lang.pascal
Subject: I found a compiler bug in TP6.0, maybe...
Date: 23 Nov 92 03:26:02 GMT
Organization: CTS Network Services (crash, ctsnet), El Cajon, CA


When I attempt to compile the following code, I get a runtime error 202.
It appears that I am getting an array range check error but the array index
is within range.  Here an example code listing:

program range_bug;


{ Author: Donald P. Bontemps Jr.
    Date: November 22, 1992      }


const

  days : array [-1..6] of string[10] = (' ','Sunday','Monday','Tuesday',
                                        'Wednesday','Thursday','Friday',
                                        'Saturday');

  num : word = 0;


begin

  writeln(days[num-1]);

end.




If I turn off the compiler range checking (ie: {$R-}) the program
executes just fine.  The example code is a small portion of a large application
that I am currently writing.  If I declare num as an integer, this fixes the
error but I need num to be declared as a word.  So what gives?  Is this a
bonafide compiler bug or what?  Thanks for the feedback.