==========
pcpforum/S7_Programming #7784, from Nigel_Hughes, 568 chars, 29-Mar-94  20:07:50
----------
Subject: DOS files - FINDNEXT
Fm: Nigel Hughes 100014,3465
To: All

A friend of mine is using the Int 21 func 12H (find next matching
directory entry) to search through directories to obtain a list of
filenames within the directory.  What he is finding is that when there
are several hundred file entries the program slows down.  This also
happens when using the DIR command in DOS when there are several
hundred files in a directory.

Does anyone know why DOS does this and is there a way round this
problem when programming?

Thanks

Nigel   

There are 2 Replies.

==========
pcpforum/S7_Programming #7789, from Jonathan_Edwards, 1120 chars, 29-Mar-94  22:30:47
Comment to 7784.
----------
Subject: DOS files - FINDNEXT
Fm: Jonathan Edwards 100337,2222
To: Nigel Hughes 100014,3465 (X)

A simple solution is to organise the file into subdirectories and so
search 20 at a time instead of 200, giving, on average, a 10X increase
in speed.

A (very) complicated solution is to write your own 'findnext' function
- which rather defeats the porpoise of MS putting it in their splendid
operating system - but I expect the effort would not justify the speed
increase you might get.

Otherwise :

DOS uses its buffers (1 buffer = 512 bytes) as defined in config.sys as
a mini disk-cache, since 1 directory entry takes up 16 bytes, 300 of
them will use up 10 of the buffers and so DOS may be needing to reread
the directory from disk each time you do a findnext (the buffers also
hold other vital stuff like the FAT and there may just not be enough to
go around). Since most people use a bigger cache on top of the buffers
(smartdrv probably) I would have thought the directory would be held
adequately here.
Oh well - it's just a suggestion : increase DOS's buffers or see if
smartdrv (for example) might help.

Jon.

==========
pcpforum/S7_Programming #7853, from Andrue_Cope, 514 chars, 04-Apr-94  10:36:29
Comment to 7784.
----------
Subject: DOS files - FINDNEXT
Fm: Andrue Cope 100125,2643
To: Nigel Hughes 100014,3465

The reason is that DOS subdirectories are stored as files. As the
FindNext() progresses DOS is working it's way deeper and deeper into
the sub dir. It doesn't remember the physical location of the last
entry between calls so it has to work its way along the allocation
chain for every call. A disk cache will help but the basic solution is
*not* to create subdirectories with more than 100 files in them. 

There is 1 Reply.

==========
pcpforum/S7_Programming #7911, from Roger_Cope, 146 chars, 10-Apr-94  10:34:17
Comment to 7853.
----------
Subject: DOS files - FINDNEXT
Fm: Roger Cope 100010,277
To: Andrue Cope 100125,2643 (X)

Fancy meeting you up here <g>

Roger

There is 1 Reply.

==========
pcpforum/S7_Programming #7924, from Andrue_Cope, 343 chars, 11-Apr-94  17:52:23
Comment to 7911.
----------
Subject: DOS files - FINDNEXT
Fm: Andrue Cope 100125,2643
To: Roger Cope 100010,277 (X)

Yep, it's a sad world but after spreading around my OS/2 expertise I
thought I'd see if I could lighten up your world..

Q.How many OS/2 programs can you stand on the head of a pin?
A.Dunno, they keep falling off.

I bet that really made your day <g>. 

==========
pcpforum/S7_Programming #7979, from Richard_Perrin, 456 chars, 17-Apr-94  18:06:33
----------
Subject: Joystick in VB 3
Fm: Richard Perrin 100043,2042
To: All

I program lots of software & games in Visual Basic 3 but I cannot use
the joystick in my programming. I have checked all through the manual
and help files but the joystick is not mentioned.
It is porably impossible to use the joystick with VB but just incase I
have left this message.
Leave me your details if you know how to.(I only check Cserve for mail
on Saturdays)

There is 1 Reply.

==========
pcpforum/S7_Programming #8001, from Taz_Higgins, 222 chars, 19-Apr-94  19:08:57
Comment to 7979.
----------
Subject: Joystick in VB 3
Fm: Taz Higgins 71662,270
To: Richard Perrin 100043,2042

Richard,

it's not impossible, there is a joystick vbx in the msbasic forum that
allows you to do this.

     Regards,
 -=  The Taz!  =-

==========
pcpforum/S7_Programming #8012, from Richard_Foxcroft, 374 chars, 20-Apr-94  23:20:46
----------
Subject: Learning QBASIC
Fm: Richard Foxcroft 100326,2451
To: All

I am a teacher in a UK school. One of my pupils (Marc), age 14, is
asking about books to help him learn to program in QBASIC. He would
particularly like to know of suitable projects, rather than programming
theory.

Any suggestions?

Thanks, RichardF Telford, Shropshire, England





There are 2 Replies.

==========
pcpforum/S7_Programming #8018, from Georges_Ware, 350 chars, 21-Apr-94  21:05:06
----------
Subject: ScreenSavers(Windows)
Fm: Georges Ware 100041,2370
To: Sysop/All (X)

All/Sysop

WINDOWS offers a pretty poor selection of ScreenSavers which are held
as .SCR files.

I'm told that these are just modified .DLLs and was wondering if anyone
knows how to make .SCR files to add new screen savers ?  Any ideas ?

Georges


There are 2 Replies.

==========
pcpforum/S7_Programming #8019, from Anton_Britten, 467 chars, 21-Apr-94  22:37:57
Comment to 8018.
----------
Subject: ScreenSavers(Windows)
Fm: Anton Britten 100316,3127
To: Georges Ware 100041,2370 (X)

Under Win 3.1 screensavers haver become easier. Compile as a program
not a DLL. Microsoft C has settings for making screen savers (I believe
- I use borland c)

In the RESOURCE FILE you must have

DESCRIPTION SCRNSAVE: title

and then compile the program with an .SCR extension.

Under 3.1 Windows looks after starting and stopping the program.

Anton

There is 1 Reply.

==========
pcpforum/S7_Programming #8020, from Anton_Britten, 444 chars, 21-Apr-94  22:44:11
Comment to 8012.
----------
Subject: Learning QBASIC
Fm: Anton Britten 100316,3127
To: Richard Foxcroft 100326,2451 (X)

The cheapest (and quite effective series) is written by N. KANTARIS
called

Programming in QuickBASIC published by BERNARD BABANI BP 284
ISBN 0-85934-229-8 available at 4.95 in paperback  -  its cheap and
cheerful rather than exhaustive but if he looses interest it's only
cost a fiver!

The best project is one involving any hobby he's got!

Anton

==========
pcpforum/S7_Programming #8027, from PC_Plus, 701 chars, 22-Apr-94  09:25:09
Comment to 8012.
----------
Subject: Learning QBASIC
Fm: PC Plus 71333,1462
To: Richard Foxcroft 100326,2451 (X)

I thought QuickBASIC Made Easy (Albrecht, Wiegand and Brown; McGraw
Hill; ISBN  0-07-881421-9; 19 quid) was OK. It covers progam structure
a bit and has projects such as a personal camping equipment catalogue.

OK, its not QBASIC, but should translate and I'd look for something in
the same series/author for QBASIC....

My problem with all such books is that they teach Basic. I know that
Visual Basic is much better than the PDP11 Basic I learnt but it's
still poorly structured and hard to read for anything complicated. My
choices for job control/macro languages? REXX - or Algol......


David Norfolk, Sysop


==========
pcpforum/S7_Programming #8037, from Georges_Ware, 278 chars, 22-Apr-94  20:18:44
Comment to 8019.
----------
Subject: ScreenSavers(Windows)
Fm: Georges Ware 100041,2370
To: Anton Britten 100316,3127 (X)

Anton, Yes, me too Borland C++.  You say compile with .SCR extension
but is there a special way of doing this - nothing in tha manual as far
as I can see! Georges

There is 1 Reply.

==========
pcpforum/S7_Programming #8068, from Anton_Britten, 310 chars, 23-Apr-94  22:40:16
Comment to 8037.
----------
Subject: ScreenSavers(Windows)
Fm: Anton Britten 100316,3127
To: Georges Ware 100041,2370 (X)

Georges,

Set the Options/Project  Final file definition to include the full file
definition  ... including the scr extension

eg   C:\C\SCRN\FRED.SCR       its on the first option window

Anton

There is 1 Reply.

==========
pcpforum/S7_Programming #8088, from Georges_Ware, 135 chars, 24-Apr-94  21:16:42
Comment to 8068.
----------
Subject: ScreenSavers(Windows)
Fm: Georges Ware 100041,2370
To: Anton Britten 100316,3127 (X)

Ta Anton, sounds easy enough!  Georges

==========
pcpforum/S7_Programming #8134, from Paul_Graham, 615 chars, 26-Apr-94  23:06:17
Comment to 8018.
----------
Subject: ScreenSavers(Windows)
Fm: Paul Graham 100317,536
To: Georges Ware 100041,2370

You've got me at it now! I've had a bash at writing a screen saver.

I have very limited Windows programming experience, to date I've
written a noughts & crosses game and that is it. Not a "hello world"
program even!

I have got several problems at the minute and I wonder if you could
recommend a book or any source code that is available to download?

Books I have:

Developing Windows Apps. With Borland C++ V3.1 2nd edition
Programming Windows 3.1 by Charles Peztold

Compiler:
Borland C V3.1

TIA
Paul

There is 1 Reply.

==========
pcpforum/S7_Programming #8136, from jonathan_moss, 851 chars, 26-Apr-94  23:19:47
----------
Subject: ASCII file record sorts
Fm: jonathan moss 100103,3254
To: sysop (X)

Sorting of ASCII delimited files

can anyone help? I need to find a DOS program that I can run as a batch
command at pre-set times that will allow me to parse an ascii file that
has line after line of records. These records are comma delimited. Each
record may consist of say 6 fields and I need to say pull out the 1st,
third and fourth fields in each row and save the resulting data to
another comma delim'd aascii file. I can easily do this in Unix using
the 'cut' command but do not know of something in DOS. Do I write it
using QBASIC or is there a shareware utility to do this. AAlso, is
there a shareware util to run commands at preset times?

Thanks for all help on this - it is my first time in this forum.

Jonathan Moss  071-610-3103 work

There are 2 Replies.

==========
pcpforum/S7_Programming #8137, from jonathan_moss, 755 chars, 26-Apr-94  23:29:51
----------
Subject: ASCII Comma Deli'd Files
Fm: jonathan moss 100103,3254
To: ALL

CAn anyone help me regarding sorting of field cloumns within comma
delimited ascii files?

I need to be able to take a file containing say 1000 records and parse
the file to remove the 1st, 2nd and fifth fields of each record and
output them to another ascii file which would contain only those 3
comma delimited fields in each line.

I need to do this a from a DOS command line and at preset or adhoc
times. Is there any shareware to do this (like the UNIX 'cut' command)
or do I have to program it in say QBASIC.

Thanks (this is my first ever use of a Forum and sorry SYSOP if you
received a bad version of this message!)

Regards, Jonathan Moss 071-610-3103

There is 1 Reply.

==========
pcpforum/S7_Programming #8176, from PC_Plus, 544 chars, 28-Apr-94  13:21:56
Comment to 8136.
----------
Subject: ASCII file record sorts
Fm: PC Plus 71333,1462
To: jonathan moss 100103,3254 (X)

There probably are shareware utilities, but I can't think of names
off-hand. There may even be one in our file list - browse Utilities,
perhaps - ISTR a powerful sort replacement.

Best bet is to GO IBMFF and try sort etc as a search keyword.

However, have you thought of loading the data into a spreadsheet and
using its sort facilities?

As for scheduling, there is the Norton Desktop schedular, and IBM PCDOS
6.1 has one....

David Norfolk, Sysop


==========
pcpforum/S7_Programming #8177, from PC_Plus, 247 chars, 28-Apr-94  13:21:58
Comment to 8137.
----------
Subject: ASCII Comma Deli'd Files
Fm: PC Plus 71333,1462
To: jonathan moss 100103,3254 (X)

The best macro language for parsing strings IMHO is REXX - which is
supported in one of the vendor forums on CIS (look for Quercus)

David Norfolk, Sysop

==========
pcpforum/S7_Programming #8182, from CHUCK_, 309 chars, 28-Apr-94  19:33:17
----------
Subject: Script files
Fm: CHUCK  . SCHWASS 71614,75
To: anybody

We are using a command in the script file "sendfile zmodem <filename>"
to send a single file.  Is there a way we can send three files with the
same command or is there a way we can send the files in a directory
through a script file.

Chuck. 

==========
pcpforum/S7_Programming #8189, from jonathan_moss, 161 chars, 28-Apr-94  22:30:07
----------
Subject: ASCII sort utils
Fm: jonathan moss 100103,3254
To: sysop (X)

Thanks for your help on the ASCII sort problems I was having. Your
advice really helped.

==========
pcpforum/S7_Programming #8191, from Anton_Britten, 374 chars, 28-Apr-94  22:35:35
Comment to 8134.
----------
Subject: ScreenSavers(Windows)
Fm: Anton Britten 100316,3127
To: Paul Graham 100317,536 (X)

Paul,

Try Windows Programming Primer Plus from the WAITE group  ISBN
1-878739-21-2 it gets you writing programs in chapter one, they may
only be "Hello World" but they work and you can understand why!  It
even helps you set up your C compiler!

Regards

Anton

There is 1 Reply.

==========
pcpforum/S7_Programming #8203, from Richard_'Fozzy', 1228 chars, 29-Apr-94  20:11:13
Comment to 8136.
----------
Subject: ASCII file record sorts
Fm: Richard 'Fozzy' Foster 100041,1356
To: jonathan moss 100103,3254 (X)

Hi Jonathan,

There are at least two utilities I can think of which will do what you
want. Both of them have migrated over from Unix. The first (and
probably easiest) option is to use AWK. This is effectively a very
simple text processing language and could easily be persuaded to do
what you want. (I *think*, but I'm not certain that the following AWK
"program" will do what you want.

     BEGIN { FS=',' } { print $1,$3,$4 }

This would be "run" by doing something like

     AWK -fprogram.awk input.txt > output.txt

where program.awk is a file containing the "program" line above,
input.txt is the input file, and output.txt is (surprise surprise,) the
place you want the output to end up.

An alternative option would be to use PERL. This is significantly more
powerful than AWK, but also somewhat more complicated and memory
hungry. Having used it at work, I now prefer PERL - but I still use AWK
if what is required is really simple.

Hope this info is of use / interest. If you want any other information
or assistance with or about these feel free to leave a message here, or
alternatively email me.

Richard

==========
pcpforum/S7_Programming #8222, from Paul_Graham, 224 chars, 01-May-94  20:45:15
Comment to 8191.
----------
Subject: ScreenSavers(Windows)
Fm: Paul Graham 100317,536
To: Anton Britten 100316,3127 (X)

Anton,

Thanks, I'll take a look at that book, I have managed to get my first
saver totally working now!

Paul

There is 1 Reply.

==========
pcpforum/S7_Programming #8256, from Anton_Britten, 205 chars, 04-May-94  23:43:40
Comment to 8222.
----------
Subject: ScreenSavers(Windows)
Fm: Anton Britten 100316,3127
To: Paul Graham 100317,536 (X)

Paul,

A pleasure. I've had a lot of good support both here and particularly
from the Borland C forums.

Anton

==========
pcpforum/S7_Programming #8267, from Jonathan_Edwards, 788 chars, 05-May-94  21:16:34
----------
Subject: PM Int driven printing
Fm: Jonathan Edwards 100337,2222
To: ALL

I am working with an application, running in protected mode, which
prints in the background using a handler hooked to IRQ 7.  The handler,
which runs in real mode, calls a protected mode function which OUT's
the next character to the port.  This works fine until the printer (dot
matrix on LPT1, BTW) is switched off or disconnected from the PC (33MHz
486) when _sometimes_ the application crashes with exception 8 (double
exception) or 0D (general protection fault).  The thing is - there is
code in place which  checks the status of the printer before attempting
to print a character.   Has anyone any thoughts on possible causes? Or
know of information anywhere on CI$ which might help.

TIA,
        Jonathan

