HDTenEightyP/NetNews huggingface dataset:
From: berend@contrast.wlink.nl (Berend de Boer)
Newsgroups: comp.lang.pascal
Subject: BP7 and Turbovision Questions
Date: Wed, 30 Dec 1992 09:14:20

Kristen Anne Pribis wrote in a message to All:

 KAP> The last time I programmed in Pascal I used TP 4.0.  I
 KAP> recently  received BP 7.0 and am absolutely amazed at its
 KAP> capabilities.   I am slowly working my way through Turbo
 KAP> Vision, and have a  question.  I would like a data entry
 KAP> window to be opened as  soon as the program starts, asking
 KAP> for the user to swipe a 
 KAP> credit card through a card reader (simulates keyboard
 KAP> input).   If the card is swiped through (the string ends
 KAP> with '?'), I  want to run a routine without the user having
 KAP> to hit enter or  any key.  If the user presses F3, instead
 KAP> of swiping the card,  I would like to run another routine
 KAP> for manual entry.

 KAP> 1) Where should I place the first window procedure?  In the 
 KAP> Application Init constructor?  Or can I simulate an event
 KAP> and pass the simulated event (such as cmOpenInitWindow or 
 KAP> something) to the HandleEvent procedure?

I would do it so:

begin
  MyApp.Init;
  {* set up a dialog box and execute it *}
  MyApp.Run;
  MyApp.Done;
end.

Not necessary, but it's the easiest way.

 KAP> 2) How can I scan a data entry field for a '?' and then end
 KAP> data  entry once it receives the '?'?

Popup a dialogbox (because it should be modal). Override the HandleEvent
of this Dialog box. Pseudo code (not bullet proof, just to give you an
idea). I have done it a bit differently. The user doesn't even have to
press F3. If a ? is encountered as the first char, card input is assumed
else keyboard input. Keyboard input has to be ended with pressing Enter,
card input not.


procedure TMyDialog.HandleEvent(var Event : TEvent);
begin
  if Event.What and evKeyBoard <> 0 then  begin
    if key is the first time '?' and it is the first input
    then  assume card input.
    if key is the 2nd time '?' and input was card input
    then issue a cmOK command
  end;
  TDialog.HandleEvent;
end;

Set up a dialog with a standard input line and a standard OK button. Get
the inputted value (either keyboard or card) with the GetData method.

 KAP> 3) If I'm scanning for a '?', can I still capture an F3 to
 KAP> run a  different routing?

See, above.

 KAP> Replies can be posted here, but preferably mailed to me at
 KAP> pribik@rpi.edu.  Thanks in advance, and to all of those who
 KAP> helped me with my async communications questions.

I prefer replying in this area so others can comment.


Groetjes,

Berend. (-:
fido: 2:281/527.23
email: berend@contrast.wlink.nl

Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: Why doesn't this cause an error?
Organization: Queen's University
Date: Sat, 2 Jan 1993 20:50:50 GMT

In article <34851@adm.brl.mil> stone@hilbert.math.grin.edu (John David Stone) writes:
>        Because the Pascal standard specifies that
>
>                for v := e1 to e2 do body
>
>shall be equivalent to
>
>                begin
>                    temp1 := e1;
>                    temp2 := e2;
>                    if temp1 <= temp2 then begin
>                        v := temp1;
>                        body;
>                        while v <> temp2 do begin
>                            v := succ (v);
>                            body
>                        end
>                    end
>                end
>
>where temp1 and temp2 are otherwise unused identifiers of the same type as
>v (or, if v is a subrange type, of the host type of v's type), with the
>restriction that no assignments to v are permitted within body.

Here's another difference between Turbo Pascal and the standard:  TP 
implements the for as if temp1 and temp2 are of exactly the same type as v.  
For example, if v is of type 1..10, then the standard won't complain about

  for v:=1 to 0 do...

but TP will give a range check error, because 0 can't be assigned to the 
1..10 subrange.

Duncan Murdoch
dmurdoch@mast.queensu.ca
Newsgroups: comp.lang.pascal
Subject: Re: BP7 on CD-ROM
From: cscmd@lux.latrobe.edu.au (Mitch Davis)
Date: Thu, 31 Dec 1992 03:14:14 GMT
Organization: La Trobe University

In article <XNH7VB1w164w@nzkites.UUCP> foster@nzkites.UUCP (Foster Schucker) writes:
>My personal Borland Pascal sales person called the other day to let me
>know that BP7 was out.  I informed him that I had fallen over the box
>to answer the phone.

You think you've got problems - The box is so big I'm thinking of having
the phone put on, and moving in!

Mitch.
From: Jim@bepcp.UUCP
Newsgroups: comp.lang.pascal
Subject: PCX Unit wanted
Date: Wed, 23 Dec 92 15:19:09 EST

I'm in possesion of a unit called PCX.PAS, which provides routines for
decoding PCX files.  The source code was posted either here, or on the
Fidonet PASCAL echo. It's apparently a part of a larger package that includes
some demo programs.  I'd like to look at the demo code, but it wasn't posted.

The source code lists the author as

   Peter Donnelly
   1301 Ryan Street
   Victoria BC
   CANADA    V8T 4Y8

and asks for a $10 contribution.  I tried to mail him a check, but the letter 
came back "incorrect address".  

If anyone can connect me with Peter, I'd appreciate it.  I can be reached via
EMail as jnicholson@bowker.com, or Jim@bowker.com

The views expressed are the author's only,          email   : @bowker.com
and not those of Reed Reference Publishing, Inc.          ...!uupsi!bepcp
                                                     FidoNet : 1:2605/705

Newsgroups: comp.lang.pascal
From: sorokin@ps1.iaee.tuwien.ac.at (Zhenja)
Subject: Extended register problem and 64k array
Organization: Inst. for General Electrics & Electronics, TU Vienna
Date: Wed, 30 Dec 1992 13:48:29 GMT

1. Can I use the following trick to bypass extended register non-
conservation problem by some interrupts (Novell, etc.)?
  I write a separate assembler procedure of the sort

proc test386
    enter 0,0
    sti     ;mask interrupts

    ... operations with EAX,EBX,ECX, etc.

    cli     ;enable interrupts
    leave
    ret
endp

and use it as external procedure in my TP program. 

What could be wrong with this?

2. I need to have an EXACTLY 64k-long array (say, 8192 of doubles).

Type declaration will allow me to use only 8190 ($fff0 div 8) doubles.
If I use MemAllocSeg function to allocate $FFFF bytes with Offset=0 and 
switch off range checking then I can address the 8192nd double and it will 
not jump over segment border. 

The question is: when I allocate $FFFF bytes, can it happen that the last 
byte in this segment (i.e. seg(myarray):$FFFF) will then be assigned to 
another variable (which will naturally crash the program)? 
How can I prevent it?
Is it enough to set switch "Word allign data" to ON?

Sincerely, 
Sorokin Zhenya,
Vienna, Austria.
Sorokin Zhenya
Vienna, Austria.


Newsgroups: comp.lang.pascal
From: fcrews@WES.ARMY.MIL (FORD CREWS)
Subject: editors.tup
Keywords: editors bp7
Organization: ITL
Date: Tue, 29 Dec 1992 15:27:18 GMT
X-Posted-From: ford.wes.army.mil
NNTP-Posting-Host: sol.ctr.columbia.edu

Has anyone out there got a replacement for the TV editors unit that will
edit text files over 64K.  I just got BP 7.0 and was disappointed that 
the editors unit still had the 64K limit.  
Newsgroups: comp.lang.pascal,rec.games.programmer,comp.sys.ibm.pc.misc,comp.sys.ibm.pc.programmer
From: ahoekstr@cs.utwente.nl (Andre D. Hoekstra)
Subject: Re: Source of a little puzzle under MS-DOS TurboPascal wanted
Organization: Twente University, Dept. WB/WA (NOT cs)
Date: Thu, 31 Dec 1992 13:18:24 GMT

In article <1992Dec30.162530.7112@delos.stgt.sub.org> stefanb@delos.stgt.sub.org (Stefan Bechtold) writes:
>Hi !
>
>A friend of mine is looking for a puzzle; it's a little bit difficult 
>to describe but I'll try it.
>This puzzle shuffles a display like those old 16 square plastic
>puzzles.
>and you have to put those squares in the right order)
>
>The program should also be able to solve the problem itself.
>
>The reason why he's looking for that program is that he wants to
>write such a program himself and don't know exactly how to
>make it (esp. the "self-solving" part...)

Well, you should try and find something about a technique called
backtracking (maybe you have heard of the 8-queens problem?) Any
good book on programming techniques should help you out.
Good Luck!

>Stefan

On the same subject, dlcox@bilbo.encore.com (David L. Cox) said:

David>I saw an example of this on a 3b10 (If I remember right) at the Oklahoma
David>State Fair.  AT&T had put together an exhibit where they digitized a picture
David>and scrambled it.  You then used a touch screen to put the picture back together.  (Hey guys, this was 5 years ago!)
David>
David>How did it solve the puzzle?
David>
David>They cheated.  They just remembered every move made and reversed it.  If you
David>have a good enough memory, I guess that is a valid way to do it!  :-)
David>
David>David

Which is ofcourse a good way to solve a puzzle when you know the moves
taken to scramble it; but you cannot get very far if you don't know and
connot reconstruct these moves :-(

Andre++
-- 
There is no reason for any individual to have a computer in    | Andre Hoekstra
their home. (Ken Olson, Ex-President Digital Equipment, 1977)  | Enschede -- NL
From: Seppo.Tuomivaara@cc.kemira.kemira.mailnet.fi
Newsgroups: comp.lang.pascal
Subject: Subscribe me
Date: 28 Dec 92 07:21:50 GMT

Subscribe
Organization: Queen's University at Kingston
Date: Thu, 31 Dec 1992 23:35:53 EST
From: Jeff Boyd <BOYDJ@QUCDN.QueensU.CA>
Newsgroups: comp.lang.pascal
Subject: Re: Correlation Coefficient


I did mean "simple" :-).  Ronald Thisted's "Elements of Statistical
Computing" (1988) discusses numerical methods for statistical
applications.  For people who are doing stats programming on a
frequent basis, it's worth picking up.


jeff
From: CT80@music.mus.polymtl.ca (Steph)
Newsgroups: comp.lang.pascal
Subject: TVision : BUG in my head or in TV?
Date: 30 Dec 92 07:34:12 GMT
Organization: Ecole Polytechnique de Montreal

Stumbled on something weird tonight.  I'd like to know if it's
my fault, and if so, why.  Quite scary.  Here's some parts of
the actual code..

PSmartText     = ^TSmartText;
TSmartText     = OBJECT(TStaticText)
  EndOfStatic     : WORD;

  CONSTRUCTOR  Init(VAR Bounds : TRect; AText : STRING; MyUpdate : WORD)
  . . .
END;

Now, here's the catch :

CONSTRUCTOR  TSmartText.Init(...);
BEGIN
  EndOfStatic := LENGTH(AText);
  .. add spaces at the end of AText;
From: stone@hilbert.math.grin.edu (John David Stone)
Newsgroups: comp.lang.pascal
Subject: Why doesn't this cause an error?
Date: 2 Jan 93 19:52:50 GMT


        Don Bontemps writes:

>           I would figure that "for l := 1 to 0" to cause a
>  run-time error or some other type of error, but it doesn't.
>  Why not??

        Because the Pascal standard specifies that

                for v := e1 to e2 do body

shall be equivalent to

                begin
                    temp1 := e1;
                    temp2 := e2;
                    if temp1 <= temp2 then begin
                        v := temp1;
                        body;
                        while v <> temp2 do begin
                            v := succ (v);
                            body
                        end
                    end
                end

where temp1 and temp2 are otherwise unused identifiers of the same type as
v (or, if v is a subrange type, of the host type of v's type), with the
restriction that no assignments to v are permitted within body.

        In your example, all that happens is that temp1 is assigned 1,
temp2 is assigned 0, and 1 is found not to be less than or equal to 0.  The
for-loop is not erroneous because its defined equivalent is not erroneous.

        Bontemps may be asking a different question:  Why did the language
designers define the for-loop in this way?  My guess is that it's more
convenient for the programmer in the majority of cases.  In particular, in
a loop like

                for itemnumber := 1 to itemcount do begin
                    getitem (item);
                    process (item, result);
                    printresult (result)
                end

it's convenient to have the case in which itemcount is 0 handled correctly
without having to write special-case code, as you would in, say, FORTRAN.
In Bontemps's own example,

>       readln(comment);
>       for l := 1 to length of comment do comment[l] := upcase(comment[l]);

the for-loop correctly capitalizes the null string without making a fuss.
Of course, if one wants the program to make a fuss, all one has to do is
put in a test just before the for-loop.

------  John David Stone - Lecturer in Computer Science and Philosophy  -----
--------------  Manager of the Mathematics Local-Area Network  --------------
--------------  Grinnell College - Grinnell, Iowa 50112 - USA  --------------
--------  stone@math.grin.edu - (515) 269-3181 - stone@grin1.bitnet  --------
Newsgroups: comp.lang.pascal
From: patlee@panix.com (Patrick Lee)
Subject: Re: Turbo Vision Keys?
Date: Tue, 22 Dec 1992 04:28:14 GMT
Organization: PANIX Public Access Unix & Internet, NYC

In article <1992Dec22.092853.327@lincoln.ac.nz> cachoo@lincoln.ac.nz writes:
 > 
 > for many thousands of hours, I still make the mistake ocassionaly. I
 > wonder how this standard came to be and why. There doesn't seem to be any
 > logical reason. Is it because MS Windows uses it?

Macintosh uses the Tab key to move between fields and Enter to
accept the current dialog box.  It isn't all that illogical and
can save a great deal of time when the user only needs to change
one field out of many.  If done without a mouse, it will take
many Enters before the user gets to the accept bottom.  But if
Enter automatically accepts it, then many keystrokes are saved.

It may not be a standard created by any one company, but using
the Tab key to move between fields is certainly a de facto
standard.

Patrick
<patlee@panix.com>
From: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
Newsgroups: comp.lang.pascal
Subject: TURBO PASCAL 6.0 QUESTION
Date: 23 Dec 92 00:28:00 GMT
Reply-To: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
Organization: Li'LL BBS - Paris, France

FS>Sorry if this a FAQ, I am currently looking at some turbo pascal 6.0
FS>code that someone else has written and I am running into a problem
FS>with segment sizes. The problem is as follows, this program (actually
FS>a suite of programs) has a lot of explicitly declared variables and
arrays
FS>and they come very close to the 64K limit. This makes it very
difficult to
FS>extend any of these arrays, which is what I want to do, beyond their
current
FS>bounds. What I would like to know is if it is possible to go beyond
this
FS>limit in any way, or is this just hopeless. I know I can change these
FS>variable to
FS>dynamically allocated ones ( like a malloc in C), but I would rather
not
FS>mess with the programs too much.

Anyway, it seems like this is definitely your only solution ; here is a
piece of hint on how to proceed :

Original (Ill-written :-)) program :

Type Tab  : Array[1..16384] Of Word ;

Var  Tab  : TTab ;

Begin
     { Tab[] anywhere }
End.

What you have 2 do is :

Type Tab  : Array[1..16384] Of Word ;

Var  Tab  : ^TTab ;           { Make Tab a dynamically allocated
variable }

Begin
     New(Tab) ;               { Don't forget to instanciate it... }
     { Tab^[] anywhere }      { Replace, with your favourite editor, any
                                reference to Tab with a reference to
Tab^...
                                And that's it ! }
     Dispose(Tab) ;           { Cleaning-up is always worth it }
End.

Hope I helped,

Alp,                                              Raphael.

 * OLX 2.1 TD * So be it...
--- FMail 0.92
 * Origin: ICEBERG - La Garenne * FRANCE * Tel:(33)-1-47699261 (2:320/1)
From: etljmme@etlxd30.ericsson.se (Jim)
Newsgroups: comp.lang.pascal
Subject: Re: Describe that Turbo Pascal function...
Date: 23 Dec 92 12:16:22 GMT
Reply-To: etljmme@etlxd30.ericsson.se
Organization: Ericsson Telecom AB

In article 92Dec22085210@mddchh.mddchh.fc.hp.com, hemstree@mddchh.fc.hp.com (Charles H. Hemstreet IV) writes:
>
>I am in the process of porting a turbo pascal (PC) program to HP-UX
>Pascal.  What does the function ... do in Turbo pascal?
>
>str

Convert a value to a string, eg: STR(a,b) where a="123" and b is an integer var.

>pos

Returns the position of a substring in a string, eg: POS("A","ABC")=1

>upshift

You mean UPCASE?  If so, it shifts a character to uppercase, eg: upcase("a")="A"

>copy

copy a substring from a string, eg: copy("ABCD",2,2) = "BC"

>val

opposite of str, converts string containing digits into value in a variable.

>length

returns the length of a string, eg: length("ABCD") = 4

>
>Thank you for any help,
>--
>Charles
>
>-------------------------------------------------------------------------------
>Charles H. Hemstreet IV                                 ********  h    *******
>Hewlett Packard                    /\          /\      *******   h        *****
>3404 East Harmony Rd., MS110    /\/  \  /\    /  \     *****    hhhh pppp  ****
>Ft. Collins, CO  80525       /\/  \   \/  \/\/    \    ****    h  h p  p   ****
>(303) 229-4471              /  \   \  /   /  \     \   ****   h  h pppp   *****
>(303) 229-3168  (fax)      /    \   \    /    \     \  *****      p     *******
>hemstree@mddchh.fc.hp.com     Mech. Design Division     *******  p    ********
>-------------------------------------------------------------------------------
Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Last update to TP 6 bug list
Organization: Queen's University
Date: Thu, 24 Dec 1992 05:29:30 GMT

I'm planning to produce one final update to my TP 6 bug list (the
current version is available on garbo.uwasa.fi and its mirrors as
/pc/turbopas/tp6bugs6.zip).  If anyone knows of any bugs that aren't in that
list or the list below, please let me know. Demonstration code is nearly 
essential; I try to confirm any bugs that I putin my list.

I'm also planning a limited BP 7 list; see the next message for details.

The FLDLN2 instruction (which is valid on an 8087) triggers error 159,
"286/287 instructions are not enabled" when compiled in the $N+,G- mode.
(Fixed in BP 7.)

The string formatting routines get the 19th digit wrong on very large Comp
numbers. (Not fixed in BP 7.)

The TDSTRIP utility which comes with the professional version of TP damages
the .EXE header:  the min extra paragraphs field is set to 0. (See
STRIPPED.ZIP in TP6BUGSn.ZIP for a damage detector).  (Fixed in BP 7.)

Actual heap allocation can be 511 bytes more than the maximum specified in the
$M directive. (Not fixed in BP 7.)
From: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
Newsgroups: comp.lang.pascal
Subject: RE: CHECKING TO SEE IF A
Date: 20 Dec 92 19:29:00 GMT
Reply-To: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
Organization: Li'LL BBS - Paris, France


 -=> Quoting Baker, Robert E. to All <=-

 BRE> From: BAKERRE@awc1.eglin.af.mil (Baker, Robert E.)
 BRE> Newsgroups: comp.lang.pascal
 BRE> Subject: Checking to see if a program is already loaded
 BRE> Date: 2 Dec 92 15:32:47 GMT


 BRE> I am currently writing a program (TP6) that has a DOS shell
option.
 BRE> The question I have is this:  how do I tell if the program is
 BRE> currently shelled to DOS to keep the user from trying to execute
the
 BRE> program again while in the shell?
 BRE> I am somewhat familiar with the PSP, which is where I'm
guessing(?)
 BRE> the solution lies.  Am I correct?
 BRE> Any help (including source, or a pointer^ in the right direction)
 BRE> would be appreciated.

 BRE> ADVthanksANCE,
 BRE> Bob
 BRE> BAKERRE@TAWC1.EGLIN.AF.MIL


 BRE> -!- GEcho 1.00
 BRE>  ! Origin: Li'LL BBS - Paris France - (33-1) 43.07.40.97 (2:320/7)

Hello !

Here is one solution, maybe not the best, but definitely working :

Uses DOS,
     Objects ;

Const
     IDString  : String[20] = 'I''m the ID String !' ;

Function AlreadyInHere : Boolean ;
Var  IdPt : PString Absolute 0:$ff*4 ;
Begin
     AlreadyInHere:=IdPt^=IDString ;
End ;

Procedure TellImHere ;
Begin
     SetIntVec($ff, @IDString) ;
End ;

Procedure TellImNotHereAnyMore ;
Begin
     SetIntVec($ff, Nil) ;
End ;

Begin
     If AlreadyInHere Then
     Begin
          WriteLn('Re-entering this program would not be a good idea !')
;
          Halt(1) ;
     End ;
     TellImHere ;

     { Any stuff, such as DOS shelling... }

     TellImNotHereAnyMore ;
End.

If you feel like making something cleaner, you should save the old
interrupt vector, make it point to your own Interrupt routine, which
would in its turn call the old one ; the AlreadyInHere function should
compare the code pointed to by INT $FF to the code of your own
interrupt routine (Say, the 20 first bytes...), but this could be quite
more difficult, since the few first bytes of an interrupt procedure
contain the hard value of DS, which would be different in the two
instances of your program...

                                             Raphael.


... Catch the Blue Wave!
--- FMail 0.92
 * Origin: ICEBERG - La Garenne * FRANCE * Tel:(33)-1-47699261
(2:320/1.0)
From: jr75312@cs.tut.fi (Raisio Jukka Artturi)
Newsgroups: comp.lang.pascal
Subject: Why does DLL {$N+} cause an error?
Date: 2 Jan 93 12:02:56 GMT
Organization: Tampere Univ. of Technology, Finland.
NNTP-Posting-Host: pulmunen.cs.tut.fi


I'm simply trying to use Single and Double with DLL in DOS PROTECTED

and all I get is General Protection ... or something like that.

Why ?
--
                    ********************************
                    No future No kredit No signature 
                    ********************************
Newsgroups: comp.lang.pascal
Subject: Re: Is LHA source in Pascal?
From: cscmd@lux.latrobe.edu.au (Mitch Davis)
Date: Sat, 2 Jan 1993 09:46:32 GMT
Organization: La Trobe University

In article <1992Dec16.182311.45706@kuhub.cc.ukans.edu> thompson@kuhub.cc.ukans.edu writes:
>Hello all,
>
>I am writing a recipe database system in Turbo Pascal for Windows
>(I'm waiting for the OS/2 version).  I was thinking of compressing
>the recipes (I have several thousand).  I thought of a few ways
>of doing this in my head, but alas, I am no compression expert.

And hello to you too!

For this sort of job, may I recommend Duncan J. Murdoch's enhanced
stream package (called either STREAM13.ZIP or STREAMS13.ZIP).  One of
the streams does transparent LZH compression and decompression, which
sounds JUST like what you need.

Good luck!

Mitch.
From: CT80@music.mus.polymtl.ca (Steph)
Newsgroups: comp.lang.pascal
Subject: User-interface's language
Date: 24 Dec 92 19:19:05 GMT
Organization: Ecole Polytechnique de Montreal

I suspect not many of you out there have this problem, but *I* do
and maybe you guys know of a way to fix it.  I live in Quebec, and
while the market here has a French potential, any program that
I make would have to be in English.  Problem is, there are always
the odd requests for the French equivalent of my software.  How
does one go about designing a code that can be ported, easily, to
any language?  I tried the following approach, on a BBS package
I wrote: put all the strings as constants.  While it seemed
feasible, I soon had to trash this idea because, on a 20,000+
project, you soon get lost with your naming scheme of
string-constants.

I don't really want to maintain two copies of the same software
at the same time, modifications in one are bound not to come up
in the other version.  Any ideas?


Steph.
Who needs a .sig?
Newsgroups: comp.lang.pascal