HDTenEightyP/NetNews huggingface dataset:
From: berend@contrast.wlink.nl (Berend de Boer)
Newsgroups: comp.lang.pascal
Subject: Interesting design/implementation dilemma
Date: Wed, 18 Nov 1992 08:17:46

Hello All!

Lately when designing two objects, a printer object and a (print)job
object, an interesting design dilemma happened. I could choose:
1) let the printer object accept jobs, or
2) let the job print itself on a printer

In Turbo Pascal:
1) Printer^.PrintJob(Job); or
2) Job^.Print(Printer);

It happened that I could not choose between these two designs. Turbo
Pascal forced me to take the second. Here's how: I wanted the two
objects in two seperate units. The printer unit could not be overlaid,
but the Job unit could. The Job unit needed to use the printer unit
(else how could it print) If I wrote the units this way, the first
option gave me an circular reference error. To see why, here the
interface sections (simplified):


unit Printer;

interface
uses Job;              {* the Job unit reference was only needed *}            

                       {* for method PrintJob                    *}
type
  TPrinter = object
    procedure PrintJob(AJob : TJob);
  end;


unit Job;

interface
uses Printer;          {* the Job unit needs the Printer unit anyway *}
type
  TJob = object
    procedure Print(APrinter : TPrinter);
  end;


So I had to choose design 2, deleting the reference to the Job unit
from the Printer unit. (I could choose design 1 but than I had to
write code especially to circumvent the circular reference error). My
question is: how far does a particular language (Turbo Pascal in this
case) influence design? In this case implementation and design could
not be seperated but had to be considered in parallel. I suppose this
is very common. For example, one cannot choose a design using multiple
inheritance if your language does not support it.

Any comments on this design/implementation dilemma would be greatly
appreciated.


Greetings,

Berend. (-:
fido: 2:281/527.23
email: berend@contrast.wlink.nl
From: bobbe@vice.ICO.TEK.COM (Robert Beauchaine)
Newsgroups: comp.lang.pascal
Subject: Re: BP/TP OOP is missing something...
Date: 19 Nov 92 05:32:57 GMT
Organization: Tektronix, Inc., Beaverton,  OR.

In article <KIM.92Nov18085152@kim.Software.Mitel.COM> kim@Software.Mitel.COM (Kim Letkeman) writes:
>In article <10773@vice.ICO.TEK.COM> bobbe@vice.ICO.TEK.COM (Robert Beauchaine) writes:
>
>
>What norm? There lots of competing philosophies and languages and all
>are quite different and equally main stream based on number of users.
>And only very few have any garbage collection at all.

  I was referring to the TP norm of local variables, not garbage
  collection. But no matter.  You're right that garbage collection
  has nothing to do with local allocation/destruction.

>
>|   This is exactly why I like the C++ approach.  With automated
>|   construction/destruction, operator overloading, etc, objects are
>|   much more seamlessly integrated into an application as extensions
>|   of the basic data types.  Once the class is properly defined, the
>|   programmer never has to consider the objects as anything except
>|   predefined atomic stuctures again.
>
>As soon as you allow multiple inheritance and such, you have to
>potential for a class to break any time a new full build is done. You
>can only treat objects as unchanging entities if they are relatively
>trivial. Any complex system is constantly evolving and so are its
>objects.

  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.

>There's no free lunch. C++ does a lot for you, but you assume a lot of
>other burdens for that pleasure. 

  No argument.  It's the inevitable price you pay for complexity.
  For heavy duty numerical applications like DSP, I use C++
  exclusivly.  For just about everything else, I prefer Pascal.  
  If Borland added operator and (possibly) function overloading, 
  I'd never program in C++ again.  


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 

Bob Beauchaine bobb@vice.ICO.TEK.COM 

C: The language that combines the power of assembly language with the 
   flexibility of assembly language.

Real friends don't let friends use UNIX.
From: tswingle@oucsace.cs.ohiou.edu (Tom Swingle)
Newsgroups: comp.lang.pascal,comp.lang.os.msdos.programmer
Subject: Broadcast messages aren't getting through in Turbo Vision
Date: 20 Nov 92 05:11:26 GMT
Organization: Ohio University CS Dept,. Athens


I am using Turbo Vision under Turbo Pascal 6.0.  Here is my problem:

I have a window type that is descended from TWindow.  Each of these windows
contains a unique, non-nil PString for its title.  In my code to open this
type of window, I first have it check to see if a window with an identical
title is already open before proceeding; if so, this is reported as an error.
I am proceeding as described on pages 128-129 of the Turbo Vision Guide.

I have defined a constant called cmAcknowledge that represents the command to
report that a window of this type is open.  My message looks like this:

	Message(DeskTop,evBroadcast,cmAcknowledge,@Title)

where Title is the string to be checked against.  Thus, the InfoPtr field of
the event generated becomes a PString containing the title to be checked 
against.  Upon receiving the cmAcknowledge command, the view checks to see if
PString(InfoPtr)^=Title^ and if so, clears the event to signify that it has
handled it.

All this is set up correctly.  I am able to successfully generate the event
with the parameters desired, but the event is being cleared prematurely.  The
first line of my HandleEvent method calls TWindow.HandleEvent(Event), and
when it does, the event gets cleared.  This happens regardless of what value
I choose for cmAcknowledge.  The Turbo Vision Guide says TWindow only responds
to broadcast events of cmSelectWindowNum.  Why would this particular event get
cleared?  Am I missing something?

Any advice or suggestions would be appreciated.  Thanks in advance.
-- 
"The problem you are experiencing is  |  "To be sure of hitting the target, 
not with the network nor with the     |  shoot first and, whatever you hit, 
station.  Please adjust your set."    |  call it the target." 
More ramblings from: tswingle@oucsace.cs.ohiou.edu/tswingle@bigbird.cs.ohiou.edu
Newsgroups: comp.lang.pascal
Subject: Re: BP 7.0 upgrade and ProtoGen
From: st_waldman@fencer.cis.dsto.gov.au
Date: 20 Nov 92 07:27:28 +1100
Organization: D.S.T.O. Aeronautical Research Laboratory

> |> I *think* I saw a comment here a couple of days ago that owning both
> |> TP 6 and TPW entitled one to a free copy of ProtoGen.   The article
> |> said something to the effect of "read your upgrade notice carefully".
> |> Well, I have, and I still can't find this.
>
> Did Borland send out more than 1 version of the upgrade letter?  I never
> moved to TPW 1.5 from 1.0 and the only mention of ProtoGen in the upgrade
> letter I received says it is $49.95.  I read backwards/forwards/sideways
> from the signature (Paul Gross) and can't find a freebee offer.

I contacted Borland, and was informed that the free offer of Protogen
applies only to TPW 1.5 owners. My guess is that this has something to
do with the fact that TPW 1.5 has only been out a short time, and if
you upgrade to BP 7.0 then you are getting similar functionality in the
Windows compiler. Don't know for sure, though. 

Witold Waldman
witold@hotblk.aed.dsto.gov.au
From: csci19dc@cl2.cl.uh.edu (461577198 PAREKH, SOHAIL)
Newsgroups: comp.lang.pascal
Subject: Re: Comments on Turbo (Borland) Pascal 7.0?
Date: 21 Nov 1992 09:07 CST
Organization: University of Houston - Clear Lake
Distribution: world
Reply-To: CSCI19DC@cl.uh.edu
NNTP-Posting-Host: uhcl2.cl.uh.edu
News-Software: VAX/VMS VNEWS 1.4-b1  

In article <1992Nov20.155938.20026@mnemosyne.cs.du.edu>, rwirthli@nyx.cs.du.edu (Ralph Wirthlin) writes...
> 
>>1: Source code hilighting
> 
>This *one* has personally saved me alot of grief.  Have you ever
>commented a piece of code and forgot to put on the closing "*)" and...


Every time I read a posting on this particular aspect of BP 7.0, it makes
me chuckle.

Microsoft QuickPascal, version 1.0...released about four years ago, had this
feature.  (source code highliting).

Seems like nobody thought it was very important at the time, eh?

Newsgroups: comp.lang.pascal
From: jlg@cochiti.lanl.gov (J. Giles)
Subject: Re: BP/TP OOP is missing something...
Organization: Los Alamos National Laboratory
Date: Wed, 18 Nov 1992 20:32:35 GMT

In article <10781@vice.ICO.TEK.COM>, bobbe@vice.ICO.TEK.COM (Robert Beauchaine) writes:
|> [...]
|>   Constructors come in many flavors in C++.  There are default
|>   constructors, copy constructors, and explicit constructors.

So?  This newsgroup is comp.lang.pascal.  There is nothing going
on here that has anything to do with C++.  It is irrelevant.

-- 
J. Giles
Newsgroups: comp.lang.pascal
From: erwvegm@cs.vu.nl (Erwin van Egmond)
Subject: Command-line
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Date: Mon, 16 Nov 1992 13:31:28 GMT


Hi there,
	I want to make a filecompletion program but to do so I need
	to know where the command-line is kept in memory.
	Could somebody out there tell me how to find the command-line,
	even when other tsr's are active like doskey.

Thankx in advance,
	Erwin van Egmond <erwvegm@cs.vu.nl>


-- 
++ Erwin van Egmond UUCP: ...!mcsun!cs.vu.nl!erwvegm            ++
++								++
++  With a rubber duck, one's never alone		   	++
++	-- "The Hitchhiker's Guide to the Galaxy"		++
From: butte_ms@pascal.uwlax.edu (Mike S. Butterbrodt S92)
Newsgroups: comp.lang.pascal
Subject: BP7 or TP7: ?????
Date: 16 Nov 92 15:12:30 GMT
Organization: University of Wisconsin - La Crosse Computer Science Department


   I cannot caution enough about being sure which package you are asking about.  
Even the Borland sales people seem to have that problem.  The salesperson I  
talked to mentioned TP7 *only*, never said the word Borland, yet I was sold  
BP7.  Listen carefully.
                                       Just a warning....
Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: GREP procedure
Organization: Queen's University
Date: Sat, 21 Nov 1992 13:46:22 GMT

In article <By0yEM.ExD@gabriel.keele.ac.uk> csn73@seq1.keele.ac.uk (P.R. Harding) writes:
>Second:
>Has anyone got a procedure that is similar to the GREP command in UNIX.
>
>I would be greatful if you could send me some ideas or if you have the 
>procedure a copy of the procedure. Basically I need to read a string in 
>a text file, just as GREP does.

Reading a string isn't hard, but it depends on which compiler you're using.
In TP, just declare a variable to be a string and readln it.

Matching a simple pattern is also easy in TP, using the Pos procedure.

Matching a GREP-like regular expression is harder; the new BP 7 comes with 
C source to GREP that you can call directly from your Pascal program (in 
protected mode only, the interface is through a DLL).  I wrote a pattern 
matcher a long time ago that doesn't quite use regular expressions, but is 
reasonably close; it's called tpmatch.zip, and should be available on garbo.
uwasa.fi.

Duncan Murdoch
dmurdoch@mast.queensu.ca
Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: Encryption and Random Numbers
Organization: Queen's University
Date: Wed, 18 Nov 1992 20:52:41 GMT

>In article <1992Nov17.211502.18511@lynx.dac.northeastern.edu> cschmidt@lynx.dac.northeastern.edu (Christopher Schmidt) writes:
>>generator.  It's a nice technique, except that if Borland
>>modifies the TP random number generator, then you and your
>>customers will be locked out of your encrypted data.

I've just checked in BP 7.  It appears that the Randseed update algorithm is 
the same, but the translation from Randseed to Random(N) has changed.

Here's what happens now in a call to Random(N):

First, Randseed is updated.  The update formula is

  randseed := randseed*134775813 + 1;

Then, treating randseed as an unsigned 32 bit quantity, Random(N) returns

  Random := trunc(N*randseed/2^32);

The calculations inside the parentheses above must *not* be allowed to 
overflow; this makes implementation sort of tricky.  One way to do it is

  if Randseed < 0 then
    Random := trunc(N*(randseed + 4294967296.0))/4294967296.0)
  else
    Random := trunc(N*double(randseed)/4294967296.0);

I don't have the code handy to simulate the TP 6.0 Random(N) call, but it 
returns the high word of RandSeed mod N. (This may have changed between 
releases of 6.0; there were lots of complaints about the lack of uniformity 
of the distibution.)

In the special case of N=256 that I used in my encryption filter, the 
difference is that TP 6 gives you the 2nd most significant byte of Randseed
as Random(256), while BP 7 gives you the most significant byte.

Finally, there's a difference between TP 6 and BP 7 in the way the 
floating point Random values are generated.  BP 7 treats Randseed as a
Longint, and returns (RandSeed+2^31)/2^32.  TP 6 also treated Randseed as a 
Longint, but returned Abs(RandSeed)/2^31.  (This was in $N+ mode; in $N- 
mode, TP 6 treated Randseed as unsigned, and returned RandSeed/2^32.)

It appears to me both of these changes are good.  There were two bugs 
listed in my TP 6 bug list about random number generation:  first, the non-
uniformity of Random(N) which has been remedied to a great extent, and 
second, the possibility that Random = 1.0, which has now been removed.


Duncan Murdoch
dmurdoch@mast.queensu.ca
Xref: sparky comp.lang.pascal:6628 alt.folklore.computers:16290
From: jb-b@minster.york.ac.uk
Newsgroups: comp.lang.pascal,alt.folklore.computers
Subject: RE: net.views - futzing (was: mainframe programmers...)
Date: 16 Nov 92 10:59:55 GMT
Organization: Department of Computer Science, University of York, England


I've posted this to comp.lang.pascal and alt.folklore.computers.
Hope this is OK.

RE: net.views - mainframe programmers in an open systems world

I have never heard the term 'futzing' before, but I know what
you are trying to describe. I feel that in moderation, such
tinkering is very useful.

Firstly, tinkering with the net news, or with a bulliten system
has its rewards:
 - draws your attention to different methods/tools/ideas
 - gives you an indication of how well you know the subject
 - by contributing the the news (reading and responding in
   some way), you feel warranted to ask your own questions,
   or put forward your own hypothesis. It is nice to know
   that there are many experts or mature users who will all
   read about your problems. One day, you just might need a
   book reference or some nugget to get you out of a sticky
   situation, and quickly.

Secondly, considering the tinkering people do on their PCs:
 - gives your PC a feeling of identity, that it is yours
 - by probing different areas of the s/w, a user gains
   confidence and familiarity with it, and ultimately this
   can make them more productive.
 - a lot of tinkering is house keeping in the form of
   moving files, rearranging directory structures etc.
   For this to be avoided, users would have to have a
   correct plan at the start. This is not possible as most
   of the time, work changes, and directory structures must
   reflect this so the user can stay productive. Until we 
   build an operating system which stores files the way 
   that humans remember, house keeping will be necessary.

Obviously, being involved in a role-playing game for 5 hours
every day may be going over the top, Also, perhaps there could
be a better way to filter the net news according to subject,
content, or type of message (request for data, data, opinion,
etc.). 

Keep tinkering...

Joe Boon, Computer Science Student, University of York, England
jb-b@minster.york.ac.uk

<These are my opinions, not those of the uniiversity...>
Newsgroups: comp.lang.pascal
From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
Subject: Re: First BP 7 bug :-)
Organization: Purdue University
Distribution: comp.lang.pascal
Date: Thu, 19 Nov 1992 22:54:54 GMT

In article <dmurdoch.177.722181338@mast.queensu.ca>, 
  dmurdoch@mast.queensu.ca (Duncan Murdoch) writes:
[wrote about a bug in file dialog object TFileDialog]

> Interestingly, there aren't any problems in the file dialogs in the BP 
> or TURBO IDEs.  I guess the distributed versions of the units aren't the 
> ones used to build these programs.  I wonder what other differences there 
> are?

There are a good number of features of the TP6 IDE which used 
extensions to the TV library, most notably the help system.  

Since my upgrade has not arrived, I'm wondering about the source
code which comes with the BP7.0 release.  Does it include 
the source for the IDE?  Probably not, but it would be interesting 
to study the descendents used in the IDE.

Thanks, Duncan, for pointing out the bug.

PF

Newsgroups: comp.lang.pascal
From: sakkinen@jyu.fi (Markku Sakkinen)
Subject: Re: Who's still using Turbo Pascal 5.5 ?
Organization: University of Jyvaskyla, Finland
Date: Tue, 17 Nov 1992 15:08:39 GMT

In article <45877@ogicse.ogi.edu> kotov@ogicse.ogi.edu (Alexei Kotov) writes:
>In article <1992Nov13.105239.46@ebc.ee> guest@ebc.ee (So~brad) writes:
                                                  ^^^
>>Eastern Europe, former Soviet ...
>
>I guess you've never been there...
> ...

Take a closer look.  'ee' happens to be the new domain name
of Estonia (formerly 'ew.su')!

----------------------------------------------------------------------
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: raju@bass.bu.edu (Rajminder Singh)
Newsgroups: comp.lang.pascal
Subject: RS232 interfacing
Date: 23 Nov 92 22:38:51 GMT
Reply-To: raju@bass.bu.edu (Rajminder Singh)
Followup-To: raju@bass.bu.edu
Distribution: na
Organization: Boston University

Hi
	I am looking for function calls available in TP to access dataports
- serial or parallel for interfacing with peripherals (particularly for the
RS232 serial interface). Any help would be appreciated. 
	I am using TP 5.0
Raj
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^ Rajminder Singh, B07 44 Cummington St. ECS Dept. BU MA 02135         ^
^ Email:  ude.ub.ssab@ujar | ude.ub.fgneub@ujar | ude.ub.2bup@ujar     ^
^                                                                      ^
^ (__)___________________________________________________________(__)  ^
^ (oo)                     Cowaxial Cable                        (oo)  ^
^  \/_____________________________________________________________\/   ^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Newsgroups: comp.lang.pascal
From: johnm@cory.Berkeley.EDU (John D. Mitchell)
Subject: Stony Brook Pascal
Organization: University of California, at Berkeley
Date: Wed, 18 Nov 1992 04:29:55 GMT

I just received an information package from Stony Brook about their new
Pascal product for PCs.  It looks really interesting (some highlights: .obj
support, multi-language support (e.g., call or be called by C functions),
smart linking, aggresive optimizer, fully compatible with Borland/Turbo
Pascal (I presume v6), ....

Does anybody now anything else about the company, product, etc.?

Thanks,
	John
	johnm@cory.Berkeley.EDU
From: Paul.Robinson@f417.n109.z1.fidonet.org (Paul Robinson)
Newsgroups: comp.lang.pascal
Subject: String Package (1/4)
Date: 21 Nov 92 17:21:32 GMT

The following is a string processing package for Pascal, in 4 parts;  
this is
 
part 1.
 

 
--- Cut here ---
 
 
 
(*      Permission is hereby granted to republish,
 
 *      but not for profit, any or all of this program,
 
 *      provided that this copyright notice is included.
 
 *
 
 *      Copyright 1979, Oregon Software, Inc.
 
 *                      2340 SW Canyon Road
 
 *                      Portland, Oregon 97201
 
 *                      (503) 226-7760
 
 *)
 
 
 
{
 
Strings are stored as a record structure with a fixed
 
maximum number of characters (normally 100 but easily
 
changeable), and an integer marking the current length of
 
the string.
 
 
 
    type String = record
 
           Len: Integer;
 
           Ch:  array[1..StringMax] of Char
 
           end
 
 
 
The capabilities provided are:
 
 
 
Len(S) - a function giving the current length of string S;
 
 
 
Clear(S) - initializes string S to empty;
 
 
 
ReadString(F,S) - reads a value for string S from the text
 
  file F.  The string is terminated by Eoln(F) and a
 
  Readln(F) is performed.  String overflow (a string longer
 
  than StringMax) results in truncation.
 
 
 
WriteString(F,S) - writes the string S to the text file F.
 
  This function can also be performed by
 
  Write(F,S.Ch:S.Len).
 
 
 
Concatenate(T,S) - appends string S to the target string T.
 
  The resulting value is string T.  Overflow results in
 
  truncation to StringMax characters.
 
 
 
Search(S,T,Start) - searchs string S for the first
 
  occurrence of string T to the right of position Start
 
  (characters are numbered beginning with one).  The
 
  function Search() returns the position of the first
 
  character in the matching substring, or the value zero if
 
  the string T does not appear.
 
 
 
Insert(T,S,Start) - inserts the string S into the target
 
  string T at position Start.  Characters are shifted to the
 
  right as necessary.  Overflow produces a truncated target
 
  string;  a Start position which would produce a string
 
  which was not contiguous has no effect.
From: cschmidt@lynx.dac.northeastern.edu (Christopher Schmidt)
Newsgroups: comp.lang.pascal
Subject: Encryption and Random Numbers
Date: 17 Nov 92 21:15:02 GMT
Reply-To: cschmidt@lynx.dac.northeastern.edu (Christopher Schmidt)
Organization: Northeastern University, Boston, MA. 02115, USA

Duncan Murdoch's interesting STREAMS package includes some
clever encryption logic that uses the TP random number
generator.  It's a nice technique, except that if Borland
modifies the TP random number generator, then you and your
customers will be locked out of your encrypted data.

What exactly are the chances Borland will modify the TP
random number generator?  Do you feel lucky?

Simple solution: Include your own random number generator in
your program.  Anybody have such in TP?  I notice there is a
random number generator in C in the SIMTEL directory
<MSDOS.C>, but I have not looked at it yet.

Christopher Schmidt
Waltham, Massachusetts, USA
cschmidt@lynx.northeastern.edu
From: tcscs!zeta@src.honeywell.com (Gregory Youngblood)
Newsgroups: comp.lang.pascal
Subject: Re: Borland licences (was about old copies of TP)
Date: Fri, 20 Nov 92 15:51:26 CST
Reply-To: zeta%tcscs@src.honeywell.com
Organization: TCS Consulting Services

dmurdoch@mast.queensu.ca (Duncan Murdoch) writes:

> There is one part in there that's a little worrisome, though:
> 
> You're allowed to write and compile programs using the Borland libraries and 
> distribute them (the actual wording is longer), subject to the following 
> conditions (and from here on it's a verbatim quote):
> 
> The program is not a compiler or development tool, environment product or 
> library which includes any of the libraries, DLLs or source code included in 
> this package, nor is the program otherwise a product that is generally 
> competitive with or a substitute for any Borland Language product.
> 
> End of quote.
> 
> It's that last clause that worries me:  lots of programs I write could be 
> seen as "generally competitive with" Borland Language products.  

Does SBP have similar clause?  If not, develope with borland and distribute
sbp.

Greg

.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.
.   TCS Consulting Services   P.O. Box 600008   St. Paul, MN  55106-0008    .
.   ..!srcsip!tcscs!zeta                 ..!src.honeywell.com!tcscs!zeta    .
.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.-=-.
Newsgroups: comp.lang.pascal