HDTenEightyP/NetNews huggingface dataset:
From: carld@ms.uky.edu (Carl Lafferty)
Subject: Multiply vs indexing.
Summary: Why does indexing an array seem slower than multiplication.
Keywords: Multiply index graphics
Organization: University Of Kentucky, Dept. of Math Sciences
Date: Thu, 28 Jan 1993 19:14:20 GMT

I have a program that uses the 320x200x256 vga mode quite a bit and I am 
always looking for ways to speed up things.  One of the methods I tried
recently involved creating an array that contains the line beginnings offsets
so that I will not have to multiply my Y value by 320 for each putpixel. {
I am not using putpixel a lot it is just my test of this method}  What happens
is that I seem to be taking more time to index to the array than to
do the multiplication.  Is this because in indexing to the array it must 
multiply the index by the record length anyway or am I doing something stupid.

The code is below if anyone is interested enough.

---------------------------Begin code here---------------------------
uses crt,dos;
var
   a : array[0..319] of byte;
 
   linebegin : array[0..199] of word;
 
FUNCTION Time : real;
{
   Get time from system clock, Seconds, and Hundredths of Seconds
   to time in HUNDREDTH of Seconds.    This makes it
   easy to measure elapsed time by subtracting one time from another
   later time.
}
 
 
VAR
  Reg : Registers;
 
BEGIN
  Reg.AX := $2C00;
  Intr($21,Reg);
  Time := (Reg.CX and $00FF) * 60 * 100
        + ((Reg.DX shr 8)*100)     { * 1 }     {Seconds    }
        + (Reg.DX and $00FF)    ;   {Hundredths }
END;
 
Procedure SetMode( Mode : Byte );
 
Begin
    asm
        mov ah, 00h
        mov al, mode
        int 10h
    end
End;
 
 
 
 
Procedure OLDputpixel(x,y : integer; color : byte);
begin
     mem[$A000:(y*320)+x] := color;
end;
 
Procedure Newputpixel(x,y : integer; color : byte);
 
begin
     mem[$A000:linebegin[y] + x] := color;
end;
 
var
   start1,finish1,dif1,start2,finish2,dif2 : real;
   t,r,e : integer;
begin
     setmode($13);  {This just sets the mode to 320x200x256 vga}
     directvideo := false; {So I can write on a graphics screen with
                            no BGI fonts}
 
     {Seed my array with the values}
     for t := 0 to 199 do
         linebegin[t] := t * 320;
 
     start1 := time;
     for e := 1 to 20 do
     for t := 0 to 319 do
         for r := 0 to 199 do
             newputpixel(t,r,10);
     finish1 := time;
 
     dif1 := Finish1 - start1;
     start2 := time;
     for e := 1 to 20 do
     for t := 0 to 319 do
         for r := 0 to 199 do
             oldputpixel(t,r,1);
     Finish2 := time;
 
     dif2 := Finish2 - start2;
 
     writeln('Using the table   ',dif1:10:5);
     writeln('Not using a table ',dif2:10:5);
     readln;
     textmode(co80);
end.
------------------------------End code----------------------------

Any and all comments by whatever means is acceptable.  Just seems to me 
that the array would be faster.  ALso acceptable will be pascal examples
of how to do stuff by the ports on a vga card. 

Carl Lafferty
From: roth@oasys.dt.navy.mil (Pete Roth)
Newsgroups: comp.lang.pascal
Subject: Re: Problems with BP 7.0 IDE text editor
Date: 27 Jan 93 12:45:06 GMT
Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
Organization: The David Taylor Model Basin

In comp.lang.pascal, st_waldman@fencer.cis.dsto.gov.au writes:
>I am using Borland Pascal 7.0 with its protected mode IDE. I have
>encountered a problem when scrolling through text in the IDE editor
>window. The problem occurs when I continuosly hold down the up-arrow or
>down-arrow keys. I find that the characters "8" and "2" will get
>dropped in regions where the cursor has been.
[...]

Turn your NumLock off. I presume you're using a 101-key keyboard
with the arrow key block separate from the number keypad...

- - - - - - - - - - - - - - - - - - - - - - - - - -
Grace & peace
Pete                         roth@oasys.dt.navy.mil
"Easy for me, difficult for you." - Senor Wences.
From: bobbe@vice.ICO.TEK.COM (Robert Beauchaine)
Newsgroups: comp.lang.pascal
Subject: Re: TP6 private
Date: 21 Jan 93 16:28:55 GMT
Organization: Tektronix, Inc., Beaverton,  OR.

In article <1993Jan20.225432.12514@beaver.cs.washington.edu> andrewb@lynx.cs.washington.edu (Andrew Berg) writes:
>
>What is the difference between Operator overloading and function overloading, 
>from a usefulness point of view?  I think that function overloading is just
>as important as operators.

  The difference is having to write things like complexc := complexa
  + complexb instead of complexc := cadd(complexa,complexb).

  Normal algebraic equations for well defined operations on various
  non-atomic data types in Pascal.  I can dream, can't I?

  BTW, I do like function overloading too, but could live without it
  in a pinch.

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

Bob Beauchaine bobbe@vice.ICO.TEK.COM 

"Look, I tried the cat experiment.  On the third trial, the cat was
dead.  On each of the subsequent 413 trials, it remained dead.  Am I
doing something wrong?"
			James Nicoll

Q.  How many Heisenbergs does it take to screw in a light bulb?
A.  If you know the number, you don't know where the light bulb is!

Newsgroups: comp.lang.pascal,comp.programming,aus.mac,comp.sys.mac.apps,comp.sy
From: jbush@magnus.acs.ohio-state.edu (J Eric Bush)
Subject: Re: MAC Pascal for first year teaching
Keywords: pascal, programming, teaching, mac
Organization: The Ohio State University
Date: Tue, 26 Jan 1993 12:51:50 GMT

You would also have the advantage--if you went to C programming courses, that
the same company has a C language development package called Think C.

Eric Bush
-- 
------------------------------------------------------------------------------
J. Eric Bush
Internet: jbush@magnus.acs.ohio-state.edu
From: samodena@csemail.cropsci.ncsu.edu (S. A. Modena)
Subject: Re: TV-question1
Organization: Crop Science Dept., NCSU, Raleigh, NC 27695-7620
Date: Wed, 27 Jan 1993 16:18:42 GMT

In article <30220@oasys.dt.navy.mil> roth@oasys.dt.navy.mil (Pete Roth) writes:
>In comp.lang.pascal, A7101DAA@helios.edvz.univie.ac.at writes:
>>Hallo!
>>I am looking for a possibility of updating the TurboVision
>>MenuBar. The Menu items may be variables. But if I change the variables
>>the menu bars stay the same.
>>    Thanx in advance
>
>Guessing as to your intent: you want to _change_ the menubar during
>program execution.
>
>If my assumption holds, then you must Delete the Menubar from the
>Desktop, Dispose it, Init a new menubar with the desired changes, and
>Insert it into the Desktop.
>
>Pete                         roth@oasys.dt.navy.mil

The single point that I disagree with Pete on is the "dispose [of] it"
part: one might want to assign the current APPLICATION^.MenuBar to another
pointer of type PMenuBar...because you may want to restore it when finished
with the temporary substitute menubar...

Steve
---
+------------------------------------------------------------------+
|     In person:  Steve Modena     AB4EL                           |
|     On phone:   (919) 515-5328                                   |
|     At e-mail:  nmodena@unity.ncsu.edu                           | 
|                 samodena@csemail.cropsci.ncsu.edu                |
|                 [ either email address is read each day ]        |
|     By snail:   Crop Sci Dept, Box 7620, NCSU, Raleigh, NC 27695 |
+------------------------------------------------------------------+
         Lighten UP!  It's just a computer doing that to you.    (c)
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
From: gordo@phsbbs.princeton.nj.us (Gordon Davidescu)
Newsgroups: comp.lang.pascal
Subject: pull down...
Date: Tue, 19 Jan 93 08:57:55 EST
Organization: Princeton High School, Princeton, New Jersey


In a game which I have been working on for a while, I have been trying to 
get pull-down menus (With/without the mouse) but it hasn't worked.  Can 
anyone help?

        Here is what it would look like (More or less)

        File  Movement  Use item  Store action  Fight options

etc.


-----
Gordon Davidescu, Princeton High School BBS
DNS: gordo@phsbbs.princeton.nj.us      UUCP: ...!princeton!phsbbs!gordo
Disclaimer: Author bears full responsibility for this message.
From: ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
Newsgroups: comp.lang.pascal
Subject: Re: Machine specific info needed...
Date: Wed, 27 Jan 1993 09:46:44 GMT
Organization: INSA  CENTRE INFORMATIQUE DU 1er CYCLE
NNTP-Posting-Host: pc110-02.insa-lyon.fr

In article <1993Jan27.033054.16275@nmsu.edu> ahall@dante.nmsu.edu (HALL) writes:
>From: ahall@dante.nmsu.edu (HALL)
>Subject: Machine specific info needed...
>Date: Wed, 27 Jan 1993 03:30:54 GMT

>I am writting a program that checks to see if it is
>being run on the machine it is liscensed for.  I
>need to be able to read some piece of data specific
>to each individual machine.  Similar to reading the 
>number off of an ethernet card, however most of the
>machines will not have an ethernet card.  Is there
>something in BIOS or on a motherboard that could be
>read in Pascal?  Any help on this is GREATLY
>appreciated.

>Thanks
>A. Hall

You could read the serial number of the hard disk, that
is somewhere in its boot sector. Check the FAQ or use 
MsDos interrupt (21h function 69h) ...
 
 That's only part 1. Then you must embed that information
somewhere into the EXE file for it to check it when you 
launch it. 

  This requires an external program (not to be disclosed !!!)
that update that information during the installation of
you program on a given hard disk. I said not to be disclosed
otherwise anybody could reinstall the program on another 
machine by copying it and re-run the "installer". unless
you add a counter somewhere in the EXE ... 
  but ....    however you can also..
  but  ..... however  you can also....
 .....
     This is the endless story of the cops and the thieves .... 

 Do you really want to bother your customers with a copy protection
scheme... And be ready to help them in case their hard disk do 
really crash and they cannot re-install you program... So they will call on 
you, prove that they are regular buyers  ....

   I do have a program like this that I use to lock any EXE or COM 
applications on hard disks to prevent  students to copy them  on diskettes
and run them on their personal machines.I use it only with programs
for which I have a limited number of licenses . But that program uses
some technics well known to virus developpers to hook itself in a binary
file. That something I cannot disclose in a news group....
ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
--------------------------------------------------------
Dr Patrick L.Pollet
Institut National des Sciences Appliquees
Centre Informatique du 1er Cycle  Bat 110
20 Avenue A.Einstein
69621 Villeurbanne Cedex France
--------------------------------------------------------
Phone: 72 43 83 80 -   la premiere erreur c'est
Fax  : 72 43 85 33 -   de se lever le matin  ... GASTON
-------------------------------------------------------
Newsgroups: comp.lang.pascal
From: s14250dy@UMASSD.EDU
Subject: Re: TP6 private
Reply-To: s14250dy@UMASSD.EDU
Organization: UMASS DARTMOUTH, NO. DARTMOUTH, MA.
Date: Mon, 25 Jan 1993 18:42:54 GMT

In article <35091@adm.brl.mil>, lee@cpu.us.dynix.com (Lee Crites) writes:
>It is my understanding that you only have to include the last generation
>in your program's USES clause, since all of the other info/data/methods
>will be a part of that one by inheritance.  This assumption is based upon
>the fact that if UNIT A has UNIT B in it's USES clause, then the program
>itself only has to have B in it's USES clause.
>
>If I'm wrong on that point, please let me know.  We are just at this point
>going through all of our standing units and ADT's and converting them to OOP.

I think what you meant is that the program would only have to have A in its
USES clause.
From: csfraw@vehka.cs.uta.fi (Francis Akoto)
Newsgroups: comp.lang.pascal
Subject: What is "shr" and "shl" ???
Date: 22 Jan 93 10:35:21 GMT
Reply-To: csfraw@vehka.cs.uta.fi (Francis Akoto)
Distribution: world
Organization: University of Tampere, Finland

Going through a pascal source code i came across these: shl and shr

shl is used like this : 
                     pt = 1 shl (j-1);........ pt and j are integers.

what do these two "functions or whatever they are do


email me the answer..... hanks

--
gallows
     Opinions are like assholes;
     Everybody has one but nobody wants to look at the others.

Newsgroups: comp.lang.pascal
From: oberto@genes.icgeb.trieste.it (Jacques Oberto)
Subject: Dragging an object in TPW: how?
Organization: ICGEB
Date: Mon, 25 Jan 1993 11:20:41 GMT

Dear All,

The question is: how to implement graphical object selection and
dragging (with the mouse) in TPW 1.5.  I went through every
Borland manual w/o success.  There must be some API functions to
do that but which ones.  Unfortunately the zillion API calls are 
only briefly described in the API Reference, w/o examples....
Has anybody solved this and how?
I will post a summary of replies if there is a general interest.

Any help greatly appreciated.
Thanks,

Jacques

-- 
Jacques Oberto  <oberto@genes.icgeb.trieste.it>
From: berend@contrast.wlink.nl (Berend de Boer)
Newsgroups: comp.lang.pascal
Subject: Strange behavior?
Date: Thu, 21 Jan 1993 21:51:26

Hello All!

Can anyone explain the following behavior to me?

Sorry, I wrote the above sentence and the test programs below before
looking in Duncan's buglist. The SEG bug is document (number 16), but
the OFFSET bug is not, at least I could not find it.

Well than, for your information:

====test program====
program Test;

procedure T;
var
  s : string;
begin
  asm
    mov  ax,OFFSET s        {* line 1 *}
    lea  ax,s               {* line 2 *}
    mov  ax,SEG s           {* line 3 *}
  end;
end;

begin
  T;
end.
=========

If you look at the compiled code you will see that line 1 and line 3 are
compiled strange (in my honest opinion). Register ax is loaded with
$FFCE ($FF00 in real mode) and $FFFF respectively, while line 2 is OK.

This bug does not show up when you do it like the following program:

====test program====
program Test;

var
  s : string;
begin
  asm
    mov  ax,OFFSET s        {* line 1 *}
    lea  ax,s               {* line 2 *}
    mov  ax,SEG s           {* line 3 *}
  end;
end.
=========


Groetjes,

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

Newsgroups: comp.lang.pascal
From: jo@rrz.de (Jochen Magnus)
Subject: Re: Borland Pascal with Objects 7.0
Organization: Rhein-Rechenzentrum GmbH, Koblenz, Germany
Date: Fri, 22 Jan 93 16:43:29 GMT

Lee Crites writes
[...]
> Am I missing something here?  I have seen MANY references to the 'loads of
> bugs' that TP6 had, but in our day after day, program after program, full
> development cycle on four software projects, WE have not encountered
> anything that WE considered to be a 'bug' in TP6.  In fact, I was very
> pleased with it.  There were some things that we didn't anticipate (MOD on
> a negative number, etc), but nothing that we might consider to be a 'bug'
> there......
[...]
 > I think that it was a solid product, and so far, I feel like BP7 is a
> good, well worked, solid advancement on an already good product.
> 
I agree. Absolutely right IMHO. We have develloped apps bigger that 1.3 MB-EXE   
(95% [sic!] in Overlays), each about 160'000 Lines and only ONE bug from the  
bug-lists I knew by own experiances. 

I knew the buglists. They're o.k. But the effect in practice is very very  
small!

-jo-


--
Jochen Magnus               E-Mail: jo@rrz.de (NeXT-Mail o.k.)
Rhein-Rechenzentrum GmbH    Voice:  +49 261 892 520
August-Horch-Strasse 28     Fax:    +49 261 892 525
D-5400 Koblenz, Germany     < DELENDA EST C... >


Newsgroups: comp.lang.pascal
From: jkorpela@snakemail.hut.fi (Jukka Korpela)
Subject: Re: Variant records
Organization: Helsinki University of Technology, Finland
Date: 25 Jan 93 10:45:37 GMT

In article <dmurdoch.334.727822626@mast.queensu.ca> dmurdoch@mast.queensu.ca (Duncan Murdoch) writes:

   I'm not sure if standard Pascal 
   forces you to declare a tag field (e.g. "case Choice:Boolean of ..") and
   then makes sure that your references are consistent with the value there, 
   but TP certainly doesn't.

I'm sure it doesn't. In the original Wirth's Pascal and in standard Pascal
and, as far as I know, in all Pascal dialects (if they support variant
records at all, of course), a variant can be declared with or without
the tag field identifier.

Even if a variant record is declared with a tag field identifier, there is
(in general) no guarantee that inconsistent references to fields will be
trapped. An implementation may or may not provide runtime checks for this,
just as it may or may not perform runtime checks for array indexes
(although it is in practise more common to provide index checks than
variant access checks). The situation may dependent on the settings of
compile-time switches. The standard only requires that the behaviour of
an implementation in this respect be documented (e.g. by stating that
variant access errors are not detected).

Moreover, if a variant record is declared _without_ a tag field identifier,
an implementation may perform runtime checks against inconsistent references
(probably by inserting an invisible tag field and implicitly assigning
suitable values to it when the variant is changed). This, of course,
is most a theoretical remark.

* Jukka "Yucca" Korpela, Manager of User Support
* Helsinki University of Technology (HUT) Computing Centre, Finland
* Internet mail address: Jukka.Korpela@hut.fi
Newsgroups: comp.lang.pascal
From: jo@rrz.de (Jochen Magnus)
Subject: Re: BP7 Protected Mode Debugging - Help please.
Organization: Rhein-Rechenzentrum GmbH, Koblenz, Germany
Date: Fri, 22 Jan 93 16:57:21 GMT

Mike Howarth writes
[...]
> Now in the protected mode the integrated debugger does not seem to be
> available.  The menu items are 'grayed' out.
> I have checked the options and for the protected model I have
> checked the appropriate boxes to generate debugging code and
> symbols.
> 
The integrated debugger is not availiable for DMPI-Apps. Use TDX. You can add  
it to the TOOL-List of the IDE with $exename in 'command line' and assign a  
hotkey. Very usefull and simple. Works nearly like an integrated debugger.

-jo-

Jochen Magnus               E-Mail: jo@rrz.de (NeXT-Mail o.k.)
Rhein-Rechenzentrum GmbH    Voice:  +49 261 892 520
August-Horch-Strasse 28     Fax:    +49 261 892 525
D-5400 Koblenz, Germany     < DELENDA EST C... >


Newsgroups: comp.lang.pascal
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: ADT & BTW7.0??? Help me!
Organization: Queen's University
Date: Mon, 25 Jan 1993 15:44:56 GMT

In article <8302@kielo.uta.fi> commari@uta.fi (Juha Korhonen) writes:

>Is it possible to define abstract data types in units of Borland's Turbo
>Pascal 7.0??? If I've any hope, would you followup here or send mail me a
>little examle or something?

What's an abstract data type?




Duncan Murdoch
dmurdoch@mast.queensu.ca
From: berend@contrast.wlink.nl (Berend de Boer)
Newsgroups: comp.lang.pascal
Subject: Changing TP6 IDE Backup File Extension
Date: Wed, 20 Jan 1993 10:36:36

Mike Blanco wrote in a message to All:

 MB> Does anyone know a way to make the TP6 IDE produce backup
 MB> files with file extensions other than .BAK?

I can suggest a way to find one: search your TURBO.EXE for the string
BAK and replace it with what you want. Try if it works. If not, replace
the next occurence of BAK... etc.


Groetjes,

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

Newsgroups: comp.lang.pascal
From: userDHAL@mts.ucs.UAlberta.CA (David Halliwell)
Subject: Re: IBM8514.bgi
Organization: University Of Alberta, Edmonton Canada
Date: Fri, 22 Jan 1993 20:53:49 GMT

pfrants@cs.vu.nl (Frants P) writes:

>I have tried to use the ibm8514.bgi driver, but it fails. The program stays in
>text-mode. I know my computer has svga. So tell me if I am doing things wrong:

[code fragment deleted]

   The IBM8514 card is *not* SVGA. It does have the same 1024x768 resolution,
but it is radically different from SVGA cards. If your card does support
the IBM8514 modes (such as some of the ATI accelerator cards which
combine SVGA and IBM8514 capabilities on the same card) then you have to
make sure that the card's "adapter interface" is loaded into memory
before running any program using the .BGI driver. Borland's driver uses
this AI, rather than directly controlling the hardware.

   If you have just an ordinary SVGA card, then to access the extended
graphics modes you need a .BGI driver for SVGA cards. Borland does not
provide them (unless they added them to version 7), but other people
have developed them. Look in the SIMTEL archives under <MSDOS.BORLAND>.
(Unless they've changed that on me as well :-)) You should be able to
FTP the appropriate drivers and instructions.


Dave Halliwell
Department of Geography
University of Alberta
Edmonton, Alberta
From: lasgout@solaris.inria.fr (Jean-Marc Lasgouttes)
Newsgroups: comp.lang.pascal
Subject: Re: BP 7.0 bug??????
Date: 22 Jan 93 11:29:01 GMT
Organization: INRIA * Rocquencourt BP 105 * F-78153 LE CHESNAY CEDEX* France

In article <35168@adm.brl.mil>, lee@cpu.us.dynix.com (Lee Crites) writes:
|> I am getting this message a LOT with BP7.  Is there a bug here?  I have
|> 4meg of RAM, and set up my computer so that the only TSR's kicking around
|> are the mouse driver and SSTOR (SuperStore disk compression utility).  I
|> ought to have loads of room, but can't seem to get at it.  I can't even
|> get most of the TV demos to run from within the IDE (^F9) without running
|> out of memory.  I played with this some last night, but didn't make any
|> headway.  I ran the utility that cam with BP7 to test the EMS, and it
|> worked fine.  I also have the IDE set up to use EMS (something I had to do
|> quite early just to get some of my other programs to compile).
|> 
|> Any ideas?!?
|> 

A stupid idea: are you sure that you are using the protected mode IDE? I think
that turbo.exe is the old-fashion real-mode IDE for PC-XT.


Jean-Marc

-- 
-------------------------------------------------
Jean-Marc Lasgouttes, Projet MEVAL, INRIA, France
e-mail : jean-marc.lasgouttes@inria.fr
Newsgroups: comp.lang.pascal
From: greg@ms.cs.wm.edu (Gregory S. Miller)
Subject: The Golden Rule. . . 
Organization: College of William & Mary, founded 1693
Date: Sun, 24 Jan 1993 20:44:17 GMT

Recently, I posted an article asking for advice on the use of 
constructors and pointers in OOPascal.  

I received a number of replies, mostly of the ". . . Have you forgotten
this? . . .") variety.  I would like to thank everyone who sent a helpful
reply of this nature.  The answer is -- I did everything correctly.  I made
a small logic error in a function returning an object to a pointer, and didn't
bother to double-check it.  As a result, I made the incorrect virtual method
call correctly. 

But a reply was posted to the net, intimating that I was somehow incapable of
rational thought, or of understanding the issues involved in object-oriented
programming.  

Wrong.

Before you flame someone for the "stupidity" of their question, remember that
you might have a question someday, too.  And somebody, somewhere, is going to
find it stupid.  

And I'm sure that you would be offended by their response, just as I was by 
the one posted on this newsgroup.

Thank you,
Greg