HDTenEightyP/NetNews huggingface dataset:
From: amead@s.psych.uiuc.edu (Alan Mead)
Newsgroups: comp.lang.pascal
Subject: Re: Prevent the screen from scrolling?
Date: 26 Aug 92 18:01:15 GMT
Organization: UIUC Department of Psychology

89612048s@csghsg5a.bitnet writes:

>How to prevent a screen from scrolling?

>If I am going to write anything into the last position of the screen
>(80,25) or of a window, the screen is scrolling on line forward. Is there any 
>possibility to prevent the screen from scrolling? Otherwise you
>always have to take care that you never write into the last screen-
>positio.

>Thank You very much for Your help.

>Markus

Yes.  My prefered way is to write to the screen directly.  The base address 
of the screen is $B800 for a color adapter and $B000 for a mono.  The 
structure of (text) video ram is:

type
  cell_type = record
                character : char;
                attribute : byte;
              end;

the 'attribute' field has exactly the same structure as Crt.TextAttr

Versions of TP up to 5.5 included a unit in the examples directory
called WIN.PAS which had an asm routine to do this kind of stuff.  I
don't know if it was included in v6.

The Technojock's Turbo Toolkit (available from wuarchive.wustl.edu last
time i looked) had a similar (perhaps better) routine you might want to
look at.  I didn't examine their Object Toolkit...

I think you can also modify the variable Crt.WindMax.  Something like this:
  
  Crt.WindMax := Crt.WindMax + 1;

This is the same as calling Window( ) with a larger Y2 except that
window() will, reasonably, ignore any calls with invalid arguments.
Also, what you're really doing is:  WM := (WM AND $FF00) OR (lo(WM)+1)
(incrementing the LOW byte).  If the low byte should happen to be 254,
(ie, if your screen has 254 lines in TEXT mode) then you're screwed.

The down side of this method is that TP will happily write to the 26th
line.  I'm not sure what happens then...  Or, if you have a window, then
it writes onto the next line (maybe a frame or part of another window).
Also, if you do a ClrScr, it will try to clear that extra line too...


But on the plus side, the other method will ignore the current window
(since it is screen relative, not dependant on the BIOS).

-alan mead
Newsgroups: comp.lang.pascal
Subject: reading Bit mapped fields
From: cachoo@lincoln.ac.nz
Date: 31 Aug 92 09:41:35 +1200

According to the TurboVision guide and TP programmers manual, to check whether
a particular bit is set in an integer, you can use the AND operator.
lets say that we have:

  var
    I : Integer;
    CheckBoxResult : Word;
    BitIsSet : Array[0..15] of Boolean;
  begin
    {get CheckBoxResult from user}
    for I := 0 to 15 do
      if CheckBoxResult AND I = I then BitIsSet[I] := True
      else BitIsSet[I] := False;
  end;

As I understand TP instructions, this code should return the boolean equivalent 
of the binary value of CheckBoxResult. But it does not work! 
What am I doing wrong?

The other option would be to convert CheckBoxResult to a 'binary' string and
then check each string element (for '0' or '1') to fill up the BitIsSet
array. This seems a little cumbersome compared to the bitwise solution in the
code above. Can anybody help?
Thanks
    Oscar

Newsgroups: comp.lang.pascal
From: c9038467@wombat.newcastle.edu.au
Subject: P.D. Standard pascal compiler !!!!!!!!!!!
Organization: University of Newcastle, AUSTRALIA
Date: Fri, 28 Aug 1992 11:49:27 GMT

Does anybody out there have a public domain copy of STANDARD pascal?
It has to have the ability to look into a file window
		e.g. infile^
This would be VERY much appreciated!!!!!

Thanks in adavance......
				Julian.
				-------
From: Adriaan.Wessels@p17.f120.n7102.z5.fidonet.org (Adriaan Wessels)
Newsgroups: comp.lang.pascal
Subject: Executable
Date: Thu, 03 Sep 92 22:28:00 GMT
Organization: FidoNet node 5:7102/120.17 - Interlink BBS, CT


Answering a msg of <02 Sep 92>, from The Grimm Reaper to All:

Hi Death dude... You can include the .BGI's and .CHR's in the EXE.   Look at the TP 6.0 (I think?) examples... there is an example of this there.

Ciao,
       Adriaan

--  
INTERNET: Adriaan.Wessels@p17.f120.n7102.z5.fidonet.org
via:  THE CATALYST BBS in Port Elizabeth, South Africa.
       (catpe.alt.za)   +27-41-34-1122 HST or +27-41-34-2859, V32bis & HST.
Newsgroups: comp.lang.pascal
From: tech@crash.cts.com (Don Bontemps)
Subject: How to check if printer online?
Organization: CTS Network Services (crash, ctsnet), El Cajon, CA
Distribution: na
Date: 01 Sep 92 20:38:49 PDT

I need to know how to check and see if either printer LPT1 or LPT2 is online
via Turbo Pascal 6.0.  I would really appreciate the help :)   Thanx....



Newsgroups: comp.lang.pascal
From: death@acca.nmsu.edu (The Grimm Reaper)
Subject: Re: Executable
Organization: New Mexico State University
X-Newsreader: Tin 1.1 PL5
Date: Sun, 30 Aug 1992 01:58:43 GMT

Robert Newsome (newso584@Armstrong.EDU) wrote:
: I have a quick question.  Can I take just the executable from turbo pascal and
: put it onto another machine that doesn't have turbo pascal.  Are there some 
: kind of other files that go along with the name.exe?  Both machines are PCs and
: both have DOS.  Any help would be appreciated.

In 99% of the cases, YES is the definate answer.  You do -not- need some
sort of lame runtime module or setup file(s) to run TP executables. 
However, if you are using the BGI (Borland Graphics Interface?) files, the
CHR and .BGI files, then those are required as well (they are screen
drivers and font files)
--
"Only sheep need a leader." - Nomeansno

death@acca.nmsu.edu

Newsgroups: comp.lang.pascal
From: gabriel@netcom.com (Gabriel Beccar-Varela)
Subject: Re: How can I see if a file is open?
Date: Tue, 01 Sep 92 01:09:02 GMT
Organization: Netcom - Online Communication Services (408 241-9760 guest)

In article <al161926.715305119@academ01> al161926@academ01.mty.itesm.mx (Jesus Barrera Ramos) writes:
>I'm having some troubles with files because I need to know if a file is open or not, is there a way to know if a file is OPEN or CLOSED, that's the way I see when a request a Watch to a file variable. Thanks in advance.

   It is very simple: if your file is a textfile you check as follows:

                if TextRec(myfile).mode <> fmClosed then...

    if your file is typed or untyped you say:

                 if FileRec(myfile) <> fmClosed then ...

   Check the TP 6.0 Programmer's Guide, page 141-148.

Good Luck.
Newsgroups: comp.lang.pascal
From: ferincz@methan.chemie.fu-berlin.de (Jozsef Ferincz)
Subject: Re: How can I retrieve the command string from within Pascal program ?
Date: Sun, 30 Aug 1992 17:12:24 GMT
Reply-To: ferincz@methan.chemie.fu-berlin.de
Organization: Free University of Berlin, Organic Chemistry

Shane.Greyvenstein@p1.f37.n7101.z5.fidonet.org (Shane Greyvenstein) writes:

>Hi!
>
> >  vmoe>   How could one retrieve the on-line program
> > parameters,
> >  vmoe> such as the program name, or the whole command
> > string
> >  vmoe> from within the pascal program  ?
>
>Do this, it should work, although I've never tried it <G>
>
>----- CUT HERE -----
>
>var params  : paramstr;
>    i       : integer;
>
>
>
>
>
>begin
>  params:='';
>
>  for i:=0 to paramcount do     { Paramstr(0) is the path }
                                                      ^^^^
                                                      program name with a path
>  params:=params+paramstr(i);
>end.
>
>----- CUT HERE -----
>
>Tell me if it worx :-)
>
>Cherio,
>Shane
>
>--  
>INTERNET: Shane.Greyvenstein@p1.f37.n7101.z5.fidonet.org
>via:  THE CATALYST BBS in Port Elizabeth, South Africa.
>       (catpe.alt.za)   +27-41-34-1122 HST or +27-41-34-2859, V32bis & HST.
-- 
Jozsef Ferincz               INTERNET : ferincz@methan.chemie.fu-berlin.de
Freie Universitaet Berlin             : ferincz@ki1.chemie.fu-berlin.de   
Takustr.3, D-1000 Berlin 33  UUCP     : ferincz@fub.uucp                  
Fax : +(49 30) 838 51 63     Tel.: +(49 30) 838 26 77, 838 53 63
From: lg274644@hp9k.lag.itesm.mx (Guillermo Gomez Saenz)
Newsgroups: comp.lang.pascal
Subject: text
Date: 31 Aug 92 21:42:17 GMT

esto es una prueba de manejo de netnews perdonen./....
Newsgroups: comp.lang.pascal
From: joet@dcatlas.dot.gov (Joe Trott)
Subject: Re: Displaying many discrete screens
Organization: U.S Dept. of Transportation
Date: Fri, 28 Aug 1992 16:48:40 GMT


I created a simple "help" system for some of my apps that used multiple
screens like this.  The screens file contained keywords in front of each
actual screen, with appropriate delimiters.  My help unit "compiled" this
(human readable) file into two files, an index based on the keyword, and
a file of the actual screens.  Throughout the application, a global variable
was updated to contain the most relevant keyword.  When the user requested
help, the application saved the current screen (procs for this are well
documented in the TP manuals), looked up the relevant help screen from the
index file (this could be kept in memory as an array for quick searching),
and displayed it.  When the user left the help screen, the original
application screen was restored.

Hope this helps; I'll dig up the code if you need more information.

-JTT

Newsgroups: comp.lang.pascal
From: ts@uwasa.fi (Timo Salmi)
Subject: Re: How can I see if a file is open?
Organization: University of Vaasa, Finland
Date: Tue, 1 Sep 1992 18:08:26 GMT

In article <al161926.715305119@academ01> al161926@academ01.mty.itesm.mx (Jesus Barrera Ramos) writes:
>I'm having some troubles with files because I need to know if a file is open or not, is there a way to know if a file is OPEN or CLOSED, that's the way I see when a request a Watch to a file variable. Thanks in advance.

Have you taken a look at my TPUs?
 94246 Aug 26 23:18 garbo.uwasa.fi:/pc/ts/tspa2940.zip
 96009 Aug 26 23:20 garbo.uwasa.fi:/pc/ts/tspa2950.zip
 98101 Aug 26 23:20 garbo.uwasa.fi:/pc/ts/tspa2955.zip
 98264 Aug 26 23:21 garbo.uwasa.fi:/pc/ts/tspa2960.zip

..................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1
Faculty of Accounting & Industrial Management; University of Vaasa
Internet: ts@uwasa.fi Bitnet: salmi@finfun   ; SF-65101, Finland
Newsgroups: comp.lang.pascal
From: gabriel@netcom.com (Gabriel Beccar-Varela)
Subject: Re: Question about tWindow in TVision
Date: Thu, 03 Sep 92 04:34:14 GMT
Organization: Netcom - Online Communication Services (408 241-9760 guest)

In article <1992Sep2.122445.22682@rz.uni-karlsruhe.de> ul1f@hp850.uni-karlsruhe.de writes:
>Hi everybody,
>
>today, i've a question about Turbo Pascal 6.0 Turbo Vision. I tryed to
>open a window _without_ a frame.
>
>First, i set the Options to _no_ Frame (Options := Options and not ofFramed;)
>within the init-constructor. Nothing happens (the Option ofFramed is never set
>in my opinion).
>
>Second, i defined a new object tMyWindow = object(tWindow) with the method
>InitFrame.
>
>procedure tMyWindow.InitFrame;
>begin
>  Frame := nil;
>end;
>
>but something happy was the result. I got a frame, but not a full one. The botton
>line was not there (only corrupted).
>
>Now, my question. How is the right way to open a Window _without_ a frame.
       Make sure that you set the Options flag AFTER you call the
       ancestor's constructor:

	constructor TMyWindow.init;
	begin
	TWindow.init;
	Options := Options and not ofFramed;
	end;

      That should work.

	Gabriel. 
Newsgroups: comp.lang.pascal
From: jlevin@umnhcs.labmed.umn.edu
Subject: Looking for Random Number generator
Organization: University of Minnesota
Date: Thu, 3 Sep 1992 09:02:06 GMT

Could anyone point me towards a high quality random number
generator written in Turbo Pascal which is publicly available?
 
---------------------------------------------------
James E. Levin, MD, PhD
Fellow, Health Informatics
University of Minnesota
Pediatric Infectious Diseases
UMHC Box 296, 420 Delaware St, SE
Minneapolis, MN  55455
 
Fax (612) 624-8927, or (612) 624-4102
E-Mail jlevin@umnhcs.bitnet
Internet jlevin@simvax.labmed.umn.edu
---------------------------------------------------

Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: TP units question
Organization: Queen's University
Date: Fri, 4 Sep 1992 16:00:06 GMT

In article <1992Sep4.141203.28370@news.columbia.edu> stone@cunixb.cc.columbia.edu (Glenn Stone) writes:
>If a procedure/function is only used within the implementation section
>of a unit, it doesn't have to be declared in the interface section,
>but is there any disadvantage to doing so?  I'm using TP 5.5.

There are a few kinds of disadvantages:

From an efficiency point of view, putting a procedure in the interface
section automatically makes it a "far" procedure; calls to those are
slightly slower and take a few more bytes in your program.

From a maintenance point of view, putting a procedure in the interface
section means that other code can use it; this ties you down to the
particular way it works.  If you decide you want to change it, you'll have
to track down every use of it outside that unit in order to make sure
they're compatible with the new way.  Generally programs are easier to
maintain if they're "loosely coupled", i.e. the different units function
almost independently of each other.

From the point of view of a user, interfacing it can have both positive and 
negative points.  It makes the unit easier to understand if it only 
interfaces a few routines.  I've got a few units that work perfectly with 
*nothing* interfaced; they're a joy to use, because they're so simple. (They 
do things like initialization and exit handling.)  On the other hand, a 
simple interface can't be flexible.  You may not like the particular high 
level interface to a library unit; if the low-level interface isn't hidden 
from you, you can construct your own high level interface in a new unit, 
without messing up the implementation of the old unit.

Duncan Murdoch
From: rind@binoc.bih.harvard.edu (David Rind)
Newsgroups: comp.lang.pascal
Subject: Re: Prevent the screen from scrolling?
Date: 27 Aug 92 15:17:23 GMT
Organization: Beth Israel Hospital, Harvard Medical School, Boston Mass., USA

89612048s@csghsg5a.bitnet writes:
>If I am going to write anything into the last position of the screen
>(80,25) or of a window, the screen is scrolling on line forward. Is there any 
>possibility to prevent the screen from scrolling? Otherwise you
>always have to take care that you never write into the last screen-
>positio.

The simple solution to this is to add 1 to the variable Windmax
which defines the screen coordinates.  At least this worked in
TP 4.0 which was the last time I had to solve this problem. 
It didn't seem to create any problems.  I haven't seen any other
easy solutions described.
-- 
David Rind
rind@binoc.bih.harvard.edu
From: Grant.Reid@p5.f120.n7102.z5.fidonet.org (Grant Reid)
Newsgroups: comp.lang.pascal
Subject: How can I retrieve the command string from within Pascal program ?
Date: 29 Aug 92 04:30:00 GMT
Article-I.D.: catpe.1972.2AA110B9
Organization: FidoNet node 5:7102/120.5 - Interlink BBS, CT


On 28 Aug 92, Shane Greyvenstein muttered to Grant Reid:

 SG> Tell me if it worx :-)

I didn't post the origional message   :-))

Cheers,
       Grant

--  
INTERNET: Grant.Reid@p5.f120.n7102.z5.fidonet.org
via:  THE CATALYST BBS in Port Elizabeth, South Africa.
       (catpe.alt.za)   +27-41-34-1122 HST or +27-41-34-2859, V32bis & HST.
From: chris@castlab.engr.wisc.edu (Christian Rohrmeier)
Newsgroups: comp.lang.pascal
Subject: Re: Read any key from the keyboard?
Date: 1 Sep 92 15:57:17 GMT
Organization: U of Wisconsin-Madison College of Engineering

In article <1992Sep1.123402.160@csghsg5a.bitnet> 89612048s@csghsg5a.bitnet writes:
>How to read any key from the keyboard?
>
>Can someone give me an example how to read any key pressed on the
>keyboard. That means also the ALT SHIFT CONTROL and combinations
>of these keys.
>
>And also, can you help me about the Num, Scrol and Capslock keys.
>How to turn them on and off, and how to get there current status?
>
>I want to say thank you very much for your help.
>
>Yours Markus

I can answer the 1st part of your question:

function getkey:string;

begin
  key:=readkey;
  getkey:=key;
  if key= chr(27) then getkey:='esc'
  else if key= #0 then begin
    key:= readkey;
    if key= 'I' then getkey:='pgup'
    else if key= 'Q' then getkey:='pgdn'
    else if key= 'O' then getkey:='end'
    else if key= 'G' then getkey:='home'
    else if key= 'H' then getkey:='up'
    else if key= 'P' then getkey:='down'
    else if key= 'K' then getkey:='left'
    else if key= 'M' then getkey:='rite'
  end;
end;

Ok, its not elegant, but it works (use case if you wanna.)
The deal is, any non-normal key will return a #0 value the 1st readkey,
and a letter value the next readkey you do (before anymore keys are hit.)

So, looking back of your handy-dandy TP6.0 Programmer's Guide, page 350, will
show you all the other letter equivilencies for all the ALT, CONTROL, and
Function Key combinations.

Some keys are not gonna give you the #0 code though, so just check for their
numeric ASCII value with chr(x), as I did in the case of ESC (A complete ASCII
chart is found on page 348).

The other way to do this is to do some in-line assembler routine and use the Hex
codes found (conveniently enough) on page 352!

Enjoy. 

-Chris
Newsgroups: comp.lang.pascal
From: stone@cunixb.cc.columbia.edu (Glenn Stone)
Subject: TP units question
Reply-To: stone@cunixb.cc.columbia.edu (Glenn Stone)
Organization: Columbia University
Date: Fri, 4 Sep 1992 14:12:03 GMT

If a procedure/function is only used within the implementation section
of a unit, it doesn't have to be declared in the interface section,
but is there any disadvantage to doing so?  I'm using TP 5.5.


-------------------------------------------------------------------------
  Glenn Davis Stone                                BITNET: stone@cunixf
  Columbia University            INTERNET: stone@cunixb.cc.columbia.edu
-------------------------------------------------------------------------
From: cschmidt@ds5000.DAC.Northeastern.edu (Christopher Schmidt)
Newsgroups: comp.lang.pascal
Subject: LENGTH and POS in TP 5.5
Date: 4 Sep 92 04:22:23 GMT
Organization: Northeastern University, Boston MA. USA 02115

Here is a problem with the LENGTH function in TP 5.5 that cost me
several hours of debugging.  After discovering the source of the
problem, I investigated the POS function as well.

The TP 5.5 documentation says the LENGTH function returns a value
of type integer.  Apparently, it actually returns a value of type
byte.  If the return value were of type integer, then the
following program would display the numbers 256 and -1.  Instead,
the program displays the values 0 and 255.

    var
        s : string;
    begin
        s [0] := #255;
        writeln (succ (length (s)));

        s [0] := #0;
        writeln (pred (length (s)));
    end.

The following two workarounds produce exactly identical code.

    Workaround 1: Typecast the result of LENGTH to integer.

        succ (integer (length (s)))
        pred (integer (length (s)))

    Workaround 2: Use +1 and -1 instead of SUCC and PRED.

        length (s) + 1
        length (s) - 1

The TP 5.5 documentation says the POS function returns a value of
type byte.  Apparently, it actually returns a value of type
integer.  If the return value were of type byte, then the
following program would display the numbers 0 and 256.  Instead,
the program displays the values 256 and -1.

    var
        s : string;
    begin
        fillchar (s, sizeof (s), 255);

        s [255] := 'A';
        writeln (succ (pos ('A', s)));

        s [255] := ' ';
        writeln (pred (pos ('A', s)));
    end.

This program compiles to exactly the same code as when the POS
function is typecast to integer, or when +1 and -1 are used
instead of SUCC and PRED.

NOTE TO BORLAND: When you fix these and other problems, please
let use know, so we can determine whether your fix invalidates
our workarounds.  Thank you.

Christopher Schmidt
Waltham, Massachusetts, USA
cschmidt@lynx.northeastern.edu

Newsgroups: comp.lang.pascal
From: phshl@wombat.newcastle.edu.au (S.H. LEE (61) 49 21 5566)
Subject: porblem with TVG103
Organization: University of Newcastle, AUSTRALIA
Date: Thu, 27 Aug 1992 06:33:29 GMT

Hi guys,
  Has anyone encountered problem with TVG103 from GARBO? As soon as I use
the mouse, the screen behaves erratically. 

Lee
From: ss62+@andrew.cmu.edu (Shelby Stewman)
Newsgroups: comp.lang.pascal
Subject: Re: Executable
Date: 28 Aug 92 19:06:07 GMT
Organization: Heinz School, Carnegie Mellon, Pittsburgh, PA

To answer your question:

    First, there are two types of DOS executables. One is strictly a
memory image which is only supposed to occupy a single segment. This
type is called a COM file for the obvious reason that most of these
files have the name of [name].COM . The second kind of file is a little
more complex. This kind of file can span multiple segments and is more
than a memory image. This type of file is called an EXE file for the
obvious reason that most files of this type have the name [name].EXE . 
    So, to answer your question: YES YES YES YES YES YES
YES!!!!!!!!!!!!!!!!!!!!!!! EXE files are the MOST common types of files
on MS-DOS/DR-DOS/OS.2 (version 2.0 and 1.x compatability box) machines. 


Note, segments are 64K blocks of memory. They are refered to in programs
(TP) as Mem[segment:offset (offset value from segment originator)],
MemW[segment:offset], or MemL[segment:offset].

Hope this helped.

                -- Shannon F. Stewman, email: ss62@andrew.cmu.edu
From: chard@genghis.borland.com (Richard Nelson)
Newsgroups: comp.lang.pascal
Subject: Re: Borland Buttons
Summary: BWCC.DLL
Date: 4 Sep 92 20:47:47 GMT
Article-I.D.: genghis.1992Sep4.204747.29572
Organization: Borland International
Originator: chard@genghis.borland.com

>In TPW, Does anyone know what DLL the Resource Editor loads in to handle
>it's borland bitmap buttons?  I am writing a program which uses these
>buttons and only seems to work when the resource editor is loaded.  The only
>explanation I could come up with is that it is loading a DLL which my
>program needs, but isn't loading.  Anyone have any info?

That would be BWCC.DLL.  BWCC is Borland Windows Custom Controls.  I
can't remember the name of the procedure, but there's a procedure you
can call in the BWCC unit that loads the DLL.  Sorry I don't have the
info at my fingertips, but it's in one of the online DOC files that
comes with Resource Workshop.
-- 
=========================================================================
 Richard Nelson, Borland Int'l | chard@borland.com | Go Bears! Grrr-rah!
  Had this been Borland's opinion, I would have written it in a manual.
             "Be good and you will be lonesome." -- Mark Twain
Newsgroups: comp.lang.pascal
From: konopka@ils.nwu.edu (Ray Konopka)
Subject: Re: disc by email
Organization: The Institute for the Learning Sciences
Date: Wed, 26 Aug 1992 17:04:16 GMT

In article <1992Aug26.123911.1@urc.tue.nl> bwaahio@urc.tue.nl writes:
>Hello,
>
>My news-read-account is going to disappear (tonight at 8 pm). I know it's
>possible to get (some) newsgroups by email. Can PLEASE somebody mail me (adress 
>s89405079@hse.nl) the names of the listservers where I can get the
>comp.lang.pascal, cop.binaries.ibm.pc.d and
>comp.binaries.ibm.pc.archives-discussions?
>
>Please help me.
>
>Edwin Groothuis
>S89405079@hse.nl, or edwin@amiga@hse.nl

I would appreciate a copy of this information too.  Thanks.
Ray Konopka
konopka@aristotle.ils.nwu.edu

Newsgroups: comp.lang.pascal