Copyright: GDSoft, 1995


 Introduction

SWAG (SourceWare Archival Group) is a collection of source code and program examples for the PASCAL programming language. The material has been donated by various PASCAL programmers from around the world, who desire to contribute to the advancement of one of the greatest programming languages there is. MANY THANKS to all who have contributed. As such, NO CHARGE OF ANY KIND IS PERMITTED FOR THIS WORK.

The material has been collected from various network conferences worldwide, and organized according to subject. New material is added quarterly, and new SWAG packets are available from various BBS sources on a FIRST call basis.

Getting Started

Using SWAG for WINDOWS

General overview

Main files screen

Snipets screen

Viewer screen

Command Summary

SWAG Support

About the program

Conclusion


 Getting Started

The program SWAGWIN.EXE is a WINDOWS 3.x executable program that will allow you to read, extract or print the contents of SWAG packets. These packets are organized according to subject, with each one containing a number of PASCAL "snipets" on that subject. In the rest of this document, I'll refer to the program as "SWAGWIN".

The simple way to install the software is to use the SETUP program that came with the distribution archive.  The SWAG packets should be placed ALL together in a directory on your disk.  It is recommended that you create a single directory named 'SWAG'.

 	use the DOS command to create a directory: mkdir c:\swag.

 	Place the .HLP file and SWAGWIN.EXE in this directory.

 	Create a sub-directory : mkdir c:\swag\files

 	Unpack the distribution archives and place all of the files with the extension of "*.SWG" in this directory.

Start WINDOWS and create an ICON for SWAGWIN. It can be placed in any GROUP that you choose. Also, you can use the SETUP program included in the distribution archive to setup SWAG for WINDOWS for you.


 General Overview

SWAG files (.SWG) are highly compressed archives using a specialized LZH format :

SwagHeader =

RECORD

HeadSize	 : BYTE	size of header

HeadChk	 : BYTE	checksum for header

HeadID	 : ARRAY (1..5) OF CHAR	compression type tag

NewSize	 : LONGINT	compressed size

OrigSize	 : LONGINT	original size

Time	 : WORD	packed time

Date	 : WORD	packed date

Attr	 : WORDtab	file attributes and flags

BufCRC	 : LONGINT	32-CRC of the Buffer

Swag	 : STRING(12)	stored SWAG filename

Subject	 : STRING(40)	snipet subject

Contrib	 : STRING(35)	contributor

Keys	 : STRING(70)	search keys

FName	 : PathStr	filename (variable length)

CRC	 : WORD	16-bit CRC (follows FName)

END;

Each archive contains any given number of snipets each with a header as described above, and following is a buffer of compressed text. You CAN NOT read .SWG files with any normal archive program due to the structure of the header. However, the SWAG SUPPORT TEAM provides numerous utility programs that will allow you to manipulate the files in various ways. Additionally, you'll find various sources in SWAG to play with the headers if you want to.


 Main Files Screen

Using the program is really very simple. Just execute it, and you will be presented with a directory of all of the .SWG files in the directory that SWAG for WINDOWS is located in. If you have .SWG files elsewhere on your disk, or for that matter, any disk on your system, you can move around the disk to find them by selecting the ".." [image] file which will take you to the PARENT directory. Use the HOME, END and the arrow keys to maneuver around.

ALSO,

The directory window  is search key sensitive. This means  that if you have .SWG files  or directories listed in  the directory box, you  can just type the name of the file you want.  For example, pressing 'A' will place you at the first  entry starting with  'A'. Press 'N',  and you will  jump the the entry with 'AN...'  if you have one. If  NOT, you will jump the  first file starting with the letter 'N'.

Click on any area to display what happens for real.


SWAG Support

SWAG files are available at any of the SWAG support sites listed in the BBS list.  Additionally, we upload the new snipets to COMPUSERVE, EXEC-PC and CRS in Canada with each release.

If you are an INTERNET user, you can ALWAYS find the files at the following:

SWAG World Wide Web Address

http://users.aol.com/SWAGWWW/swag.html

SWAG Direct FTP

ftp://users.aol.com/SWAGWWW/files

Vassa University (Finland)

ftp://garbo.uwasa.fi/pc/turbopas

Questions, comments and contributions to SWAG are always welcome.  They can be sent to any of the SWAG SUPPORT team at their email addresses :

Gayle Davis - GDSoft

gdavis@betacon.com OR 72067.2726@compuserve.com

Kerry Sokalsky - FalconTech Consulting

kerry.sokalsky@canrem.com

Jeff Fanjoy (Micky) - MatrixSoft(tm)

jfanjoy@interlog.com


Snipets screen
 SWAG Snipets Screen

This is the Snipet List screen.  Click on any of the buttons or screen areas to display more information about this screen.


Snipets View screen
 Snipets Viewer Screen

This is the Viewer screen.  Click on any of the buttons or screen areas to display more information about this screen.


 Keystroke Command Summary

Certain shortcut keys are defined in SWAG for WINDOWS. This makes it a little eaiser to get around inside the program :

 	CtrlQF - Brings up the Search function

 	CtrlL  - Find Next

 	<CR>   - read the snipet or file

 	ESC    - Quit


 Summary

At this point you should be able to enjoy SWAG for WINDOWS.  The library contains a ton of really useful material, and you'll find that you won't be without it.

We  hope that  you find  the READER   easy to  use, and  the SWAG  material valuable in development of your PASCAL programs.

ENJOY !!!!! and GOOD PROGRAMMING !!!

Gayle Davis, Kerry Sokalsky and Jeff Fanjoy

SWAG Support Team


Using Grep function
 Using the GREP function

The GREP (search) function. This is  a VERY POWERFUL  and useful function that allows you to find anything in the SWAG snipet collection.  Entire text of all the snipets can be searched or you can do just a header search which is very fast.

Click on any area to display more info about dialog.


Using Grep function

Enter a string  to search for. You may search  for a multiple occurrence of substrings using  BOOLEAN operators AND (&)  OR (|). For example,  a search for  THIS&THAT|THEM&THOSE would  return  all  snipets containing  both ORed phrases THIS&THAT OR THEM&THOSE.

In BOOLEAN Algebra, the AND operator  takes precedence over the OR operator (except  when  using  parentheses).  This  is  NOT  the  case with the GREP function. You  can use the PARENTHESES  () to dictate which  portion of the search string is  to be processed first. If  multiple levels of parentheses are used,  the order is RIGHT  to LEFT, starting with  the innermost set of parentheses, wherever they occur.

As an example, in the phrase ((this|that)&(them&those)), (them&those) would be processed  before (this|that)) innermost  to outermost. In  other words, all snipets  will be returned  containing THIS or  THAT AND they  also will contain (THEM and THOSE).

Within a set  of parentheses, order will be left  to right. Construction of the search string itself requires combining the desired substrings together with  the desired  BOOLEAN operators.  Without the  parentheses, the search string will be processed logically. THIS|THAT&THEM&THOSE will return all of the snipets  that contain THIS  plus the  ones  that contain THAT  & THEM & THOSE. You can  see that this is totally different  than what you'll get by using the parentheses.

Additionally, you can also include a  date in the format MM/DD/YY, and ONLY records AFTER this  date will be included. If you  enter JUST the date, ALL SWAG  snipets  AFTER  this  date  will  be  included. For example, entering CURSOR|ANSI&CRT|05/08/93  would search  the  SWAG  packets for  matches for CURSOR OR (ANSI  AND CRT) occurring AFTER 05/08/93.  Entering JUST 05/08/93 at the prompt would bring back ALL snipets AFTER 05/08/93 REGARDLESS of the subject.

Enter  an empty  string as  the search  string, and  READER will return all snipets since the LAST SWAG release.

SWAGWIN will search ALL of the  SWAG packet HEADERS in the CURRENT directory for matches based  on your criteria. A processing box  will appear, and all occurrences of your  search string(s) or date matches will  be written to a NEW SWAG file.  Initially, this file is named GREPSWAG.SWG,  and will be in the current  directory. Upon completion of  this GREP process, you  will be asked for the  file name. Enter any name AND  directory you choose, and the file will be RENAMED and moved  to that directory. Pressing ESCAPE WILL NOT save a file at all. This process allows you to create SWAG files containing ANY combination of material that you please.


You can  ALSO search the ENTIRE  SWAG snipet buffer for  data. Just enter a tilde (~) character as the FIRST character on the search line. For instance to  find all  snipets containing  CRT, you  would enter  ~CRT on the search line. ONLY  the header of snipets  is searched for matches.  This a way you can look at all snipets by a certain contributor. You can also use multiple search criteria  here. For instance,  ~GAYLE DAVIS|GUY MCLOUGHLIN|JOE  BLOW would bring back  everything for each of these  persons. This search method is VERY fast as on the headers have  to be read. By the way, the same rules about AND/OR searching apply when search just the headers.

Beginning with  version 3.0, we added  KEYS to the SWAG  header. This makes the searching function work MUCH faster,  and you can use the EDIT HEADER function in the viewer screen to edit these search keys.


Click one of these buttons to do what is indicated.


Main Menu Selections
 Files Screen Menu Selections

File

Delete (CtrlD)

Delete the current highlighted file.

Exit (AltX)

Exit SWAG for WINDOWS

Grep

Opens up a find dialog box to search the snipet files for text.

Options

Exit On Escape

Allows SWAGWIN to exit when the escape key is pressed.

Font

Allows the selection of the font for the files window.

Edit SWAGWIN INI File

Uses NOTEPAD to display and edit the setting in the SWAGWIN INI File.

Set Extract Directory

Permits the selection of the default directory that will be used to extract snipets.

Reset Window Defaults

Resets the window coordinates to system defaults for SWAGWIN.

As you exit each screen of SWAGWIN, the size and location of each

window is saved in the INI file.  This set everything back to the "factory" settings.

Help

Contents

Displays the SWAG for WINDOWS help file.

About

The about box.

Credits

Displays the credits and e-mail addresses of the SWAG SUPPORT TEAM.


Snipet Menu Selections
 Snipet Screen Menu Selections

File

Open (Enter)

Opens the currently highlighted snipet

Delete (CtrlD)

Delete the current highlighted snipet.

Exit (AltX)

Exit the snipet window

Search

Find Text (F3)

Search for text in the snipet list.

Find Next (CtrlL)

Find the next occurance of the previous search.

Sort

Number

Sort snipet list by number.

Contributor

Sort snipet list by contributor.

Subject

Sort snipet list by subject.

Options

Font

Allows the selection of the font for the snipet window.

Help

Displays the SWAG for WINDOWS help file for the snipet window.


Viewer Menu Selections
 Viewer Screen Menu Selections

File

Extract (CtrlE)

Extracts this snipet to your disk.

Kill (CtrlK)

Kills this snipet.

Edit Header (CtrlH)

Edit the snipet header information.

Print

Prints the snipet text on your printer.

Print Setup

Select the output options for your printer.

Exit (AltX)

Exit the viewer window

Clipboard

Copy (CtrlC)

Copy the highligted text to the WINDOWS clipboard.

Select ALL

Selects ALL of the snipet text.

Search

Find Text (F3)

Search for text in the snipet text.

Find Next (CtrlL)

Find the next occurance of the previous search.

GoTo Line (F4)

Go to a given line number in the text.

Options

Tab Expansion

Toggles tab expansion feature.

Tab Size

Set the tab size for the tab expansion feature.

Font

Allows the selection of the font for the viewer window.

Help

Displays the SWAG for WINDOWS help file for the viewer window.


Parent Directory
The is the directory ONE LEVEL lower that the current directory. (ala WINDOWS 95) You can get there quickly by using the BACKSPACE key.


About the program

SWAG for WINDOWS was written by Gayle Davis, GDSoft entirely in BORLAND DELPHI. The program may be copied and distributed freely providing that no fee is charged and it is not part of a package for which a charge is made.

Please report all bugs, suggestions, and problems to Gayle Davis:

 	CompuServe ID #72067,2726.

 	e-mail address 72067.2726@compuserve.com OR gdavis@betacom.com

© 1995, GDSoft all rights reserved.


Links to this Help file


Toggles the Tag for the currently highlighted file. You can also use the "spacebar" to do this.


Click here to see WINDOWS system information or the current time and date.


Exit SWAG for WINDOWS.


Delete the highlighted .SWG File.


The current SWAG files path is shown here.


Double Click on any listed .SWG file to open it.


UnTag All currently tagged files.


Rename the currently highlighted file.


Click one of these to change the current disk drive.


This is the main body of the snipet.  Use the scrollbars to move up or down, or you can also use Up/Down arrow keys and PgUp/PgDown.  Text can be marked using the mouse, or by holding down the SHIFT key, and using the arrow keys.  Once text is marked, it can be inserted in the WINDOWS clipboard by pressing CTRL+INSERT.


Shows information about the snipet, size, current line and column number.


Search the snipet for text.


The snipet header displays the date description, contributor, and keys. You can change this information by clicking on the EDIT SNIPET HEADER button.


Extract the snipet to your disk.


Edit the snipet header. Here you can change the contributor, keys and description.


Find NEXT text.


First, Last, Next or Previous snipet.


KILL this snipet.


Exit the viewer screen.


Exit the snipet window.


KILL the highlighted snipet.


Click on one of these to Sort the snipet list by Number, Contributor or Subject.


Search for text in the snipet list.


Double click on any highlighted item to view the snipet.


Extract the snipet to your disk.


Displays the total snipets in the .SWG file.