HDTenEightyP/NetNews huggingface dataset:
From: root@alex.rinaco.msk.su (alex kotov)
Subject: Re: A Simple TP6 question
Reply-To: root@alex.rinaco.msk.su
Organization: Alex Home
Date: Wed, 22 Jul 92 17:07:44 +0300

Greetings:

>
>   if keypressed then
>      if readkey = chr(0) then
>         if readkey = 'K' then
>             do leftarrow
>
>
>   But this doesn't work. Any help on this would be appreciated.

I suppose that readkey can interfere with TP built-in debugger if you step
through this piece of code. Try to place a breakpoint on 'do leftarrow' line.

I think that keypressed and readkey are too awkward to work with.
To provide keyboard interface I wrote too small functions:

(*****************************************************************)
(* GetKeyWord - returns the next keystroke with wait.            *)
(* The keystroke is returned as a word, with ASCII code in LSB   *)
(* and scan code in MSB, ex.                                     *)
(*     w := GetKeyWord;                                          *)
(*     ASCIIcode := Lo(w);                                       *)
(*     ScanCode := Hi(w);                                        *)
(* Using this function you can distinguish between white plus    *)
(* and gray plus and so on. The codes being returned are         *)
(* identical to those in Drivers.pas                             *)
(*****************************************************************)
function GetKeyWord : word;
var r : Registers;
begin
  r.ah := 0;
  Intr($16,r);
  GetKeyWord := r.ax;
end;

(**********************************************************************)
(* KeyWaiting: returns True if a keystroke is waiting                 *)
(* in a keyboard buffer and the key code in 'key' variable.           *)
(* The keystroke is not removed from the buffer!                      *)
(* If no keystrokes are waiting in the keyboard buffer, returns False *)
(**********************************************************************)
function KeyWaiting(var key:word) : boolean;
var r : Registers;
begin
  r.ah := 1;
  Intr($16,r);
  if r.Flags and FZero = 0 then begin
     key := r.ax;
     KeyWaiting := True;
  end
  else KeyWaiting := False;
end;

Should I write 'hereby released to the public domain' ? :-)

Hope this helps,
-- 
+--------------------------------------------------------+
| Alex Kotov | root@alex.rinaco.msk.su     Moscow Russia |
|------------+     FIDO 2:5020/48.7 AKA 2:5020/75.7      |
+--------------------------------------------------------+


Newsgroups: comp.lang.pascal
From: bx304@cleveland.Freenet.Edu (Jeff Epler)
Subject: Re: Help with CD-ROM stuff
Reply-To: bx304@cleveland.Freenet.Edu (Jeff Epler)
Organization: Case Western Reserve University, Cleveland, OH (USA)
Date: Fri, 24 Jul 92 14:39:39 GMT


In a previous article, handbook@orion.oac.uci.edu (Handbook) says:

>Hi,
>
>You people are always so helpful, I have another one for you: 
>
>I'm looking through Ralf Brown's list of PC Interrupts and there is one
>that I'm interested in which deals with CD-ROMS.  Explicitly, it is used 
>to "Determine the name of the file in the CD-ROM's volume table of contents
>which contains the abstract describing the disk".
>
>This interrupt is 2Fh AX= 1503h
>
>In the book, it states the following:
>
>   Registers at call:
>   AX = 1503h
>   ES:BX -> 38 byte buffer for name of abstract file
SEG ^^ ^^ OFS

These two point to the buffer where the name will be stored.

You would need to allocate the 38 bytes (Could be done in a static
manner) and load ES with what you get back from SEG and BX with what you
get back with OFS (I think I have my functions right.  Seg returns the
segment, ofs returns the offset.)
>   CX = drive number (0 = A)
>
>   Return Registers
>   CF set if drive is not a CDROM drive
>      AX=15 (invalid drive)
>   CF clear if successful
>
>My question then is,  what does "ES:BX" mean, and how do I write that in TP 6?
-- 
|Jeff Epler               Additions Welcome                ;-) >{8-) |
| :) (=( =-] (-= Celebrating the variety of faces =-> :^) {-= |-) (: |
|                                                   Lincoln, Nebraska|
From: stephan@blade (Stephan Eggermont)
Newsgroups: comp.lang.pascal
Subject: Re: Is this legal - why/why not?
Date: 30 Jul 92 15:09:20 GMT
Organization: MCGV Stack, Eindhoven University of Technology, the Netherlands.
X-Newsreader: Tin 1.1 PL4

sirosh@cs.utexas.edu (Joseph Sirosh) writes:
: However, the following declaration does not work, though Pascal definition
: does not say anything against it.

Think Pascal as well as Turbo Pascal don't claim to be Standard Pascal 
compilers, so the Pascal definitions are not going to be of any help.
The only place wher you can find the source of the problem is your manual
(and the internet of course :-) ).

: 	Type Used2 = (Integer);
: The error message from the compiler is 'This does not make sense'.
: Why? Why is this declaration illegal?

Declaring an enumeration of one item doesn't make much sense, does it? 
Here Integer is just an identifier.
 
: 2. The second question is similar. How come the following declaration
: does not work,
:  Var ar1: array[Integer] of char;

Just another compiler bug. And of course it's 64K, which is a big no-no.

  Groetjes,
  Stephan
  stephan@blade.stack.urc.tue.nl







Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca
Subject: Re: Constant objects in TP 6.0
Originator: dmurdoch@mast
Organization: Queen's University, Kingston, Canada
Date: Thu, 30 Jul 1992 17:55:41 GMT

In article <Bs7qyv.KK3@knot.ccs.queensu.ca> dmurdoch@QueensU.CA (Duncan Murdoch) writes:
>
>I'd suggest the following alternative syntax for constant objects:
>
>type
>  descend : TDescend.Init(...);

That should be a "const" block, not a "type" block, of course.

Duncan Murdoch
dmurdoch@mast.queensu.ca

P.S. I've noticed the newsreader here puts a junk "From" address in the
header.  Sorry for any inconvenience!

Newsgroups: comp.lang.pascal
From: dash@skyfox.usask.ca
Subject: PASCAL TO C TRANSLATOR
Organization: University of Saskatchewan
Date: Fri, 24 Jul 1992 19:21:56 GMT

Hi, I am new to this group. This may be an old question. But I would appreciate
if someonecould let me know whether a PASCAL TO C translator exists.

        Thanx.                                  Bye.
Newsgroups: comp.lang.pascal
Subject: Re: Input validation standards (was Re: ... Inputing Real Numbers)
From: cachoo@lincoln.ac.nz
Date: 22 Jul 92 17:11:16 +1200
Distribution: comp.lang.pascal

In article <54370@mentor.cc.purdue.edu>, pf@bilbo.bio.purdue.edu (Paul Furbacher) writes:
> In article <9978@vice.ICO.TEK.COM>, bobb@vice.ICO.TEK.COM (Bob Beauchaine) writes:
>>   I recently received email from a user of TVinp101 who mentioned a
>>   question touched on in passing on this group:
>>   What is the proper way to check the validity of an input in a
>>   dialog box?  I don't have a copy of the CUI spec, but a poster
>>   here as I remember mentioned that no input should be validated
>>   until the user attempts to close the dialog.  My routines
>>   currently trap keystrokes that change the focused view and
>>   validates the input right on the spot, but I made
>>   no attempt to trap mouse initiated focus changes.  As I
>>   contemplate an upgrade, I would like to resolve this issue before
>>   I release a new version.
> 
> 
> I had wondered about this, too.  In deriving an  input validation for 
> descendents of TInputLine (hadn't seen Bob's unit on garbo), the 
> question of whether to trap loss-of-focus caused by the mouse
> arose.  Surveying many programs which do and do not conform 
> to CUA standards, it appears that none do this.  I tried 
> various schemes for doing this, but it seemed too difficult to 
> implement (but I was much less experienced with TV at 
> that time).
<...>
> though few implement this.  Could it be that mouse  events
> in event-driven systems are handled in such a way as
> to make this more difficult to implement, therefore, the path
> of least resistance is taken time-after-time?  It seemed 
> difficult to trap the loss-of-focus caused by the mouse 
> in TV.  Since I made my compromise, I haven't 
> thought/worried about it since.
> 
> In terms of the mouse and *most* (not all) operations, 
> my advice is "use the  keyboard".  For many users, that's 
> a novel idea.

Excuse my ignorance, I don't know what CUA standards are. But concerning
input validation in TV, I've found it convenient to use the cmReleasedFocus
broadcast command. This command is issued everytime a view losses focus,
whether through keyboard or mouse action, this command informs TDialog that 
it should give focus to a different view. So my approach is to create a
TSmartInputLine whose HandleEvent responds to cmReleasedFocus (this command
is broadcast back from the dialog to all its subviews), if the Event.InfoPtr
is equal to @Self, then the input line 'knows' that it should validate itself.
Makes sense?

Oscar
From: tech@crash.cts.com (Don Bontemps)
Newsgroups: comp.lang.pascal
Subject: Re: Standard pascal question...
Date: 29 Jul 92 04:49:17 GMT
Organization: CTS Network Services (crash, ctsnet), El Cajon, CA

In article <151c6vINN1d9@scout.ksu.ksu.edu> misra@scout.ksu.ksu.edu (Boo!) writes:
>
>	I hope some of you can help me out here. I am writting some sorting
>routines and i would like to time how long it takes the program to sort
>Is there any function in TP5.5 that will allow me to do this? Like 
>print the time of start and finish..?? Thanks.. alot.. take care.. 

Well you already suggested the answer.  Read the system clock before
and after your routine.  The difference between the two will be your
sort time.  This method is not the most accurate but it sure it the
easiest.
Newsgroups: comp.lang.pascal
From: amead@s.psych.uiuc.edu (Alan Mead)
Subject: Re: how long is a clock cycle (was source for DELAY procedure)?
Organization: UIUC Department of Psychology
Date: Fri, 31 Jul 1992 13:36:22 GMT

holland@matt.ksu.ksu.edu (Rich Holland) writes:

>amead@s.psych.uiuc.edu (Alan Mead) writes:

>>But I see several problems.  FlushKBD will, depending on how I
>>implement it, take a different amount of time to execute depending on
>>how many keystrokes are in the buffer.

>No it won't.  Just make the Head and Tail pointers the same.  It will
>do the same operation everytime you call FlushKBD, and it will clear
>any keystrokes (not overwrite them, just pretend they don't exist).  
>Send mail if you need code to do this...

Thanks for the info.  I've tried the trace method you suggested 
without much success in the past--my machine level skills are 
shakey.

I thought there was another option for flushing the keyboard.  Isn't
there a BIOS or DOS call?  I don't have a reference.  I'd like to 
avoid direct manipulation of the BIOS buffer since replacement
buffers are occationally encountered.

>See how it works?  Does it help any?

Quite.  Thanks again.

-alan

>Rich Holland             | INTERNET:  holland@matt.ksu.ksu.edu
>"Jesus saves...but Gretzky gets the rebound!  He shoots!  He scores!!" 
:)
Newsgroups: comp.lang.pascal
From: donaldc@ug.cs.dal.ca (Donald Chisholm)
Subject: TP Editor Toolbox (TP 6.0 update)
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada
Date: Tue, 28 Jul 1992 17:00:55 GMT

	I'm not sure this is allowed on the Net but I have nothing to loose
by asking :)

	Is there anyone out there who can get me the TP 6.0 version of 
BINED.OBJ. I recently upgraded to TP 6.0 and want to get the upgrades for
the Editor Toolbox and I am told I require this file. I do not have a 
compuserve account (way too expensive from Canada) so any help would be
appreciated.

Don

Newsgroups: comp.lang.pascal
From: veit@opal.cs.tu-berlin.de (Veit Zimmermann)
Subject: Re: Functions and Procedures as Parameters
Organization: Techn. University of Berlin, Germany
Distribution: fb20
Date: Tue, 21 Jul 1992 20:35:45 GMT

husak@ux1.cso.uiuc.edu (Stephen R. Husak ) writes:

>I've been trying to implement the following in TP5.5... Could someone
>either clue me in or tell me if it is possible.
>
>I want to pass a function into another function:
>
>eg --	function First(a,b: real;
>		       function test(x:integer):integer);
>	
>	{ rest of function follows }
[stuff deleted]
You're lucky
I did this two days ago. It goes like this:
First you must declare a FunctionType e.g. :
	Type TestFunc = FUNCTION (x : INTEGER) : INTEGER;

Now you are able to do this :
	FUNCTION First (a, b : REAL; 
			test : TestFunc) : INTEGER;
	BEGIN
	  first := test (TRUNC (a*b));
	END;

Calling First goes simply like this :
	First (x, y, TrueTester);

with 	TrueTester (x : INTEGER) : INTEGER;

Hope this helps

		CIAO
			veit	[zimzim@marie.physik.tu-berlin.de]
Newsgroups: comp.lang.pascal
From: ts@uwasa.fi (Timo Salmi)
Subject: Re: code Scrambler?
Organization: University of Vaasa, Finland
Date: Tue, 28 Jul 1992 05:41:01 GMT

In article <Bs28AC.H8B@knot.ccs.queensu.ca> dmurdoch@QueensU.CA (Duncan Murdoch) writes:
>In article <31537@adm.brl.mil> J_SCHULL@acc.haverford.edu (Jonathan Schull) writes:
>>I'm developing a proprietary .TPU tool.  I can't distribute the

>BTW, if you don't make source code available for your unit, there will
>be a large body of users (including me) who won't use it.  The nature of
>the .TPU design is such that it's necessarily version-specific; if I

That's true (as we've discussed once).  You can, of course, release
the TPU for the main versions of TP. 

>One thing that would be useful for people in your position would be a
>source scrambler, that stripped comments and white space, and changed
>local names, but I've never seen one.

Neither have I for TP, but the idea has been used for Sinclair QL
SuperBASIC.  Stripping the comments and the spaces might not be a
very difficult program to write.  I'll have to think about it.  The
local names are more involved.

   All the best, Timo

..................................................................
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: leonard@qiclab.scn.rain.com (Leonard Erickson)
Subject: Re: Graphics Printing
Reply-To: 70465.203@compuserve.com
Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
Distribution: na
Date: Wed, 29 Jul 1992 21:06:50 GMT

lemek@eecae.msu.edu (John P. Lemek) writes:

>Does anybody know of a way to output a graphics screen from TP6 without 
>pressing the PrtScr key.  I'm working on a project where there won't be access
>to a keyboard, rather the input interface will be a touch screen.  I'm trying
>to use an HP 500C Color Deskjet, so I would like to be able to output color
>graphics.

Well, the crudest way of handling this is to just call Interrupt 5! That's
what pressing the PrtSc key does. If you've got Graphics.com loaded, and
it supports the screen mode, you'll get a printout of the grpahics screen.

The other option is to write a routine to read the screen pixel by pixel,
and translate that to something the printer can handle.
-- 
Leonard Erickson		      leonard@qiclab.scn.rain.com
CIS: [70465,203]			 70465.203@compuserve.com
FIDO:   1:105/56	 Leonard.Erickson@f56.n105.z1.fidonet.org
(The CIS address is checked daily. The others infrequently)
From: greg.vigneault@bville.gts.org (Greg Vigneault) 
Newsgroups: comp.lang.pascal
Subject: GENERIC INTEGER
Date: 24 Jul 92 14:49:00 GMT
Reply-To: greg.vigneault@bville.gts.org (Greg Vigneault) 
Distribution: world
Organization: Baudeville BBS - Toronto, Canada 416-283-0114/6059* *v32bis/HST

 In <1992Jul20.211817.14744@usenet.ins.cwru.edu>
 Re: TP 6.0: Generic integer format?
 wct@po.CWRU.Edu (William C. Thompson) writes...

>>Ok, I want what you say I can't do.  I want a procedure that can
>>receive any number.

>That you can't do.  I wanted the same thing at one point.  Perhaps you
>could find a trick or something.  Unfortunately, that requires knowing
>a lot more about the code.  Do you have the code already written?

 Actually, you can, if it's a variable versus value reference. Just
 use an untyped variable in the formal parameters list.  The real
 trick is for the receiving function to know what data size/type the
 address points to.  BTW, TP6 isn't a factor (I use TP55).

 Greg_

 Jul.24.1992.Toronto.Canada.        greg.vigneault@bville.gts.org
From: guglielmetti@elia.epfl.ch (Philippe Guglielmetti)
Newsgroups: comp.lang.pascal
Subject: Re: Turbo Vision Resource Compiler
Date: 24 Jul 92 13:20:45 GMT
Organization: Institut d'Automatique IA-DME-EPFL
X-UserAgent: Nuntius v1.0

Blaise Computing has a TVision Ressource editor and compiler in their 
"Turbo Vision Development Toolkit" which also includes some new objects 
which are of interest when developing a TV based application.
This is a product with  Borland's philosophy : top quality ,low cost and
heavy doc.
I can't figure how you could do better and their price is almost
shareware...

Philippe Guglielmetti     |  ***                *
Institut d'Automatique    | *                   *
Ecole Polytechnique       | *  **   ***   *  *  *   *  *
Federale de Lausanne      | *   *  *   *  *  *  *   *  *
1015 Lausanne             |  ***    ***    ***   *   ***      
SWITZERLAND               |
guglielmetti@elia.epfl.ch | SMILE ! Tomorrow will be worse.
Newsgroups: comp.lang.pascal
From: cjlee@napier.uwaterloo.ca (Ironman)
Subject: Reading Keys without TurboVision
Organization: University of Waterloo
Date: Wed, 29 Jul 1992 10:08:51 GMT

In article cspradling@eagle.wesleyan.edu writes:
>>[...]
>>if keypressed then
>>   if readkey = chr(0) then
>>      if readkey = 'K' then
>>          do leftarrow

In article muzzle@cs.uq.oz.au writes:
>I would suggest using the event handlers from the DRIVERS unit, so that you
>have access to the kbXXXXX constants, such as kbLeft, kbUp, kbCtrlLeft, etc.
>I'm sure that there will be examples of this in the DOCDEMOS directory.

The DRIVERS.INT seems to require the use of TurboVision.
Can it be used WITHOUT TV?  I'm writing a very simple program
that will perform better if it can respond to the Shift-key
(by itself, not in combo with other keys).  I don't want
to use TV if possible.

Can someone e-mail me a (simple) procedure for reading Shift, Alt,
Ctrl, Print Screen, ScrLck, Pause, etc. that works with TP6?

Thanks in advance.
Newsgroups: comp.lang.pascal
From: bx304@cleveland.Freenet.Edu (Jeff Epler)
Subject: Re: Functions and Procedures as Parameters
Reply-To: bx304@cleveland.Freenet.Edu (Jeff Epler)
Organization: Case Western Reserve University, Cleveland, OH (USA)
Date: Tue, 21 Jul 92 05:00:43 GMT


In a previous article, husak@ux1.cso.uiuc.edu (Stephen R. Husak) says:

>I've been trying to implement the following in TP5.5... Could someone
>either clue me in or tell me if it is possible.
>
>I want to pass a function into another function:
>
>eg --	function First(a,b: real;
>		       function test(x:integer):integer);
>	
>	{ rest of function follows }
>
>I know this is implemented in some versions of Pascal. Is this possible
>in TP and if it is what am I doning wrong...???? Thanks!
>

I believe so.  But, this is from memory and my copy of TP isn't handy.

I *think* that one must declare a TYPE that is a function.  What you
have above doesn't work for the same reason that function
george(harry:array[1..20] of char):char; doesn't work.

Try something like this:

type 
 xfunction:function(x:integer):integer;

function yfunction(first,last:integer; theFunc:xFunction):integer

Then in the procedure it should look something like:
 inc(temp,theFunc(i));

Just as though theFunc was a 'normal' function.  (It is, however, a
pointer.  And whenever someone talks of pointers, I get hives.  It
reminds me of when I tried to learn C. :)
-- 
|Jeff Epler               Additions Welcome                ;-) >{8-) |
| :) (=( =-] (-= Celebrating the variety of faces =-> :^) {-= |-) (: |
|                                                   Lincoln, Nebraska|
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Subject: Re: Help me
Reply-To: dmurdoch@mast.queensu.ca
Organization:  Queen's University
Date: Wed, 22 Jul 1992 13:29:43 GMT

In article <14hf5sINN811@matt.ksu.ksu.edu> rclotfel@matt.ksu.ksu.edu (Red Dragon) writes:
>the reason this is screwing up is because you are closeing the file
>that you are trying to erase, the file must be open in order to erase
>it.

This is exactly wrong.  The file *may not* be open when you erase it.
See the library reference manual.

Duncan Murdoch
dmurdoch@mast.queensu.ca
From: amead@s.psych.uiuc.edu (Alan Mead)
Subject: how long is a clock cycle (was source for DELAY procedure)?
Organization: UIUC Department of Psychology
Date: Thu, 30 Jul 1992 14:35:30 GMT

Tim C wonders who has the source for Crt.Delay.  I know how it works,
it initializes itself at start-up.  Probably by running an empty loop
for a clock tick or two.  If you have a fairly long delay and a clone
with a turbo button, try this experiment:  toggle the turbo during the
delay.  Since Delay() has already initialized, it will completely
screw it up.

I want to run another process during a Delay().  I don't want people to
overflow the BIOS keyboard buffer (it beeps then and that is bad for this
app).  I think the easiest way will do this is something like:

procedure BusyDelay( period:integer );
  const shorter = 200;
  begin
    number := period DIV shorter;
    for i := 1 to number-1 do
      begin
        delay( shorter );
        FlushKBD; { this is my own procedure to flush the BIOS keyboard buffer }
      end; 
    delay( period - number*shorter );
  end; { proc Busy Delay }

But I see several problems.  FlushKBD will, depending on how I
implement it, take a different amount of time to execute depending on
how many keystrokes are in the buffer.

Also, the delay will be longer than period milliseconds by number*<the
time it takes to execute FlushKBD>.

Which all seems to bear on the value of shorter.  I think that the
bigger I make it, the less trouble I accrue from the other points.

And all this stuff would seem to be processor (even machine!)
specific.  Different machines will execute FlushKBD at different
speeds.

Anyone have any suggestions?  Anyone know where in the executable code
I can find the Delay procedure's initialization data?

-alan mead
Newsgroups: comp.lang.pascal
From: kine@phoenix.oulu.fi (Markku Kinnunen)
Subject: TP 6.0: Rounding numbers
Organization: University of Oulu, Finland
X-Newsreader: Tin 1.1 PL4
Date: Fri, 24 Jul 92 15:57:23 GMT

  I have problems in programming a function (bug-free and fast) that 
rounds an extended-type value to a specific precision. 
(function Fix(e:Extended;d:Integer):Extended;).  

  Examples:

    function                    result 
    Fix(1234.494,2)            1234.49
    Fix(1234.494,1)             1234.5
    Fix(1234.494,0)               1234
    Fix(1234.494,-1)              1230
    Fix(1234.494,-2)              1200

  Could somebody help me, please! 
  
  Thanks,
    -Markku       
--

* Markku Kinnunen --- Univercity of Oulu, Finland --- kine@phoenix.oulu.fi *  


Newsgroups: comp.lang.pascal