TPF0 TFilterList FilterListTVersionVersion, €This filter demonstrates how to generate a messsage file for PageGate's GetASCII program. Any line that contains the word 'error' is sent as a message. The filter can be customised by changing the following items in the VBScript (NOT HERE IN THE COMMENT!) 'polled directory MUST have a trailing \ const getAsciiPolledDirectory = "c:\Program files\PageGate\Polled\" 'who the message is from const fromUser = "TextPipe" 'who the message is to const toUser = "SysAdmin" GetASCII documentation ==================== The GetAscii front-end interface can be used to poll a directory for Ascii text files that contain messages. An Ascii text file is simply a file containing text only. The DOS EDIT and Window NotePad programs create Ascii text files by default. Ascii text files can also be created from within virtually any programming environment. In order for GetAscii to pick-up Ascii text file messages, the file must be put in the Polled Directory specified in PageGate's Admin program. GetAscii will only look for files with the .asc extension (see 'Advanced ascii polling' for other polling options). If more than one file with a .asc extension exists in the polled directory, the files are sorted alphabetically and then processed in alphabetical order. The format of the .asc files is as follows: to from message Please note that each line must have a carriage return terminating it (or carriage return and line feed). 'to' should be replaced with the recipient's name of who the message is to (can not be blank) 'from' should be replaced with who the message is being sent from (can not be blank) 'message' should be replaced with the actual message text. The 'message' area is actually everything after the 'from' line. Therefore multiple lines of message data is valid. (can not be blank) Example file named test.asc: Chris Peter This is a test.rthis is a test shouldn't fpick this line this line has an ERROR in it and this doesn't this is also an ERROR |NA  textpipe.log ô TFilterCommentObjectenabled ListObject  TInputObjectenabled InputObject  d  TGrepObjectenabled GrepObject  ERROR TScriptObjectenabled ScriptObject ¸'Example PageGate integration 'This script generates a .asc file in the GetASCII polled 'directory if it finds the word 'error' on any line in 'the input file or files. A message is sent from user 'TextPipe to user SysAdmin, and the actual error line is 'also output 'polled directory MUST have a trailing \ const getAsciiPolledDirectory = "c:\Program files\PageGate\Polled\" 'who the message is from const fromUser = "TextPipe" 'who the message is to const toUser = "SysAdmin" 'start number is used to generate successive message filenames dim startNumber startNumber = 0 function generateError( error ) 'generate a .asc file in the polled directory Dim fso, f1 Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.CreateTextFile(getAsciiPolledDirectory & "error" & startNumber & ".asc", True) f1.WriteLine( toUser ) f1.WriteLine( fromUser ) f1.WriteLine( error ) f1.Close startNumber = startNumber + 1 end function 'Called for every line in the file 'EOL contains the end of line characters (Unix, DOS or Mac) that must be 'appended to each line function processLine(line, EOL) generateError( line ) processLine = line & " " & EOL end function 'Called at the start of a processing job - 'perform one-time initialisation here sub startJob() end sub 'Called at the end of a processing job - 'destroy any declared objects here sub endJob() end sub 'Called before each file is opened - 'perform per-file initialisation here function startFile() startFile = "" end function 'Called before each file is closed - 'flush all pending file output here function endFile() endFile = "" end function VBScript TOutputObjectenabled OutputObject .pasc:\windows\tempmergefilename.txt