[Tips] Comparing Two Files=Using the COMPARE option with GET or PUT, you can compare the\crlfcontents of files on two computers without actually replacing the\crlfdestination file. You simply get an indication of what would happen\crlfwere you to try to do an update:||!ok! \tfiles were identical\n!updated!\tfile WOULD be updated\n!error! \tcomparison was unsuccessful||For example, you could check||IF `GET ftp://who@where.edu/what1 ...\n...FROM ftp://who2@where2.edu/what2 ...\n...OPTIONS C B` and !updated!\n Get file:///myfile ...FROM ftp://who2...\n ...OPTIONS R B\nendif||Valid sources include\crlffile:///, ftp://, gopher://, http://, dde:, telnet:, input:, text:, pick:,\crlfvariable:, and clip:.||Valid destinations include file:///, ftp://, variable:, and clip:.\crlf Using IF=You can test for two conditions:||\terror/no_error \n\tupdated/not_updated||and also for string variable values and file existence:||\tIF value:day=Mon\n\tIF value:t=__UNDEFINED__\n\tIF exists:C:\TEMP\T||Pretty much, these do just what you think they would do:\crlfErrors result from such actions as invalid file names,\crlfunavailable FTP sites, and disk read/write problems. Attempting to\crlfwrite a zero-length file also causes an error.\crlfFailure to update may be due to an error, but also may be\crlfdue to a file already being up-to-date (exact match byte-for-byte).||For variables, operators include <, >, =, <>,<=, or >=. Quotation marks\crlfare unnecessary. Note that even the operator can be a variable:||\tIF value:day%op%Mon||If a variable name begins with "#", then a numerical comparison is made\crlfrather than a string comparison. See also the Tip 'Using IF--Advanced'.\crlf Using SET=SET allows you to set many of the default variables used in QuickURL.\crlf(You can also change them just by editing QUICKURL.INI, by the way.)||But more than that, you can define your OWN variables with SET. Just\crlffind a blank line, Click 'Edit' and press 'S' for SET. With in the\crlfprotocol box, type 'variable name=whatever' For example:||SET exename=QUICKURL||SET allows you to change variable definitions while the list runs, but if\crlfyou just want to have a static variable, place it as %name% in a command. For example:||PUT text:"Hi, %who%" ......TO mailto:%who%||The first time %who% is used, you will be asked to define it.\crlfUse 'UNSET var' or 'SET var=' to remove a variable so that\crlfit can be defined by the user or discarded. See also 'Variable Expressions.' Commands (Program Flow)=Commands that affect program flow include:||BEEP \tbeep n times\nDO/LOOP \toptions relate to time\n \t or variable states\nFOREACH/NEXT\tloops and sets variables\nGOTO \tto a LABEL\nIF/ELSEIF/ \terror,update,variable-based\n ELSE/ENDIF \t or command evaluation\nLABEL \ttarget for GOTO\nMSGBOX \tsets %MSGBOX% variable\nPAUSE \trequires 'GO' command\nSET/UNSET \tchange variables\nWAIT \trelative or absolute time\n Turning Variables OFF=Variables are bounded by '%'. Thus, %test% represents the variable\crlf'test' in URLs, IF, and GOTO statements.\crlfWhen % is followed by any numeral, such as '%3D', or by '{' as in '%{x}',\crlfit is ignored. This is to be compatible with HTTP and SENDKEYS construction.\crlfIn addition, '%%' will be substitiuted with a single '%'.||If you must use '%' in a URL in one of these two types, do the following:||\tSET variables=OFF\n\tPUT gopher:......%this isn't a variable%...\n\tSET variables=ON||Note that variables are only turned off for file transfer/shell/sendkeys commands.\crlfCommands such as IF, SET, and MSGBOX are not affected. Command Line Options=By copying the Windows icon for QuickURL, you can run list files automatically.\crlfJust add the filename to the command line for the icon. In addition,\crlfyou can add any of the following options:||GO \t start automatically\nEXIT \t exit when done\nNOERROR\t don't stop for errors\nNOWINSOCK\t assume no winsock||NOERROR is implied for any file containing IF error: or IF no_error: statements.||You can also define variables on the command line. Use double ampersands, or Windows will try to interpret the variable as a DOS environmental variable:||QUICKURL filename.lst GO EXIT %%semester%%=1 %%year%%=1997||Generally it is better to use the SET command in the file itself. Using SET commandlineoptions=GO EXIT, for example, in a\crlffile make it so that when the file is run from an icon, it starts and QuickURL exits automatically when run from the icon.||In addition, any QuickURL command can be run from the command line. See the tip 'Command Line--Windows95/DOS'\crlf Using SENDKEYS=SENDKEYS windowcaption (task FILENAME.EXE):"strokes to send"||SENDKEYS sends keystrokes to an application. 'windowcaption:' is optional and, if included,\crlfactivates that application prior to sending strokes.\crlfDOS shells are no problem, and are handled by passing the information\crlfthrough the clipboard. Wildcards are recommended in any situation where\crlfthe window caption might change. For example, Netscape* will pick up the topmost\crlfNetscape window. 'SENDKEYS' by itself simply lists all running applications\crlfin the log window. If no strokes are included, SENDKEYS simply activates the application.\crlfThe task is also optional and is executed if the window is not found.||If the task you specify is running, but the window is not of this name, then\crlfSENDKEYS will rename the window. In the case of COMMAND.COM, this also\crlfstarts a new instance of the DOS shell.\crlfFor example, to start a new DOS shell, rename it's window "Hello",\crlfand get a directory listing, use:||SENDKEYS Hello(task command.com "Hello"):dir{enter} Commands (File Transfer)=The following file transfer methods are available:||CD \tchange directory\nDEL \tdelete a file\nDIR \tlist directory\nDISCONNECT \nEDIT \tedit a file\nEXECUTE \traw FTP or TELNET command\nGET \tget file; same as PUT\nHEAD \tHTTP file info only \nLAUNCH \trun Windows command\nMKDIR \tmake directory (FTP or FILE)\nMPUT \tsame as PUT\nPOST \tHTTP method\nPUT \tfile transfer\nRENAME \trename a file\nSENDKEYS \tsend keystrokes to app\nSHELL \trun and WAIT for execution\n Using mailto:='mailto' is the Web designation for SMTP, Simple Mail Transfer Protocol.\crlfThe form of the 'mailto:' protocol allows\crlffor the optional inclusion of a subject and a return address:||mailto:whom "subject here"[return@address.here]||Multiple recipients should be separated using commas:|| mailto:him,her,me,you,%who?%||Please note that the combination of MAILTO and DO/LOOP or FOREACH/NEXT is\crlfquite powerful and not necessarily appreciated by the recipient.|||| _Getting Started=QuickURL is VERY powerful--Don't expect to master it in an hour! One of the\crlfeasiest ways to get an idea of what you can do with QuickURL is to load one of\crlfthe example LST files. Take a look at what is done; see if that is the sort of thing\crlfyou are interested in doing. Modify it to do exactly what you want to do, and give it\crlfa try.||Navigational tips:||Commands may be entered in one of several ways:|| 1)\t Start typing\n 2)\t Click the 'Details...' button\n 3)\t Click Connect...Downloads......\n 4)\t Click Examples\n 5)\t Highlight a line or group of lines on the list\n 6)\t Highlight a line on the list\n \t and click the RIGHT mouse button\n 7)\t Click on File...Edit List\n 8)\t Click on File...Open File Using SENDKEYS--Special Keys=Several special keys are available for SENDKEYS. They all involve {}. Special keys include||{left} \t{right}\t{down}\t{up} \n{pgup}\t{pgdn}\t{home}\t{end}\n{esc} \t{bs} \t{del} \t{enter} \n{tab} \t{F1}-{F16}\n'%{x}' means ALT-x; '^{home}' means CTRL-HOME, and '+{left}' means SHIFT-LEFT.\crlfFor example, '{home}+{end}' highlights the active textbox in the application.||For DOS shells, the only appropriate special key is {enter}.||Note that %{ } (that's a space character between brackets) activates the upper-left menu button\crlfon all windows. Use '%{ }R' to restore an iconified window prior to sending other keystrokes.\crlf Using DDE=DDE, or Dynamic Data Exchange, is an older method of transfering data among\crlfrunning Windows applications. Another method, OLE, is flashier, but there are\crlfLOTS of cool things you can do with DDE.||You can use DDE two ways with QuickURL:||1) You can run QuickURL from another application such\crlfas Microsoft Excel or another Visual Basic program. To do this is a bit tricky, but if you\crlfknow a little about DDE, check the tip on 'Using DDE To Run QuickURL'.\crlfAlso read about DDE in your Microsoft Word or Excel help.||2) You can GET and PUT information to other applications using the 'dde:' protocol.\crlf(For binary data, I recommend you put the FILENAME, not the file, to the DDE link.\crlfTwo simple examples are||GET dde:Progman ......FROM text:CreateGroup(QuickURL)\nPUT text:Hello! ......TO dde:excel|sheet1|R1C1:R3C2||which creates a new windows group titled 'QuickURL'. See more under Examples.\crlf Using DDE To Run QuickURL=Here's a sample Excel macro that loads a file into QuickURL. QuickURL must be running.||Sub QuickURL()\n channelNumber = Application.DDEInitiate("QUICKURL","QUICKURL")\n Application.DDEExecute channelNumber, "LOAD c:\quickurl\dde.lst"\n Application.DDETerminate channelNumber\nEnd Sub\n Starting QuickURL with Drag/Drop=If you drag a LST file icon to the QuickURL icon, QuickURL\crlfwill start automatically and load that file. However, then no command line\crlfoptions will be present. To have options such as GO NOERROR EXIT,\crlfjust include a SET command such as the following somewhere in the list:|| SET commandlineoptions=GO NOERROR EXIT||Then, when the drag-drop occurs, these options will be added. Using dde: With GET/PUT=GET/PUT dde:application|topic|item||'item' is not always required, as the first example below shows. If 'topic' and\crlf'item' are both missing, 'item' is taken as blank and topic is taken as equal to\crlfapplication. Examples include:||GET dde:Progman ......FROM text:CreateGroup(QuickURL)\nPUT text:Hello! ......TO dde:excel|sheet1|R1C1:R3C2\nGET file:///C:\TEMP\T ......FROM dde:excel|sheet1|R1C3:R3C3||Note that in Excel, if a range of cells is taken, each row is on a new line,\crlfand columns are separated by tabs.\crlf Using FOREACH/NEXT=FOREACH/NEXT allows you to repeat a block of commands for a set of\crlffilenames or variable values. FOREACH simply defines a set of variables\crlfas follows:||%i% \tthe full filename or value\n%ifile% \tthe full filename\n%ipath%\tthe path part of the filename\n%iroot%\tno path or extension\n%iext% \tjust the extension||'i' here will be substituted with whatever is on the NEXT line. Examples include:||FOREACH pick:File type?{*.ZIP,*.EXE}\n GET ftp://ftp.stolaf.edu/pub/origami/WIN/%file type?%\n ......TO file:///C:\TEMP\n ......OPTONS B U\nNEXT type\n Using pick:=FOREACH pick:caption/default{pick1,pick2,pick3,...}\nPUT pick:caption/default{pick1,pick2,pick3,...} ......TO...\nGET pick:variablename ......FROM...||The 'pick:' protocol allows you to offer a user options that might affect later processing.||When loading the selection box, normally picks are separated by commas.\crlfIf the source contains CRLFs, picks are assumed separated by CRLFs, or, if not,\crlfand the source contains TABs, then picks are assumed separated by TABs.||Pick always results in an array of values separated by comma, CRLF, or TAB,\crlfwhich are then used in some way. Add single, double, or back quotes, as necessary,\crlfaround picks containing commas or quotation marks.||In the\crlfcontext of FOREACH, the variable given in the accompanying NEXT command is given the\crlfvalues listed, one after another, as the FOREACH/NEXT commands are processed.||In the context of PUT pick: .....TO, the values are simply listed to the destination.||In the context of GETpick: ......FROM, the options come from the source, and are\crlfthen chosen by the user and stored in variable 'variablename'. If the variablename is missing, the variable 'pick'\crlfis used. You can use 'GET pick: ......FROM file:\\...' to select specific lines from a file.||\crlf Using Variables=Variables in QuickURL take the form of %variablename%.\crlfThus, for example, you might use %search% for a search term in a query or\crlf%name% for a login name.||When a command file is saved, variables and passwords are saved as well.\crlfIf a variable name contains a '*' anywhere in the string, then it will be considered equivalent to a password and saved only\crlfin encoded form.||In addition, variables may be defined on the Windows command line.\crlfCommand line definitions override any definitions saved in the file, unless they are\crlfexplicitly set using the SET command. Special system variables are stored in QUICKURL.INI and\crlfcontain a "|" in their name. Do not use "|" for YOUR variables.||On the command line, variables must be surrounded by two ampersands\crlfso as to distinguish them from DOS environment variables. In addition, double quotes\crlfmust be used around any definition involving a space character. If a definition has a\crlfspace and a double quote, then surround it by __' '__ (two underscores, single quote single quote, two underscores).\crlfFor example:||C:\QUICKURL\QUICKURL myfile.lst %%query%%="ph hansonr" %%filter%%=__["phone:"]__|| Creating and Editing Tips=You can create and edit your own tips. They will be saved in the file PERSONAL.TIP.\crlfTo remove tips that you have created or edited, just make them or their description read\crlf"". Using DO/LOOP=DO/LOOP [hours:/minutes:/seconds:] n||In this mode, DO/LOOP lets you loop through a set of commands\crlfon a set schedule of 'n' hours, minutes, or seconds.||DO/LOOP until: timestring or var=value||In this mode, you can loop until a certain time or until a certain variable is set to\crlfa certain value.||WAIT also allows you to schedule commands, but is slightly different\crlfbecause WAIT simply waits the specified amount of time. LOOP takes\crlfinto account all time since its respective DO was executed last.||If you want to wait UNTIL a certain time, use LABEL/WAIT/GOTO\crlfinstead. Here we wait until 1 AM and then loop.||LABEL whatever||WAIT until: 1:00 AM\nGOTO whatever __NEW=Check the README file for all version update information. Using telnet:=telnet:// can be used either as a source or destination.||As a source, output from the command will be directed to the requested destination.\crlfCommands are not echoed, and all output, including the prompt, is returned. For example:||PUT telnet://hansonr@myhost.edu/pwd;ls -l ......TO msg:||As a destination, whatever lines are in the source will be delivered as telnet commands.\crlfFor example:||GET telnet://hansonr@myhost.edu ......FROM text:%what%||By default, telnet needs to see "Login" and "Password" from the host to proceed. In addition,\crlfthe prompt '%' is expected. You can change these defaults by using SET. For example:||SET Telnet|LoginPrompt=Username\nSET Telnet|PasswordPrompt=ID\nSET Telnet|Prompt=$\n Using ftp: with GET/PUT=FTP transfers can be either anonymous or with a login ID/password.\crlfWhen using anonymous FTP, you need only to specify a host name. For example:||GET file:\\\C:\TEMP\T.ZIP ...\n...FROM ftp://mari.acc.stolaf.edu/pub/origami/WIN/qckurl10.zip||If you would login with an ID and password to this site, then just include the ID with '@'\crlfas though it were email:||PUT file:\\\C:\TEMP\T.ZIP ...\n...TO ftp://loginid@mari.acc.stolaf.edu/pub/origami/WIN/yourfile.zip||You do NOT indicate the password; it will be asked for when the time comes.\crlfSee also the Help menu item under Passwords. Using EXECUTE=EXECUTE is a method which allows the adventuresome to remotely run commands\crlfon a remote machine. The two supported protocols\crlfare telnet:// and ftp://, as, for example:||EXECUTE ftp://ftp.stolaf.edu/PWD ......TO msg:||or||EXECUTE telnet://hanson@m.stolaf.edu/cd www;ls -l ......TO file:///C:\TEMP\T||In order to use EXECUTE effectively, especially for telnet://,\crlfyou must have some knowledge about the\crlfsorts of commands that the remote machine can handle. In the above case we are giving\crlfUNIX commands to change to the www subdirectory and then get a long directory listing,\crlfwhich is then being put into C:\TEMP\T. Using ftp: The FTP URL=The FTP URL consists of six parts:||ftp://username@server:port/path/filename||ftp:// \tUse the FTP protocol\nusername@\tOptional username\nserver \tFTP server name or address\n:port \tOptional port; defaults to 21\n/path \tSubdirectory information\n/filename \tFilename||Note that the password is not included here for security reasons.\crlfServers vary, especially in regard to the path. Three conventions are used here:||/path \tappend this path to the default path\n//path \ttreat this as a root-level path\n///path \trelative to default; don't append\n/~user \ton UNIX systems: default path for user||You may have to experiment a little if you are having problems finding the path to a file. So What's a URL?=A URL, or Uniform Resource Locator, is an encapsulation of the information\crlfnecessary for locating a specific internet resource, as described in RFC 1738.\crlf(To read the RFC, see the Example 'Get Request For Comment By Number'.)||QuickURL takes some liberties with this standard. In particular:||ftp: \tallows for designating relative or absolute path\nmailto: \tallows for a subject and a from-address\ntelnet: \tallows for command execution||In addition, several nonstandard protocols are added:||clip: \tthe windows clipboard\ndde: \tdynamic data exchange\ninput: \tuser input\nlog: \tthe log window\nmsg: \ta message box\crlf FTP/FTP?=That's right, with QuickURL you can send files from one FTP site to another\crlfwithout them ever gracing your hard drive. And, yes, they can even be the same\crlfsite and even the same files.||For example, you can filter a file to itself on a remote\crlfserver. Or you can use QuickURL to transfer files from one directory on a remote\crlfserver to another on the same server. (Like the TELNET command 'mv source destination'.)||Using the UPDATE option, you can transfer only if the contents are different, and using the\crlfCOMPARE option, you can just compare two remote files.||You can even just tell the server to write to the same file--sort of an FTP 'no-operation', but\crlfI don't recommend it, as some servers may trash their own files.||To do any of this, just indicate both source and\crlfdestination to be FTP sites. Magic? No, just a good implementation of RFC 959.||Note that if you use the Update option, or if you filter the files, then files WILL be\crlftemporarily stored on your hard drive. FTP Options=FTP Options include:||A\tASCII (text files)\nB\tBinary (usually graphics)||R\tReplace (typical FTP)\nU\tUpdate (transfer only if different)\nP\tAppend\nC\tCompare only||N\tdoN't change case of file names\nL\tLower the case of file names||Note that U, P, C, N, and L are all special QuickURL-only options. In addition, you can\crlfcompletely change the filename, filter a file by matches and line counts, and reformat\crlfthe data of text files based on column fields. See the tips "Filter..." for more information. Protocols--Source=The following SOURCE protocols are supported with GET and PUT:||clip: \t(from the clipboard)\ndde: \tapplication|topic|item\nfile:/// \tdrive:\fullpath\filename\nftp:// \tuser@host/filepath\ngopher://\tserver/resource\nhead:// \tserver/resource\nhttp:// \tserver/resource\ninput: \tuser input\npick: \tcaption/default{pick1,pick2,...}\npost:// \tserver/resource?query\ntelnet:// \tuser@host/command\ntext: \ttext string\nurl: \tgeneric\nvariable:\tvariablename\crlf Protocols--Destination=The following DESTINATION protocols are supported with GET and PUT:||clip: \t(to the clipboard)\ndde: \tapplication|topic|item\nfile:/// \tdrive:\fullpath\filename\nftp:// \tuser@host/filepath/filename\nlog: \t(output to log window)\nmailto: \tuser@where"subject"[fromwhom]\nmsg: \t(output to message box)\npick: \tvariablename\ntelnet://\tuser@host\nurl: \tgeneric\nvariable:\tvariablename\crlf Variable Expressions=You can carry out simple numerical calculations using numerical variables (those beginning\crlfwith '#'). Operators include +, -, *, /,\crlf\ (integer division), =, <>, <, >, <=, >=, AND, OR, and NOT.\crlfOrder of operations without parentheses are */\, +-, =...>=, NOT, AND, OR.\crlfParentheses are allowed and encouraged.||For example:||SET #x=#x+1||PUT text:" 5+3/(3-4)-%a% " ......TO variable:#x||Note that '=>' means MOD for numerical expressions and 'is in' for strings. For example,||3=>2 is 1||'t'=>'what' is 4|||| Using GOTO=GOTO simply branches to a label with the same name. However, it is also\crlfpossible to put variables into the GOTO command, and in association with\crlfpick, this allows the user to have more options:||\crlfLABEL Try Another\n........||GET variable:WhatToDo? ...\n...FROM pick:What do you want to do?{Quit,Try Another}||GOTO %WhatToDo%\nLABEL Quit||GOTO names are not case sensitive. Using url:--generic protocols='url:' allows you to designate later the exact protocol. 'url:' is especially powerful\crlfwhen used with variables. For example:||GET url:%what?% ......FROM url:%where from?%||requests input, expecting a FULL URL designation, such as 'http://... NOT DONE Copying and Moving List Commands=You can use Shift-DEL (or CTRL-C) and Shift-INS (or CTRL-V)\crlfto copy information from one list command to\crlfanother, just as with any Windows program.||In addition, if you highlight a section\crlfof a command when the 'New' button is showing and then press 'New', a new\crlflist command will be created containing only the highlighted information.||To MOVE a list command to a new location, just 'Delete' it, move, and 'UnDel' it.\crlf Using IF--Advanced Transfer=Whole transfer commands such as GET and PUT can be incorporated into IF statement\crlfby placing evaluation marks (`) around them. For example, the following IF statement\crlfcompares two binary files and ends up TRUE if they are the same:||IF...\crlf... `GET ftp://ftp.stolaf.edu/pub/origami/WIN/iconmvr.exe ...\n...OPTIONS R B` and not !error! and...\n...`GET file:///%Default|AppPath%/iconmovr.exe ......OPTIONS U B ` ...\n...and not !error! and not !updated!\n \tMSGBOX ok:They are the same\nENDIF||The result of the execution of a command is testable by ANDing with any of the following\crlfthe three values:|| !ok! \t(1) successful completion, but no update\n !updated!\t(2) file was updated (or would be, for Compare option)\n !error! \t(4) an error occurred||The only actual valid return values are 1, 2, and 4. These values\crlfare in a 3-bit system, so NOT !error! = 3 (!ok! or !updated!), NOT !updated! = 5 (!ok! or !error!),\crlfand NOT !ok! = 6 (!updated! or !error!). Using IF--Advanced MSGBOX=You can incorporate a MSGBOX command within an if statement to make a simple\crlfmessagebox test. For example:||IF `msgbox yes/no:Do you want to continue?`='yes'||options include:||\tok\n\tok/cancel\n\tyes/no\n\tyes/no/cancel\n\tabort/retry\n\tretry/cancel\n Using ...... To Continue Lines=In CERTAIN circumstances, you can use ...... (six periods in a row) to continue a line\crlffor better readability. Basically, you can do this any place a SPACE character would be\crlfappropriate. That means|| before or after AND, OR, or NOT in any evaluation\n before or after AND, OR, or AS in any filter\n between words in any 'text:' or 'msg:' phrase \n NOT in filter match phrases\n NOWHERE in any URL\n Obtaining User Input=You can get user input in one of four ways:||a) short answer:|| GET variable:varname ......FROM pick:What do you want for varname?||b) longer answer:|| GET variable:varname ......FROM input:What do you want for varname?||c) based on options:|| GET variable:varname ......FROM pick:What do you want for varname?{a,b,c}||d) on the fly:|| Just place a "?" at the beginning of the variable name:|| GET url:%?Destination URL% ......FROM %?Source URL%|| variables--UPPER CASE/lower case=If you need to use a variable definition and want to ensure\crlfthat it is lower case, just surround its name with single quotes whenever needed. Similarly, for\crlfUPPER CASE, use double quotes:\n\nSET test=ThisIsATest\nPUT variable:test ......to log:\nPUT variable:'test' ......to log:\nPUT variable:"test" ......to log:\nPUT text:%test%...%'test'%...%"test"% ......to log:\n\nresults in the following:\n\nThisIsATest\nthisisatest\nTHISISATEST\nThisIsATest...thisisatest...THISISATEST\n\nFor variables to be defined at runtime by the user using a '?', place the '?' inside the quotes:\n\nPUT text:%'?test'% ......to log:\n\nresults in test being defined the way the user types, but used THIS TIME as lower case.\crlf Input Filter Basics=Input Filters allow you to reduce the source data of transferred files.\crlfInput filters have six fields, in order:||+/- \tinclude matched lines\n \t (only if first/last or additional)\nfirst/last \tlimit to first or last match\noperator \t< = > <= >= <>\n'x' or "x" \tmatch: use dbl-quotes for case-sensitive\n+/-n \tnumber of additional lines to include\n \t if n is absent then ALL after/before\n@pos \tcolumn position, starting with 1\n \t @? matches any position\n/n \trecord length||If the lines of the file are known fixed-length, then you can indicate the length of the records with a\crlf'/' and the record length after the position. However, if the fixed-length records end in CR, LF, or CRLF,\crlfthen you can just put '/?' here, and QuickURL will figure it out based on the first record of text.||Input filters can be combined using 'or', 'and', 'not', and parentheses (in increasing precedence).\crlfSo, for example, the following works:|| ( [="1995"@1] or [="1997"@1] ) and [="CHEM"@?] \comments ignored||See Input Filter Examples and Input Filter Logic for more ideas. Input Filter Examples=The full input filter syntax is given in the Input Filter Basics tip. Here are some sample input filters:||["Test"] \tMatch 'Test' but not 'test'\n['test'] \tMatch 'test' or 'Test' or 'TEST', etc...\n[first'test'] \tMatch FIRST line containing 'test'\n[last'test'] \tMatch LAST line containing 'test'\n[-'test'-] \tAll lines prior to first containing 'test'\n[+'test'-] \tAs above, and including that line\n[+'test'+5] \t(First) occurance of 'test' and next 5 lines\n[-'test'+5] \tJust 5 lines AFTER first containing 'test'\n[-'test'-5] \tJust 5 line PRIOR TO first containing 'test'\n[-last'test'-5]\t5 lines previous to LAST occurance of 'test'\n[+] \tAll lines\n[+5] \tJust return first 5 lines\n[-5] \tJust return last 5 lines\n[<>'t'@4] \tMatch lines NOT having 't' or 'T' in column 4\n Output Filters--Evaluations=You can evaluate as many numerical expressions within an output filter format string or field\crlfas you like. To do so, surround the expression with reverse-single quotes:||GET.....FROM.....OPTIONS [+] as \n [" field 1 * field 2 = $3\\n",3.5,10.2,(` $1 * $2 `))||This example takes multiplies the numerical value of the five bytes starting at column 3\crlfby the value in the two bytes starting at column 10, and places that value in $3.\crlfOperators include +, -, *, /,\ (integer division), =, <>, <, >, <=, >=. =>, AND, OR, and NOT. Parentheses are allowed and encouraged.\crlf'=>' means MOD, so `3=>2` is 1.\crlf Output Filter Fields--Column Matching=Output filter fields can select text based on matches to text or column positions. For example:||as ["...$1...$2...\\n",(3:5),('test':'system')]||This sets $1 to be the 3rd-5th characters and $2 to be whatever text appears from the word 'test' to the word 'system'.\crlfThe subfields before and after the colon are of the form: +/-'text'+/-n||+ \tthe whole line\n+5 \tjust the first 5 characters\n-5 \tjust the last 5 characters\nfirst't' \tthe first 't' or 'T' (default)\nlast't' \tthe last 't' or 'T'\n't'+ \tall characters from 't' or 'T' on\n't'+ \tall characters from 't' or 'T' on\n"t"- \t't' and all characters preceding it\n-"t"+ \tall characters after 't'\n-"t"- \tall characters prior to 't'\n-"t"+5 \tfive characters after 't'\n-last"t"+ \tall characters after the last 't'||In addition, if i specifies a character AFTER j in i:j (such as 5:3 or -3:-5), then the field is\crlfset to all text on the line EXCEPT those characters. If -"text" is used without a colon, then\crlfthat is interpreted to mean "all EXCEPT text".||\crlfSee also the tip 'Output Filter Fields--Delimited Text'|| Output Filter Fields--Character Substitution=You can do very sophisticated character substitution using output filters. For\crlfexample, you can redefine where the line breaks are or change the order of fields,\crlfor even do numerical calculations on fields. You can mix QuickURL variables into\crlfthe output format and fields as well.||Simple character substitutions are carried out using $0 in the format string and '='\crlfin the match. '$0' means 'the whole line, without the line break'. For example:||[+] as ["$0\\n",('was'='is')]||substitutes all occurances of 'was' with 'is'.||[+] as ["$0 ",(''='\\n')]||puts all ... phrases on lines by themselves, perhaps for later processing.||[='testing'] as ["$0\\n",(first'testing'='Testing')]||filters for lines containing 'testing' and then capitalizes the first occurance of 'testing' on\crlfeach of those lines.||See also the tips 'Output Filter Fields' and 'Output Filter Field Pipes' Output Filter Field Pipes=You can pull out a field of a line and then change it in various ways prior to putting it into the\crlfoutput format using the '|' symbol. For example:||GET ..... OPTIONS [+] \n as ["The word after 'test' is $1\\n",'test'+|2.1' ']||pulls out the part of a line from the word 'test' to the end of the line, then FROM THAT,\crlftakes the second word (delimited with a space) and calls it $1.||You can put as many pipes together as you wish. Output Filter Basics=You can pull up to nine specific fields from a file and reformat them using an output filter\crlfof the form 'as ["format",field1,field2...]'. For example:|| [="MSP"@1] as [ "readings for $1=$2\\n",1.3,(48.5)]||This means, "Substitute the three bytes starting at column 1 for $1 and\crlfthe five bytes starting at column 48 for $2." The '()' around 48.5 indicates that\crlfthose bytes should be trimmed of leading and trailing spaces prior to substituting.||Designate fields as $0-$9 within "format" or other fields; $0 means the entire line.||Special characters\crlfinclude \", \\, \$, \\t, and \\n. Note that you MUST put a '\\n' at the end of the format if\crlfyou intend to break the output into lines. That is, there is no implicit CRLF.||Note that only one output filter is allowed. See also the tips\crlf'Output Filter Fields--Column Matching' and 'Output Filters--Evaluations' Output Filter Fields--Static Text='Static' text is defined here as text which is defined within the output filter itself, not\crlftext to be matched in the input record. Static text is preceded by a $. For example,\crlfone use of static text is when you need to define one field value in terms of another:||GET ..... OPTIONS [+] as ["$2\\n",(3:5),$'x$1']||selects the 3rd-5th characters, then just places 'x' followed by\crlfthose three characters in field $2 and outputs that. On the other hand,||GET ..... OPTIONS [+] as ["$2\\n",(3:5),-'x$1'+]||selects the 3rd-5th characters, then FINDS 'x' followed by\crlfthose three characters in the record, saves everything after it as $2,\crlfand outputs THAT.||Note that all text after an '=' is implicitly static:||GET ..... OPTIONS [+] as ["$0\\n",last'test'='TEST']||This replaces (case insensitively) the last occurrance of 'test' on the line with 'TEST'.\crlf Output Filter Fields--Delimited Text=Output Filter Fields of the form n.m or i:j can be based on delimiters on the line such as comma, tab, or space.\crlfTo specify the delimiter, enclose it in single quotes after the field designation. For example:||GET ..... OPTIONS [+] as ["$2\\t$1\\n",2.1'\\t',1.1'\\t']||pulls out the first and second tab-delimited text of the line and outputs them in reverse order.||In the n.m',' context, m=0, as in 2.0 or 1.0, has a special meaning--it specifies\crlfthat surrounding quotation marks if present, should be removed. This allows reformatting of\crlfcomma-quote delimited text in the input into space-delimited or tab-delimited text in the output. Output Filter Fields--Trimming Spaces=Any output filter field may be trimmed of spaces on the left '(x', right 'x)', or on\crlfboth left and right '(x)'.||In addition, if the form n.0 is used\crlffor delimited-text fields (see the Tip 'Output\crlfFilters--Delimited Text') then field n is trimmed of leading and trailing double-quote marks. Output Filters--Padding Fields Using n.m=The n.m field designation (4.3, for example) is slightly different than i:j (for example, 4:6) in that i:j pulls out\crlfall characters from field i to field j that exist in the input record. If the input record is short\crlfand thus missing these fields, i:j simply returns nothing.||On the other hand, when a line is short, n.m always returns m fields, padding the\crlffields if necessary with spaces or the specified delimiter. For example, if the input\crlfline were:||12345||then 4.3 returns '45 ' ('45' followed by a blank), while 4:6 just returns '45'.||Similarly, for||1,2,3,4,5||4.3',' returns '4,5,' whereas 4:6 just returns '4,5' (without the trailing comma).||The idea is that if you are trying to rearrange fields and you want to be SURE short lines still\crlfreturn a certain number of characters, use n.m, not i:j.|||| DIR and HTTP:=DIR and HTTP:???||Yes. The heirarchy of the Web is similar to FTP. You can list a web-based directory just like you can\crlffor an FTP site. The only special aspect of the Web is that\crlfif a file named 'index.html' is present in a directory, then when a request for a directory is\crlfmade, THAT file is sent instead. So sometimes you get an actual listing (when index.html is missing)\crlfand sometimes you get a 'front-end' file, index.html, which covers for the listing and\crlfprobably protects wandering eyes from the true contents of the site.||QuickURL simply treats index.html as a directory listing, indicating all tags of type\crlfFILE:///, FTP://, HTTP://, or GOPHER://. This action is not limited to index.html; any file can be\crlf'mined' for tags. Wildcards are accepted. For example:||DIR http://www.stolaf.edu/people/hansonr/spd2flyi.htm/*.htm ......to log: Breaking Long Lines: ......=Long lines can be broken using '......' (six periods) between elements. Don't break lines\crlfin the middle of a URL. 'TO', 'FROM', and 'OPTIONS' will automatically be broken. For example,\crlfthe following entry:||get c:\\temp\\t from input: options H||will be changed to||GET c:\\temp\\t ...\n...FROM input: ...\n...OPTIONS H|| Input Filter Logic=Input filters such as [10], [-10], and ['xyz'] can be connected with the logical operators\crlf'or', 'and' and 'not'. 'not' has the highest precedence (done first) followed by 'and', then\crlf'or'. Parentheses can be used to modify this precedence. For example:||[10] not ['xyz'] \n[10] or [-10] and ['xyz']\n([10] or [-10]) and ['xyz']||In addition, for 'not' and the second operand of 'and',\crlfline counts refer to lines still valid. For example:||[-10] not [-3]\tfirst 7 of last 10 lines\n['xyz'] and [-2]\tlast 2 lines with 'xyz'\n[last'x'+] and [first'y'-] not ['test']||This last filter finds all lines NOT containing 'test' between the last line containing 'x' and\crlfthe first line AFTER that line containing 'y'||You can use the filter check facility (button to the right of the filter in 'detail') to try different\crlffilters on test files.\crlf Command Line--Windows95/DOS=Under Windows95, if you open a DOS window, you can run QuickURL commands right from\crlfthe DOS command line. (Under Windows3.1 these commands must be run from Windows icons.)||For example:||quickurl get file.htm from http://www.stolaf.edu/people/hansonr||or (multiple files):||quickurl get c:/temp/*.* from ftp://ftp.stolaf.edu/pub/origami/WIN/{quickurl.exe,quickurl.tip}||or (upload):||quickurl put c:/temp/t.htm to http://www.stolaf.edu/people/hansonr/t.htm||If errors occur, you are dropped into QuickURL.|| [Examples] _Using Set--QuickURL Update by FTP=see below DO/LOOP, gopher://, Filters, and IF--MSP Weather Update=see below Using dde:--PUT to Excel=see below Using input: with mailto:--Send Comments to Author=see below Using pick: with IF and FOREACH=see below Using pick: and filters--RFCs by Keyword=see below Using pick: and filters--RFCs by number=see below Using dde: and FOREACH--Creating a Windows Group=see below Sophisticated Filtering--CSO Phone Book Lookup=see below Filter Formats--Text to Msg Tests=see below Advanced IF and default GET/PUT--Interactive Update=see below Using the Compare OPTION--Comparing two files=see below _Samples=see below Getting Just a Section of a File: Looking at WIN.INI=see below [LST-Using dde: and FOREACH--Creating a Windows Group] 001=1|LABEL In this example, DDE is used to tell Program Manager to create a new Windows 002=1|LABEL group and fill it with all W*.EXE files in the Windows directory. 003=1| 004=1|MSGBOX ok/cancel:The next commands create a Program Manager group and add some EXE files to it. 005=1|IF value:msgbox=ok 006=5|GET dde:Progman ... 007=5|...FROM text:[CreateGroup(Windows w...exe files)] ... 008=5|...OPTIONS A 009=5|FOREACH file:///c:/windows/w*.exe 010=9|GET dde:Progman ... 011=9|...FROM text:[AddItem(%ifile%)] ... 012=9|...OPTIONS A 013=5|NEXT 014=5|MSGBOX ok:All Done! 015=1|ENDIF 016=1|VARIABLES: %%day%%=_''_Sun_''_ %%date%%=_''_05/04/1997_''_ %%time%%=_''_22:58_''_ %%ifile%%=_''_c:\windows\WRITE.EXE_''_ [LST-_Using Set--QuickURL Update by FTP] 001=1|LABEL This example uses SET to determine whether either of two files were updated. 002=1| 003=1|LABEL This file will download a specific EXE file 004=1| 005=1|SET CommandLineOptions=GO EXIT 006=1|SET exename=quickurl 007=1|SET didupdate=false 008=1|GET file:///%Default|AppPath%\%exename%.exe ... 009=1|...FROM ftp://ftp.stolaf.edu/pub/origami/WIN/%exename%.exe ... 010=1|...OPTIONS B U L 011=1|IF updated: 012=5|SET didupdate=true 013=1|ENDIF 014=1|IF value:%exename%=quickurl 015=5|GET file:///%Default|AppPath%\%exename%.TIP ... 016=5|...FROM ftp://ftp.stolaf.edu/pub/origami/WIN/%exename%.tip ... 017=5|...OPTIONS A U L 018=1|ENDIF 019=1|IF updated: 020=5|SET didupdate=true 021=1|ENDIF 022=1|IF value:didupdate=true 023=5|MSGBOX ok:Files were updated. Restart QuickURL now to effect the changes. 024=5|GET mailto:hansonr@stolaf.edu ... 025=5|...FROM text:Thanks for %exename% ... 026=5|...OPTIONS A 027=1|ENDIF 028=1|VARIABLES: %%exename%%=_''___UNDEFINED___''_ %%day%%=_''_Sun_''_ %%date%%=_''_05/04/1997_''_ [LST-Using pick: with IF and FOREACH] 001=1|LABEL In this example, variable 'list' is set to an array of four values, 002=1|LABEL and the user must refine the list to fewer than 3 selections. 003=1|LABEL Once that is done, the refined list is processed. 004=1|SET list=yes,no,checkb,quit 005=1|DO 006=5|GET variable:list ... 007=5|...FROM pick:%list% 008=1|LOOP until:#picked<3 009=1|FOREACH value:%list% 010=5|IF value:a=yes 011=9|MSGBOX ok:yes it is! 012=5|ELSEIF value:a=no 013=9|MSGBOX ok:no it ain't! 014=5|ELSEIF value:a=checkb 015=9|GET variable:b ... 016=9|...FROM pick:{yes,no} 017=9|IF value:b=yes 018=13|MSGBOX ok:b is yes! 019=9|ELSEIF value:b=no 020=13|MSGBOX ok:b says no! 021=9|ELSE 022=13|MSGBOX ok:%b% 023=9|ENDIF 024=5|ELSE 025=9|MSGBOX ok:%a% 026=5|ENDIF 027=1|NEXT a 028=1|VARIABLES: %%day%%=_''_Sun_''_ %%date%%=_''_05/04/1997_''_ %%time%%=_''_20:37_''_ %%list%%=_''_yes,no_''_ %%b%%=_''_yes_''_ %%a%%=_''_checkb_''_ [LST-Using dde:--PUT to Excel] 001=1|LABEL In this example, DDE is used to first display the contents of a block of an 002=1|LABEL Excel spreadsheet, then fill in the block with three lines of data, then 003=1|LABEL display the changed data in a message box. 004=1| 005=1|MSGBOX ok/cancel:The next three commands will only work if Excel is running. 006=1|IF value:msgbox=ok 007=5|PUT dde:excel|sheet1|R1C3:R6C6 ... 008=5|...TO msg: 009=5|IF no_error: 010=9|GET dde:excel|sheet1|R1C3:R6C6 ... 011=9|...FROM text:this is \nreally three \nlines ... 012=9|...OPTIONS A 013=9|PUT dde:excel|sheet1|R1C3:R6C6 ... 014=9|...TO msg: 015=5|ENDIF 016=1|ENDIF 017=1|VARIABLES: %%day%%=_''_Sun_''_ %%date%%=_''_05/04/1997_''_ %%time%%=_''_22:29_''_ [Program] Version=3.1b [LST-Using input: with mailto:--Send Comments to Author] 001=1|LABEL This example simply sends user input to Bob Hanson 002=1|GET mailto:hansonr@stolaf.edu"QuickURL Comments" ... 003=1|...FROM input:What can I do for you? ... 004=1|...OPTIONS A 005=1|LABEL Note that you can also indicate multiple recipients with commas: 006=1|;GET mailto:me,you,him"Subject"[fromwhom] ... 007=1|...FROM text:%brief message% 008=1|LABEL And you can even get this recipient from a pick: 009=1|;GET variable:list ... 010=1|...FROM pick:{me,you,him} 011=1|LABEL label...which might have come from a file: 012=1|;GET pick:list ... 013=1|...FROM file:///c:\temp\addrlist.txt 014=1|;GET Mailto:%list%"%Subject%" ... 015=1|...FROM input:Enter a message below: 016=1| 017=1|VARIABLES: %%day%%=_''_Mon_''_ %%date%%=_''_05/26/1997_''_ %%time%%=_''_20:50_''_ [LST-Sophisticated Filtering--CSO Phone Book Lookup] 001=1|LABEL This example demonstrates the use of sophisticated filtering of 002=1|LABEL data coming from a Gopher site. 003=1|LABEL This example gets a list of phone servers from Bob Hanson's FTP site 004=1|LABEL and then lets you pick one and then select a name for searching. 005=1|LABEL On some servers '*' can be used for a wildcard, as 'hans*' 006=1|LABEL Also, some servers may not like the 'ph' command. 007=1|LABEL Note! Not all servers will 'answer the phone' and not all will accept the 'ph' command. 008=1|IF exists:cso.dat 009=1|ELSE 010=5|GET file:///cso.dat ... 011=5|...FROM ftp://ftp.stolaf.edu/pub/origami/WIN/*{cso.dat} ... 012=5|...OPTIONS A R L 013=1|ENDIF 014=1|LABEL Try another location 015=1|PUT file:///cso.dat ... 016=1|...TO pick:list ... 017=1|...OPTIONS [':105'@?] as ["$1 ($2)\n",(-'> ':-''),(-'gopher://':':105')] 018=1|PUT variable:list ... 019=1|...TO variable:GopherServer ... 020=1|...OPTIONS [+1] as ["$1",(-'(':-')')] 021=1|LABEL Try another name 022=1|DEL file:///cso.tmp 023=1|SET Default|ErrorTrapping=OFF 024=1|GET file:///cso.tmp ... 025=1|...FROM gopher://%gopherserver%/ph %?whom% ... 026=1|...OPTIONS A R L 027=1|IF error: 028=5|MSGBOX ok:%error% 029=1|ELSE 030=5|GET pick:names ... 031=5|...FROM file:///cso.tmp ... 032=5|...OPTIONS ['name'@?] 033=5|GET clip: ... 034=5|...FROM text:From %gopherserver%/ph %whom% \n ... 035=5|...OPTIONS A R 036=5|IF value:names<>__UNDEFINED__ 037=9|GET variable:keys ... 038=9|...FROM variable:names ... 039=9|...OPTIONS ['name'@?] as ["$1\n",(':':':')] 040=9|LABEL Here we are picking up the index number for all names chosen... 041=9|...It appears as :nn:, so we say, "Find 'name' and take everything from the ... 042=9|...first colon (':') THROUGH (:) the second colon (':') " 043=9|FOREACH value:%keys% 044=13|PUT file:///cso.tmp ... 045=13|...TO variable:Here you go! ... 046=13|...OPTIONS [='%i%'@?] as ["$1\n",(-'%i%'+)] 047=13|LABEL This says, "look for the next value of %keys% and output... 048=13|... everything on the line AFTER it. 049=13|GET variable:Here you go! ... 050=13|...FROM variable:Here you go! ... 051=13|...OPTIONS [+] as ["$1\n",(+)] 052=13|GET clip: ... 053=13|...FROM variable:Here you go! ... 054=13|...OPTIONS A P 055=13|GET msg: This is now in the clipboard ... 056=13|...FROM variable:Here you go! 057=9|NEXT 058=5|ENDIF 059=1|ENDIF 060=1|GET variable:What now ... 061=1|...FROM pick:What now?{Quit,Try another name,Try another location} 062=1|GOTO %What now% 063=1|LABEL Quit 064=1| 065=1|VARIABLES: %%day%%=_''_Tue_''_ %%date%%=_''_05/27/1997_''_ %%time%%=_''_12:41_''_ %%gopherserver%%=_''_yuma.ACNS.ColoState.edu:105_''_ %%whom%%=_''_hanson_''_ %%keys%%=_''_:1:_''_ %%i%%=_''_:1:_''_ %%error%%=_''_Label __UNDEFINED__ was not found_''_ [LST-Using pick: and filters--RFCs by Keyword] 001=1|LABEL This example filters an FTP index, let's the user select one or more 002=1|LABEL documents by keyword, and then reformats the selections, one by one, into 003=1|LABEL an appropriate HTTP URL request format, and GETs each text document. 004=1|LABEL An RFC, or Request For Comment, is a document describing internet standards 005=1|LABEL 959 refers to the File Transfer Protocol (FTP) 006=1|IF exists:%default|appPath%\rfcindex.txt 007=5|MSGBOX yes/no:Do you want to update %default|appPath%\rfcindex.txt? 008=1|ELSE 009=5|SET msgbox=yes 010=1|ENDIF 011=1|IF value:msgbox=yes 012=5|GET file:///%default|appPath%\rfcindex.txt ... 013=5|...FROM ftp://ftp.isi.edu/in-notes/rfc-index.txt ... 014=5|...OPTIONS A R L [>="0"@1] and [<="9"@1] 015=1|ENDIF 016=1|DO 017=5|GET variable:keyword ... 018=5|...FROM pick:What Keyword do you want to look for? 019=5|GET pick:p ... 020=5|...FROM file:///%default|appPath%\rfcindex.txt ... 021=5|...OPTIONS [='%keyword%'] and [<>'(Not'] 022=5|FOREACH value:%p% 023=9|GET variable:rfc number? ... 024=9|...FROM variable:i ... 025=9|...OPTIONS [first] as ["#1",1:4] 026=9|GET file:///%default|apppath%\rfc%RFC NUMBER?%.txt ... 027=9|...FROM http://ds.internic.net/rfc/rfc%RFC NUMBER?%.txt ... 028=9|...OPTIONS R L 029=9|IF error: 030=13|MSGBOX %error% 031=9|ELSE 032=13|EDIT file:///%default|apppath%\rfc%RFC NUMBER?%.txt 033=9|ENDIF 034=5|NEXT i 035=5|MSGBOX yes/no:Another? 036=1|LOOP until:msgbox=no 037=1| 038=1|VARIABLES: %%day%%=_''_Tue_''_ %%date%%=_''_05/27/1997_''_ %%time%%=_''_12:51_''_ %%keyword%%=_''_smtp_''_ %%rfc number?%%=_''_876_''_ [LST-Getting Just a Section of a File: Looking at WIN.INI] 001=1|LABEL This example illustrates the use of twin 'first's in filters to pull out just one 002=1|LABEL section of a larger file. Pick is used to choose the sections of the win.ini 003=1|LABEL file to be displayed. 004=1|GET pick:[sorted] ... 005=1|...from c:\windows\win.ini ... 006=1|...options [='['@1] 007=1|LABEL Here we are getting the INI file into %Default|TempFile% and appending a "[]" in 008=1|LABEL case the request is for the very last set. 009=1|GET c:\windows\win.ini 010=1|GET text:"[]" ... 011=1|...options P 012=1|FOREACH value:%pick% 013=5|LABEL Note that in this next PUT, the second filter operates on the result of the first 014=5|LABEL This says: "All lines after but not including your choice" and, of that, up to BUT NOT 015=5|LABEL INCLUDING the next occurrance of '[' in column 1 016=5|PUT msg: %i% ... 017=5|...options [-first'%i%'+@1] and [-first'['-@1] 018=1|NEXT 019=1| 020=1|VARIABLES: %%day%%=_''_Mon_''_ %%date%%=_''_06/02/1997_''_ %%time%%=_''_13:51_''_ %%i%%=_''_[embedding]_''_ [LST-Advanced IF and default GET/PUT--Interactive Update] 001=1|LABEL This example compares two files for equivalence under binary transfer conditions. 002=1|LABEL It illustrates the use of default GET and PUT, as well as the generic protocol 'url:' 003=1|LABEL Caution should be exercized when using default GET and PUT, as you could easily 004=1|LABEL mistake what is in the temporary file. Nonetheless, here is an application for which 005=1|LABEL it is helpful. The idea is to get the file to the local machine and then do the update 006=1|LABEL only if the user desires. It is more efficient to transfer the file just once, and a temp 007=1|LABEL file makes sense here. 008=1|LABEL The use of the generic 'url:' allows us to specify file, ftp, http, etc, in the variables. 009=1|SET filename=quickurl.exe 010=1|SET source=ftp://ftp.stolaf.edu/pub/origami/WIN/%filename% 011=1|SET destination=file:///%Default|AppPath%\%filename% 012=1|IF !updated! and ... 013=1|...`GET url:%destination% ... 014=1|...OPTIONS R B ` ... 015=1|...and ... 016=1|...`GET url:%source% ... 017=1|...OPTIONS U B` 018=5|LABEL Note that IF evaluations are carried out from left to right when no ( ) are present. 019=5|LABEL (Parentheses are carried out first, left to right). In the case of AND, if 0 is encountered, 020=5|LABEL no further processing takes place. Thus, we check the destination first. If it 021=5|LABEL is not found or a transfer error occurs, then the source file is never checked. 022=5|LABEL Notice, too, that the source is checked second. This ensures that the new data are 023=5|LABEL in %Default|TempFile% 024=5|IF `msgbox yes/no:These files are not the same. Do you want to update %destination%?`='yes' 025=9|PUT %destination% ... 026=9|...OPTIONS R B 027=5|ENDIF 028=1|ELSEIF error: 029=5|MSGBOX ok: There was an error 030=1|ELSE 031=5|MSGBOX ok:They are the same 032=1|ENDIF 033=1| 034=1|VARIABLES: %%day%%=_''_Mon_''_ %%date%%=_''_1124_''_ %%time%%=_''_1033_''_ [LST-DO/LOOP, gopher://, Filters, and IF--MSP Weather Update] 001=1|LABEL In this example, a gopher server is queried, and the result is 002=1|LABEL appended to the file C:\temp\datamsp ONLY if new data are present 003=1|LABEL Note that the new data are first put into variable MSPinfo and checked 004=1|LABEL against the previously filed data prior to APPENDING to the full dataset. 005=1|DO 006=5|GET variable:MSPinfo ... 007=5|...FROM gopher://wx.atmos.uiuc.edu:70/00/States%20and%20Provinces/Minnesota%2C%20US/Surface%20Summary%20%28with%20exact%20times%29 ... 008=5|...OPTIONS A R [<>" "@40] and [last"MSP"@1] as ["%date% For $1 at $2 GMT: Temp $3 ($6 oC), DewPt $4, BarPres $5\n",1.3,5.4,21.2,25.2,45.5,$'`($3-32)*5/9`.'|-'.'-] 009=5|IF error: 010=9|MSGBOX ok:Gopher command didn't work. 011=9|PAUSE 012=5|ENDIF 013=5|PUT variable:MSPinfo ... 014=5|...TO file:///c:\temp\*.*{dataall} ... 015=5|...OPTIONS U 016=5|IF updated: 017=9|BEEP 018=9|GET msg: ... 019=9|...FROM file:///c:\temp\dataall 020=9|GET file:///c:\temp\*.*{datamsp} ... 021=9|...FROM file:///c:\temp\dataall ... 022=9|...OPTIONS L P 023=5|ENDIF 024=1|LOOP minutes:10 025=1| 026=1|VARIABLES: %%day%%=_''_Tue_''_ %%date%%=_''_1202_''_ %%time%%=_''_1513_''_ 027=1|PASSWORDS: ftp:whoareyou@bob.chem.stolaf.edu_''_*llSG;%%error% 016=9|IF `msgbox yes/no: The source file does not exist. Do you want to get this file?`='yes' 017=13|PUT url:%source% ... 018=13|...To url:%destination% ... 019=13|...OPTIONS R B 020=9|ENDIF 021=5|ELSE 022=9|MSGBOX ok: %error% 023=5|ENDIF 024=1|ELSE 025=5|IF `msgbox yes/no:These files were not the same. Do you want to update %destination%?`='yes' 026=9|PUT url:%source% ... 027=9|...To url:%destination% ... 028=9|...OPTIONS R B 029=5|ENDIF 030=1|ENDIF 031=1| 032=1|VARIABLES: %%day%%=_''_Tue_''_ %%date%%=_''_1202_''_ %%time%%=_''_1534_''_ %%filename%%=_''_iconmovr.exe_''_ %%source%%=_''_ftp://ftp.stolaf.edu/pub/origami/WIN/iconmovr.exe_''_ %%destination%%=_''_file:///D:\VB\__MINE\QUICKURL\iconmovr.exe_''_ [LST-_Samples] 001=1|LABEL Sample FTP transfer to local file: 002=1|GET file:///%default|AppPath%\tempfile ... 003=1|...FROM ftp://ftp.stolaf.edu/pub/origami/WIN/00index.txt 004=1|LABEL Sample HTTP transfer to log window: 005=1|GET log: ... 006=1|...FROM http://www.stolaf.edu/people/hansonr/index.html 007=1|LABEL Same thing using PUT (your preference) 008=1|PUT http://www.stolaf.edu/people/hansonr/index.html ... 009=1|...TO log: 010=1|LABEL Sample DIRECTORY listing of FTP site (defaults to LOG:) 011=1|DIR ftp://ftp.stolaf.edu/pub/origami/WIN/ 012=1|LABEL Sample DIRECTORY listing of HTTP site 013=1|DIR http://www.stolaf.edu/people/hansonr/xydata ... 014=1|...TO msg: 015=1|LABEL Sample listing of HTTP HREFs 016=1|DIR http://www.stolaf.edu/people/hansonr/index.html ... 017=1|...TO msg: 018=1|LABEL Sample pick from HTTP using filters: 019=1|GET pick: ... 020=1|...FROM http://www.stolaf.edu/people/hansonr/index.html ... 021=1|...OPTIONS [''s. 005=1|GET msg: Example 1 ... 006=1|...FROM text:This is a test\nof the emergency\nbroadcasting system ... 007=1|...OPTIONS A [+] as ["$0 ",('t'='S')]\this is OK-simple substitution removing line break. 008=1|GET msg: Example 2 ... 009=1|...FROM text:This truly is a good test\nof program capabilities\n ... 010=1|...OPTIONS A [+] as ["$1\n",(-' ':-last' ')]\just the words in the middle 011=1|GET msg: Example 3 (before) ... 012=1|...FROM text:Here is a \n\n and and both on the same line, \nspread out over several lines ... 013=1|...OPTIONS A 014=1|GET msg: Example 3 (after) ... 015=1|...FROM text:Here is a \n\n and and \nNow all hrefs are isolated on single lines! ... 016=1|...OPTIONS A [+] as ["$0 ",(''='\n')]\reformatting lines based on contents 017=1|LABEL In this last example, Every occurance of 't' is replaced by '$2' because $2 has not been defined yet! 018=1|GET msg: "Don't Put $s which haven't been defined yet in the '=' phrase!" ... 019=1|...FROM text:This is a test\nof the emergency\nbroadcasting system ... 020=1|...OPTIONS A [+] as ["$0\n",('t'='$2')]\this is crazy! 021=1| 022=1|VARIABLES: %%day%%=_''_Fri_''_ %%date%%=_''_0130_''_ %%time%%=_''_2149_''_