TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.os.cpm,comp.sys.apple2,comp.sy
from: Bill Buckels
date: 2008-11-08 05:57:12
subject: Re: Building an Apple CP/M Disk

"Bill Buckels"  wrote in message 
news:72fRk.1144$sl.547{at}newsfe23.iad...
>I have updated the Disk Images at the following link to include a utility 
>called BHEAD.COM and have also included a version of MORE.COM and my Aztec 
>C Source for both .

x--- snip ---x

/* -------------------------------------------------------------------
 System       : Apple II CP/M 80
 Environment  : Aztec C
 Program      : more.c
 Description  : paged or line oriented text file viewer

                This program is a filter that displays a text file
                either page by page if the spacebar is pressed
                or line by line if enter is pressed.

                If the [ESCAPE] key or the letter 'Q' is pressed
                the program ends.

                It will optionally accept a filename to read input
                from. All output is to the standard output device
                unless redirected.

                It is oriented to the 80 column x 24 row display.

                Example:
                  more abc.txt
                      read input from abc.txt,
                      output goes to screen.
                  more  1)
      fp = fopen(argv[1], "r");

    for (;;) {
      if (NULL == fp)
        c = getchar();
      else
        c = fgetc(fp);

      if (c==EOF)break;


      putchar(c);
      if(c=='\n') {
      ctr++;
      if (ctr > 22) {
        d = getch();
        if (d == 27 || d=='q' || d == 'Q')break;
        else if (d == 32)ctr = 0;
        else if (d == 13)ctr = 22;
    }

   }

    }

    if (d != 27 && d !='q' && d != 'Q') {
       if (ctr > 0 && ctr < 22)getch();
    }

    if (NULL != fp) {
      fclose(fp);
      exit(0);
    }
}

getch()
{
  /* return the last key press */
  int ch;

  while((ch=bdos(6,0xff))==0);

  return ch;
}
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/0)
SEEN-BY: 10/1 3 34/999 120/228 123/500 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/0 100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.