home *** CD-ROM | disk | FTP | other *** search
- 18-Jun-88 14:53:08-MDT,23484;000000000001
- Return-Path: <u-lchoqu%sunset@cs.utah.edu>
- Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Sat, 18 Jun 88 14:52:42 MDT
- Received: by cs.utah.edu (5.54/utah-2.0-cs)
- id AA22829; Sat, 18 Jun 88 14:52:36 MDT
- Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
- id AA24902; Sat, 18 Jun 88 14:52:33 MDT
- Date: Sat, 18 Jun 88 14:52:33 MDT
- From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
- Message-Id: <8806182052.AA24902@sunset.utah.edu>
- To: rthum@simtel20.arpa
- Subject: sampler.c.shar
-
- #! /bin/sh
- #
- # This is a shell archive. Save this into a file, edit it
- # and delete all lines above this comment. Then give this
- # file to sh by executing the command "sh file". The files
- # will be extracted into the current directory owned by
- # you with default permissions.
- #
- # The files contained herein are:
- #
- # 10 sampler.c
- # 5 sampler.doc
- # 6 sampler.r
- #
- echo 'Extracting sampler.c'
- if test -f sampler.c; then echo 'shar: will not overwrite sampler.c'; else
- sed 's/^X//' << '________This_Is_The_END________' > sampler.c
- X/***************************************************************************/
- X/* Desk Accessory Sampler */
- X/* */
- X/* Copyright (C) 1985 Thomas D. Newton */
- X/* Based on SKEL 2.2.3C by Steve Maker, translated by Bill Jefferys */
- X/* Modified to Consulair C by Brian Bechtel 11/20/85 */
- X/* */
- X/* This program may be copied, used, and modified freely so long as */
- X/* it is only done for noncommercial purposes, this copyright notice */
- X/* remains attached to any copy of the program, and any modified */
- X/* version carries a comment identifying who last changed it. */
- X/* */
- X/* This program has a similar function to the shareware "DA Sampler" which */
- X/* appeared a while back on net.sources.mac. My reaction to the shareware */
- X/* program was that it was handy but that it was not worth $10; the Mac OS */
- X/* makes this type of program entirely too easy to write. Instead of using */
- X/* the program without paying for it, I decided to write a similar program */
- X/* (which would be free) to see if my intuition was correct; the result is */
- X/* the program you currently see before you. If you enjoy it, please don't */
- X/* send any money -- keep both the program and your money. */
- X/***************************************************************************/
- X
- X/* Compile time options: verbose errors, put procedure names in
- X output so that MACSBUG displays procedures by name */
- X#Options +E +K
- X/* Since Consulair 4.0 only runs on a 512K Mac or above, use
- X include files instead of in-line stuff. */
- X
- X#include <memory.h>
- X#include <window.h>
- X#include <menu.h>
- X#include <events.h>
- X#include <osio.h>
- X#include <packages.h>
- X#include <dialog.h>
- X#include <quickdraw.h>
- Xtypedef int boolean;
- Xshort GetVol(), SetVol();
- X
- X
- X/*
- X The following two constants are not defined in any .h file. They
- X are described in "Inside Macintosh" - Event Manager, pp. 14-15.
- X*/
- X#define charcodemask 255
- X#define cmdKey 256
- X
- X#define NULL 0L
- X#define lastmenu 3 /* number of menus */
- X#define applemenu 1
- X#define filemenu 2
- X#define editmenu 3
- X
- X#define iopen 1
- X#define iclose 2
- X#define itoggle 4
- X#define iquit 6
- X
- X#define iundo 1
- X#define icut 3
- X#define icopy 4
- X#define ipaste 5
- X#define iclear 6
- X
- XGrafPtr screenport; /* a port for the whole screen */
- XMenuHandle mymenus[lastmenu + 1];/* our menus */
- X
- XEventRecord myevent;
- XWindowPtr whichwindow; /* points to window of mouseDown */
- Xint windowcode; /* what mouse was in when event posted */
- Xboolean userdone; /* true when user wants to exit program */
- Xboolean open_file; /* true when there is an open resource file */
- Xint the_ref_num; /* reference number of open resource file */
- Xboolean open_any_file; /* true when there's no SFGetFile filtering */
- X
- X
- X/*
- X############################ SetUpMenus #############################
- X*/
- Xsetupmenus () {
- X
- X /* Desk Accessory menu */
- X mymenus[1] = GetMenu(1);
- X AddResMenu(mymenus[1], 'DRVR');
- X InsertMenu(mymenus[1],0);
- X /* "File" menu */
- X mymenus[2] = GetMenu(2);
- X InsertMenu(mymenus[2],0);
- X /* Edit menu */
- X mymenus[3] = GetMenu(3);
- X InsertMenu(mymenus[3],0);
- X
- X DrawMenuBar();
- X}
- X
- Xresetmenus () {
- X DeleteMenu(1);
- X ReleaseResource(mymenus[1]);
- X mymenus[1] = GetMenu(1);
- X AddResMenu(mymenus[1], 'DRVR');
- X InsertMenu(mymenus[1],2); /* Insert before FILE menu */
- X DrawMenuBar();
- X}
- X
- X/*
- Xbody of SetUp
- XOnce-only initialization for Skel
- X############################ SetUp ##############################
- X
- X Initialize our program. It seems best to Handle:
- X Memory inits first, ToolBox inits second, then the program variables'
- X inits. Note that the order of inits is important; see "Using the
- X Dialog Manager" in the Dialog Mgr section.
- X
- X*/
- X
- Xsetup () {
- X
- X/* init QuickDraw, and everybody else */
- X/*** InitGraf (&thePort); These 3 are done by Consulair for you***/
- X/*** InitFonts (); ***/
- X/*** InitWindows (); ***/
- X InitDialogs (NULL); /* NULL => no Restart proc; see Dialog Mgr
- X and System Error Handler */
- X TEInit ();
- X InitMenus ();
- X InitCursor ();
- X
- X/* set up our menus */
- X setupmenus ();
- X
- X/* set up program variables */
- X open_file = 0;
- X open_any_file = 0;
- X}
- X
- X/*
- XClose all currently open desk accessories
- X############################ closeaccs ##############################
- X*/
- XCloseAllAccs()
- X{ int i;
- X for (i = 12; i < 26; i++) CloseDeskAcc(-i-1);
- X}
- X
- X/*
- XHandle a command given through a menu selection
- X############################ DoCommand ##############################
- X
- X We carry out the command indicated by mResult.
- X If it was Quit, we return true, else false. Since the menu was
- X highlighted by MenuSelect, we must finish by unhighlighting it
- X to indicate we're done.
- X*/
- Xint docommand (mresult)
- Xlong mresult;
- X
- X
- X{
- X short refnum;
- X short themenu,
- X theitem;
- X char name[255];
- X GrafPtr saveport; /* for saving current port in when opening
- X a desk accessory */
- X int returns;
- X
- X Point where;
- X SFReply InRecord;
- X OsType FileType;
- X
- X#define aboutboxid 257
- X DialogPtr theDialog;
- X int itemhit;
- X
- X returns = 0; /* assume Quit not selected */
- X themenu = HiWord (mresult); /* get the menu selected */
- X theitem = LoWord (mresult); /* ... and the Item of that menu */
- X switch (themenu) {
- X case 0:
- X break; /* user made no selection; do nothing */
- X
- X case applemenu:
- X if (theitem == 1) { /* tell about the program */
- X theDialog = GetNewDialog(aboutboxid, 0L, -1L);
- X ModalDialog(0L, &itemhit);
- X DisposeDialog(theDialog);
- X }
- X else { /* run a desk accessory; make sure port is preserved */
- X GetPort (&saveport);
- X GetItem (mymenus[applemenu], theitem, name); /* get name */
- X refnum = OpenDeskAcc (name);/* run the desk accessory */
- X SetPort (saveport);
- X }
- X break;
- X
- X case filemenu:
- X switch (theitem) {
- X case iopen: /* Open */
- X where.h = 82;
- X where.v = 100;
- X FileType = 'DFIL';
- X
- X SFGetFile(&where, 0, 0, ((open_any_file == 1) ? -1 : 1),
- X &FileType, 0L, &InRecord);
- X if (InRecord.good) {
- X if (open_file) {
- X /* Make sure that there are no open accessories from */
- X /* the old resource file, then close it. */
- X CloseAllAccs();
- X CloseResFile(the_ref_num);
- X }
- X
- X GetVol(name, &refnum); /* Save the current default */
- X SetVol(0L,InRecord.vRefNum); /* Resource file is here */
- X the_ref_num = OpenResFile(&(InRecord.Namelength)); /* Open it */
- X SetVol(0L, refnum); /* Restore default volume */
- X
- X open_file = 0;
- X if (the_ref_num != -1) {
- X open_file = 1;
- X EnableItem(mymenus[filemenu],iclose);
- X }
- X resetmenus();
- X }
- X break;
- X case iclose: /* Close */
- X if (open_file) {
- X /* Make sure that there are no open accessories from */
- X /* the old resource file, then close it. */
- X CloseAllAccs();
- X CloseResFile(the_ref_num);
- X open_file = 0;
- X DisableItem(mymenus[filemenu],iclose);
- X resetmenus();
- X }
- X break;
- X case itoggle: /* Toggle filter for Font/DA Mover files */
- X CheckItem(mymenus[filemenu],itoggle,open_any_file);
- X open_any_file = 1 - open_any_file;
- X break;
- X case iquit: /* Quit */
- X CloseAllAccs();
- X if (open_file) { CloseResFile(the_ref_num); open_file = 0; }
- X returns = 1;
- X } /* fileMenu case */
- X
- X case editmenu:
- X SystemEdit(theitem-1);
- X } /* menu case */
- X
- X HiliteMenu (0); /* turn off hilighting on the menu just used */
- X return (returns);
- X} /* DoCommand */
- X
- X
- X/*
- Xthe main loop that handles events
- X############################ MainEventLoop ##########################
- X*/
- X
- Xmaineventloop () {
- X
- X/* body of MainEventLoop */
- X
- X FlushEvents (everyEvent); /* discard leftover events */
- X
- X/* get next event, and Handle it appropriately, until user QUITs */
- X
- X userdone = 0;
- X do {
- X SystemTask (); /* Handle desk accessories */
- X if (GetNextEvent (everyEvent, &myevent)) {
- X /* get event; if for us... */
- X switch (myevent.what) {/* Handle each kind of event */
- X case mouseDown: /* find out what window the mouse went
- X down in, and where in it */
- X windowcode = FindWindow (&myevent.where, &whichwindow);
- X switch (windowcode) { /* Handle mouse-down for each place */
- X case inSysWindow:
- X /* Handle the desk accessories */
- X SystemClick (&myevent, whichwindow);
- X break;/* inSysWindow */
- X case inMenuBar: /* Handle the command */
- X userdone = docommand (MenuSelect (&myevent.where));
- X break; /* doesn't have Aztec's compiler error */
- X }
- X break; /* switch */
- X
- X case keyDown:
- X case autoKey: /* if command key, pass the char to MenuKey */
- X if ((myevent.modifiers & cmdKey) != 0)
- X userdone = docommand (MenuKey ((char) (myevent.message & charcodemask)));
- X case updateEvt:
- X break;
- X case activateEvt:
- X break;
- X }
- X }
- X
- X } while (userdone == 0);
- X}
- X
- X/*
- X body of Skel
- X*/
- X
- Xmain () {
- X setup ();
- X maineventloop ();
- X}
- X
- X/* needed to be added for Consulair */
- XSFGetFile(where, prompt, fileFilter, numTypes, typeList, dlgHook, reply)
- X long *where; // really address of a point
- X struct PStr *prompt;
- X int (*fileFilter)();
- X short numTypes;
- X SFTypeList *typeList;
- X int (*dlgHook)();
- X SFReply *reply;
- X {
- X #asm
- X MOVE.L D0,A0
- X MOVE.L (A0),-(SP) ; WHERE
- X MOVE.L D1,-(SP) ; PROMPT
- X MOVE.L D2,-(SP) ; FILTER PROC
- X MOVE.W D3,-(SP) ; numTypes
- X MOVE.L D4,-(SP) ; typeList
- X MOVE.L D5,-(SP) ; dlgHook
- X MOVE.L D6,-(SP) ; reply
- X MOVE #2,-(SP) ; PARM
- X DC.W $A9EA ; PACK3
- X #endasm
- X };
- X
- X#include <pbdefs.h>
- X
- Xshort
- XGetVol(volName, vRefNum)
- Xchar *volName;
- Xshort *vRefNum;
- X{
- X ioParam iop;
- X iop.ioCompletion = 0; /* address of IO completion routine */
- X PBGetVol(&iop, 0); /* PBGetVol, synchronous */
- X volName = iop.ioNamePtr;
- X *vRefNum = iop.ioVRefNum;
- X return(iop.ioResult);
- X}
- X
- Xshort
- XSetVol(volName, vRefNum)
- Xchar *volName;
- Xshort vRefNum;
- X{
- X ioParam iop;
- X iop.ioCompletion = 0; /* address of IO completion routine */
- X iop.ioNamePtr = volName;
- X iop.ioVRefNum = vRefNum;
- X PBSetVol(&iop, 0); /* PBSetVol, synchronous */
- X return(iop.ioResult);
- X}
- ________This_Is_The_END________
- if test `wc -l < sampler.c` -ne 363; then
- echo 'shar: sampler.c was damaged during transit'
- echo ' (should have been 363 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting sampler.doc'
- if test -f sampler.doc; then echo 'shar: will not overwrite sampler.doc'; else
- sed 's/^X//' << '________This_Is_The_END________' > sampler.doc
- XWell, *I* took Thomas Newton's Desk Sampler, converted it to Consulair
- XMac C, and
- X * fixed the program so it doesn't try to close DRVR resources numbered
- X 27-31 (used for run-time drivers instead of desk accessories, as
- X documented in "Life After the Font/DA Mover" by Apple).
- X
- X * Made it use resources for the Menus, thereby making it possible to
- X "internationalize" the program with ResEdit.
- X
- XHere it is. Newton gave it to the non-commercial public; I can do no less.
- X
- X--Brian Bechtel {oliveb, apple, bnrmtv}!3comvax!brianb
- X------------------------------------------------------------------------
- XA while back, someone posted a desk accessory sampler program which was called
- X"Whitman's 'Desk Accessory' Sampler" to the net. This program was distributed
- Xas shareware, with a fee of $10. My first reaction upon using the program was
- Xthat it performed a useful function but that it must have been utterly trivial
- Xto write, given the Mac's support for resources (such as desk accessories...).
- XThus, I stopped using the program (rather than forking over $10 or using it on
- Xa regular basis without paying for it), and resolved to write and give away my
- Xown program to do the same thing.
- X
- XOn Friday night, I decided to kill some time, so I sat down at my Mac with my
- Xcopies of Megamax C v2.1, Inside Mac, and SKEL 2.2.3C. By the time that I was
- Xready to go to sleep, I had the program working with the exception that (a) it
- Xdidn't do anything in response to the "About..." menu item, and (b) it didn't
- Xhave a special icon. A lot of the time that I spent on it was occupied by one
- Xof two tasks: (a) cutting things out of SKEL that my program didn't need, and
- X(b) replacing "#include" statements with selected definitions from the Megamax
- Xheader files (I have a 128K Mac, and MMC 2.1b tends to run out of symbol table
- Xspace on 128K Macs for programs that have lots of "#include" statements). As
- Xof some time tonight, I finished up the task of making an "About..." dialog
- Xbox and a special icon for the program and was finished.
- X
- XThe advantages that my Desk Accessory Sampler has over the other version are:
- X
- X 1. It's free. You don't need to make a choice between giving up
- X $10 or giving up the use of the program in order to be honest.
- X 2. It comes with source code. If you think that it could use any
- X changes, you can hack on it to your heart's content.
- X 3. It changes the highlighting status of the "Close" menu item to
- X let you know whether or not you currently have a resource file
- X open (the shareware program doesn't give any such indication).
- X (Note: as in the other program, "Open" can be selected while a
- X resource file is open; in this case, the program closes the old
- X resource file before opening the new one.)
- X 4. It provides all five of the standard editing commands (UNDO, CUT,
- X COPY, PASTE, CLEAR) in the EDIT menu, as opposed to the three
- X (CUT, COPY, PASTE) supported by the shareware program. Note: I
- X was really amazed to see this -- setting up a menu with all five
- X commands is *very* easy (as in "editing cmd # = menu item #-1").
- X 5. It attempts to avoid situations of the type "there is an accessory
- X running whose resource file we have just closed" since these lead
- X directly to system crashes. Unfortunately, I don't know of a good
- X way to keep track of which accessories are active (while OpenDeskAcc
- X returns a reference number if it succeeds, it may return garbage if
- X it fails). The approach that my program takes, therefore, is to try
- X to close every driver with a resource ID between 12 and 31; this seems
- X to work fairly well. It certainly works better than the approach of
- X doing nothing and letting the system crash and burn. . .
- X 6. It has a toggle switch in the FILE menu that allows you to open *any*
- X Macintosh file and use its "DRVR" resources. This isn't a very major
- X feature; on the other hand, it wasn't hard to put in . . .
- X
- XIt's bad enough that someone is trying to collect money for a program that
- Xis obviously doing very trivial things. What's even worse is that it isn't
- Xeven very competent at what it does do!!! Is it too much to ask that people
- Xrefrain from marking every hack they throw together as shareware requiring a
- Xdonation for continued use?
- X
- XAnyway, I'm posting both the program's source form (Sampler.c, Sampler.R)
- Xand its binary form (Sampler.Hqx) to net.sources.mac. Enjoy.
- X
- X -- Thomas Newton
- X Thomas.Newton@spice.cs.cmu.edu
- X
- X
- ________This_Is_The_END________
- if test `wc -l < sampler.doc` -ne 77; then
- echo 'shar: sampler.doc was damaged during transit'
- echo ' (should have been 77 bytes)'
- fi
- fi ; : end of overwriting check
- echo 'Extracting sampler.r'
- if test -f sampler.r; then echo 'shar: will not overwrite sampler.r'; else
- sed 's/^X//' << '________This_Is_The_END________' > sampler.r
- X* Sampler.R -- resource definition file for Desk Accessory Sampler
- X* Adapted from the SkelR file in Skel 2.2.3C by Thomas Newton
- X* modified some more by Brian Bechtel 11/20/85 Consulair C
- X*
- X* I prefer putting the resources into a linker-compatable file. Advantages:
- X* You typically don't change the resources that often
- X* The linker can set the bundle bit instead of using FEDIT
- X* One less program in the program cycle.
- XSamplerR.rel
- X
- X* Version data for the finder
- X* Our signature is "TDN1"
- X* res. ID = 0, by convention
- X* finder version data
- X* Note that the blank in 'STR ' is significant 3/8/85 WHJ
- XTYPE TDN1 = STR
- X ,0
- X Desk Accessory Sampler v1.15 -- November 20, 1985
- X
- X* dialog box for About command
- X* ID (4 => pre-loaded; 32 => purgeable)
- X* title
- X* BoundsRect(global: TLBR)
- X* Vis NoGo: it's visible, but has no close box
- X* ProcID: Window type is modal dialog
- X* RefCon: Unused user variable
- X* res. ID of item list
- XType DLOG
- X ,257(4)
- X About Box
- X 35 16 285 496
- X Visible NoGoAway
- X 1
- X 0
- X 257
- X
- X* dialog item list for About command
- X* ID (4 => pre-loaded; 32 => purgeable - it should always be purgeable.)
- X* # Items
- X* the first item:
- X* a Button you can select
- X* display rect (local coords)
- X* title
- X* the second-last items:
- X* Static text, disabled (i.e. can't select it)
- X* display rect
- X* text to be displayed
- XType DITL
- X ,257(36)
- X 8
- X button Enabled
- X 220 370 241 470
- XOK
- X
- X staticText Disabled
- X 5 145 20 481
- XDesk Accessory Sampler v1.15
- X
- X staticText Disabled
- X 20 10 35 481
- XCopyright \A91985 Thomas D. Newton (modified: Brian Bechtel 11/20/85)
- X
- X staticText Disabled
- X 65 0 80 481
- XThis program allows one to use desk accessories stored in resource files
- X
- X staticText Disabled
- X 80 0 95 481
- X(such as the ones produced by Apple's Font/DA Mover) without installing
- X
- X staticText Disabled
- X 95 0 110 481
- Xthose accessories into a System file.
- X
- X staticText Disabled
- X 140 0 155 481
- XDesk Accessory Sampler may be copied and used by anyone, so long as
- X
- X staticText Disabled
- X 155 0 170 481
- Xthat use is not for commercial purposes.
- X
- X* For proper support of the Desk accessories, the Apple menu
- X* should be first, and the Edit menu should be third. The first 5 items
- X* in the Edit menu should be identical to those used below. This makes
- X* it possible for the desk accessories to share the Edit menu with your
- X* application.
- X*
- X
- XType MENU
- X ,1
- X\14
- X About Sampler...
- X (-
- X
- X ,2
- XFile
- XOpen Desk Accessory File.../O
- X(Close current accessory file/K
- X(-
- XShow only Apple DA Mover files!\12/T
- X(-
- XQuit/Q
- X
- X
- X ,3
- XEdit
- X (Undo/Z
- X (-
- X Cut/X
- X Copy/C
- X Paste/V
- X Clear/B
- X
- X****************************************************************************
- X**** This section contains information for the Finder; ****
- X**** the program never accesses this information directly. ****
- X**** The entire section can be omitted from the first versions ****
- X**** of a program (you must then set the application's type to ****
- X**** APPL, the creator to ????, and don't set the bundle bit); ****
- X**** the default application icon will be used. ****
- X**** For more info, read "Putting together a Mac Application" ****
- X**** and "The Structure of a Mac Application". ****
- X*
- X* a Bundle: contains references to other finder info, (below)
- X* ID (32 => purgeable)
- X* Bundle owner: TDN1 (our signature), Res ID of version data = 0
- X* "ICN#" (means icon list), # of icon resources in bndl = 1
- X* local ID 0 maps to global ID 128 (the FREF uses a local ID, to refer to
- X* an icon which has a global ID. See the FREF resource, below);
- X* "FREF" (means file reference), # of FREF res in bndl = 1
- X* local ID 0 maps to global ID 128
- X
- XType BNDL
- X ,128(32)
- X TDN1 0
- X ICN# 1
- X 0 128
- X FREF 1
- X 0 128
- X
- X* a File Reference
- X* ID, (32 => purgeable)
- X* "APPL" : a file of type APPL gets the following icon (a suitcase);
- X* local icon ID; maps to global ID as specified in BNDL
- X* name of file that must accompany application if transferred; omit if none.
- X Type FREF
- X ,128(32)
- X APPL 0
- X
- X* An icon list for the application icon (a partially opened suitcase)
- X* REdit 1.0 (resource decompile option)
- X* ID (the application icon), (32 => purgeable)
- X* Data is Hex data (.H)
- X* the icon data: 32 lines of 8 hex chars each
- X* the icon mask: 32 lines of 8 hex chars each
- XType ICN# = GNRL
- X ,128(32)
- X.H
- X00000000
- X7245D1DC
- X456D5112
- X7755D1DC
- X15451112
- X75451DD2
- X00000000
- X00007E00
- X00008100
- X00FF7EFE
- X01014283
- X0203C385
- X04000009
- X0FFFFFF1
- X0AAAAAB1
- X0D555551
- X0AAAAAB1
- XFFFFFF51
- X800002B1
- X8FFFF351
- X480011B1
- X4FFFF151
- X449249B1
- X27FFF8D1
- X249248B1
- X27FFFCD1
- X12492471
- X13FFFC51
- X11249272
- X09FFFE34
- X08000018
- X07FFFFF0
- X*
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- X00007E00
- X0000FF00
- X00FFFFFE
- X01FFFFFF
- X03FFFFFF
- X07FFFFFF
- X0FFFFFFF
- X0FFFFFFF
- X0FFFFFFF
- X0FFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- XFFFFFFFF
- X7FFFFFFF
- X7FFFFFFF
- X7FFFFFFF
- X3FFFFFFF
- X3FFFFFFF
- X3FFFFFFF
- X1FFFFFFF
- X1FFFFFFF
- X1FFFFFFE
- X0FFFFFFC
- X0FFFFFF8
- X07FFFFF0
- X
- X**** end of information for the finder ****
- X***********************************************************************
- ________This_Is_The_END________
- if test `wc -l < sampler.r` -ne 227; then
- echo 'shar: sampler.r was damaged during transit'
- echo ' (should have been 227 bytes)'
- fi
- fi ; : end of overwriting check
- exit 0
-