home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 073.lha / Arp / documentation / @chap.1.DOC < prev    next >
Encoding:
Text File  |  1986-11-20  |  12.4 KB  |  529 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.       ARP User's Manual                October    7, 1987
  11.  
  12.  
  13.  
  14.  
  15.  
  16.       Wherein we present some of the truly outstanding features
  17.       of the new ARP programs, attempting to point the way for
  18.       new users of ARP to take immediate advantage of the ARP
  19.       software.
  20.  
  21.  
  22.       1.  _G_e_n_e_r_a_l__F_e_a_t_u_r_e_s__o_f__A_R_P__P_r_o_g_r_a_m_s
  23.  
  24.            Since one of the    goals of ARP is    to make    the Amiga
  25.       easier for you to use, we tried as hard as we    could to
  26.       make it possible for you to install ARP, and continue    to
  27.       use previously written batch files without any change    at
  28.       all.    Additionally, you should be able to use    the ARP
  29.       programs immediately,    without    learning anything more about
  30.       them,    since the degree of compatibility is very high.
  31.       However, ARP programs    are generally enhanced and improved,
  32.       and generally    much easier to use.  To    take advantage of
  33.       these    new features, you have to learn    about them, so read
  34.       on!
  35.  
  36.       1.1  _C_o_n_s_i_s_t_a_n_c_y__o_f__t_h_e__A_R_P__p_r_o_g_r_a_m_s
  37.  
  38.            One of the problems with    the original AmigaDOS
  39.       programs was that they are too inconsistant.    Some
  40.       programs accepted 10 or 20 filenames,    and also allowed you
  41.       to use wildcards to specify files.  Some programs accepted
  42.       multiple files, but didn't allow wild    cards. And some
  43.       programs accepted only one filename.    We have    tried to fix
  44.       this in ARP.    Where it is reasonable to expect to be able
  45.       to supply multiple arguments to a program, we    have
  46.       provided that    capability.  Where it is reasonable to
  47.       expect to be able to use wildcards, we have provided that
  48.       capability also.  We have attempted to make the command
  49.       templates for    programs more consistant as well, allowing
  50.       abbreviations    for commonly used switches and options.
  51.  
  52.            This consistant command interface provides a lot    of
  53.       power.  As a simple example, consider    the problem of
  54.       dumping a lot    of files to your printer for a quick
  55.       reference.  Let's say    you want to send all the files in
  56.       the current directory    which end in ".c" to the printer.
  57.       Due to the ARP command structure, there are no less than
  58.       three    ways to    do this, and all of them use remarkably
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                     - 2    -
  71.  
  72.  
  73.  
  74.       similar command lines:
  75.  
  76.  
  77.           1> Type #?.c to PRT:
  78.           1> Copy #?.c to PRT:
  79.           1> Join #?.c to PRT:
  80.  
  81.  
  82.       Incidentally,    we also    supply a more standard set of
  83.       wildcards, in    addition to the    ones in    use on the Amiga, so
  84.       you could also do
  85.  
  86.  
  87.           1> Type *.c to PRT:
  88.           1> Copy *.c to PRT:
  89.           1> Join *.c to PRT:
  90.  
  91.  
  92.       If you were to try the same thing using the AmigaDOS
  93.       programs, you    would be in for    a rude shock.  First, let's
  94.       try type:
  95.  
  96.  
  97.           1> Type #?.c to PRT:
  98.           Can't    open #?.c
  99.  
  100.  
  101.       It appears that the AmigaDOS type doesn't understand
  102.       wildcards.  Well, let's try Copy:
  103.  
  104.  
  105.           1> Copy #?.c to PRT:
  106.           Destination must be a    directory
  107.  
  108.  
  109.       Cute,    Copy lets you use wildcards, but then you can't    copy
  110.       anything to the printer.  It turns out that the only way
  111.       to send all your files to the    printer    is to specify each
  112.       one in full.    And if you wanted to use the special
  113.       capabilities of Type,    for example, to    add line numbers to
  114.       the files as you print them out, you are reduced to
  115.       multiple Type    commands, since    the AmigaDOS type only
  116.       accepts one argument.     Using the ARP Type, you can supply
  117.       multiple arguments, and each argument    can contain
  118.       wildcards.
  119.  
  120.            The main    point to notice    here is    how ARP    provides you
  121.       with a consistant command environment.  Because the ARP
  122.       programs don't impose    artificial limitations,    each command
  123.       is more powerful and more useful.  And because ARP
  124.       programs strive to be    consistant with    each other, you
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                     - 3    -
  137.  
  138.  
  139.  
  140.       don't    have to    remember silly special cases, and can apply
  141.       what you have    learned    about one program to a new one.     For
  142.       example, having noticed that Copy, Join and Type all allow
  143.       wildcards, you can probably assume that a command like
  144.       Rename does as well, and you would be    correct.  As another
  145.       example of the increased power of ARP, let's say you
  146.       wanted to move the three files memo1,    memo2 and memo3    to a
  147.       directory on the same    disk called OLD_MEMOS.    Using
  148.       AmigaDOS, you    would have to do it this way:
  149.  
  150.  
  151.           1> Rename memo1 OLD_MEMOS
  152.           1> Rename memo2 OLD_MEMOS
  153.           1> Rename memo3 OLD_MEMOS
  154.  
  155.  
  156.       This kind of thing can get old pretty    quickly.  Using    the
  157.       ARP Rename, you would    simply do
  158.  
  159.  
  160.           1> Rename memo? OLD_MEMOS
  161.  
  162.  
  163.       The '?' is of    course a wildcard that matches any single
  164.       character.
  165.  
  166.  
  167.       2.  _C_o_m_m_a_n_d_s__a_n_d__T_e_m_p_l_a_t_e_s
  168.  
  169.            When we spoke to    Amiga users, one of the    things they
  170.       liked    about the current Amiga    programs were the use of
  171.       command templates to specify the arguments to    a program.
  172.       Since    people liked this, and it seemed like a    good idea,
  173.       we kept it in    ARP.  We extended and modified individual
  174.       templates for    commands, and we also have an extended help
  175.       feature. Under AmigaDOS, if you supply a question mark (?)
  176.       as the first argument    to a command, it presents you with
  177.       its command template,    and waits for you to hand it some
  178.       arguments.  The same thing is    true of    ARP programs, but if
  179.       you need even    more information, just type another question
  180.       mark when you    get the    template, like this:
  181.  
  182.  
  183.           1> Type ?
  184.           FROMA,,,,,,,,,,TOK,OPTK: ?
  185.           Type [upto 10    files] To outfile OPT <H(ex) N(umbers)>
  186.           FROMA,,,,,,,,,,TOK,OPTK:
  187.  
  188.  
  189.       The first thing Type gives you when you supply a question
  190.       mark is its command template.     If that is not    enough
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                     - 4    -
  203.  
  204.  
  205.  
  206.       information for you (for example, if you forget what
  207.       options you can pass to type), typing    another    question
  208.       mark after you get the template causes an additional help
  209.       message to be    displayed, and then the    template is
  210.       reprinted, and the command waits again for you to supply
  211.       it with some arguments.  This    allows you to get extra    help
  212.       for commands you don't use often, and    not be bothered    by a
  213.       lot of information for commands that you do use a lot.
  214.  
  215.            Another thing ARP tries hard to do is to    give
  216.       informative error messages.  For example, when you type
  217.       the following    under AmigaDOS:
  218.  
  219.  
  220.           1> Echo "Hello World!
  221.           Bad Args to Echo
  222.  
  223.  
  224.       You get a not    too helpful message.  The same action using
  225.       the ARP echo would cause:
  226.  
  227.  
  228.           1> Echo "Hello World!
  229.           Bad Args: Unmatched quotes
  230.  
  231.  
  232.       ARP attempts to help you identify the    problem, so you    can
  233.       fix it more rapidly.    As under AmigaDOS, you can supply
  234.       arguments to ARP programs using either keywords, or using*
  235.       positions:
  236.  
  237.  
  238.           1> Type infile
  239.           1> Type FROM infile
  240.           1> Type FROM infile TO outfile
  241.           1> Type OPT h    TO outfile FROM    infile
  242.  
  243.  
  244.       All of the above will    work.  In addition, if you make    an
  245.       error:
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.       __________
  253.  
  254.         * The template keywords are    given in upper case only for
  255.           clarity -    you can    use any    case you like.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                     - 5    -
  269.  
  270.  
  271.  
  272.  
  273.           1> Type FROM
  274.           Bad Args: Keyword needs an argument
  275.       or
  276.           1>  Type infile From outfile
  277.           Bad Args: Bad    positional argument
  278.  
  279.  
  280.       the ARP programs once    again attempt to help you diagnose
  281.       the problem. In the first example, you specified a file by
  282.       keyword (the FROM), but left off the filename. (If you
  283.       really wanted    to type    a file by the name of FROM, you    need
  284.       to use double    quotes,    for example, Type "FROM".  ARP
  285.       programs, like AmigaDOS programs, assume that    names inside
  286.       of quotes are    filenames and not template keywords.)  In
  287.       the second case, you gave the    first argument twice, once
  288.       by position, and then    by keyword.  Type doesn't know what
  289.       you mean, since you appeared to have misused a positional
  290.       argument.
  291.  
  292.  
  293.       3.  _E_s_c_a_p_e_s
  294.  
  295.            One source of incompatibility between ARP programs (note)
  296.       and the AmigaDOS programs they are intended to replace is
  297.       that AmigaDOS    programs regard    an asterisk inside of quotes
  298.       as an    'escape' character, one    that has a special meaning.
  299.       Because so many people wanted    support    for the    asterisk as
  300.       a wildcard something had to go, since    the usages would
  301.       conflict - any given program wouldn't    be able    to tell
  302.       whether you meant to use the asterisk    as a wildcard or as
  303.       an escape character.    Since, in addition, the    use of the
  304.       "*" as an escape character was an undocumented feature of
  305.       AmigaDOS, we decided it was worthwhile to sacrifice
  306.       compatibility    on that    score.    So if you are one of those
  307.       people that discovered the "*" usage of AmigaDOS, you
  308.       won't    be able    to use batch files with    that kind of
  309.       character in it without some editing.
  310.  
  311.            ARP supports escapes, in    fact, ARP escapes are much
  312.       more flexible    than AmigaDOS escapes, which the ARP escapes
  313.       include as a subset.    The ARP    escape character* is a
  314.       backslash (\), so the    only editing you should    have to
  315.  
  316.  
  317.       __________
  318.  
  319.         * Actually,    you can    select your own    escape character if
  320.           it matters that much to you, see the ARP Programmers
  321.           Manual for more information.
  322.  
  323.  
  324.  
  325.  
  326.          NOTE - We reverted to using BCPL-compatible * as the
  327.            escape char in V1.0 of arp.library; if you prefer to
  328.            use \, there will be a setup program for V1.1
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                     - 6    -
  335.  
  336.  
  337.  
  338.       perform on your batch    scripts    which use AmigaDOS escapes
  339.       is to    replace    the asterisks (*) with backslashes (\).
  340.  
  341.            ARP recognizes the following characters as special
  342.       'escape' characters:
  343.  
  344.  
  345.           \N      Newline
  346.           \T      Horizontal Tab
  347.           \V      Vertical Tab
  348.           \B      Backspace
  349.           \R      Return
  350.           \F      Formfeed
  351.           \E      Escape (ascii    27)
  352.           \Xnn      Hex number nn
  353.  
  354.  
  355.       ARP programs (like AmigaDOS) programs, will only recognize
  356.       the escape character inside of double    quotes*, so if you
  357.       want to use escapes, you must    also use the double quotes.
  358.       To include a single backslash    inside of quotes, you need
  359.       to use two of    them, like this    "\\".  You can also include
  360.       double quotes    inside of double quotes, by escaping them as
  361.       well,    for example, "\"Inside Quotes\"".  As usual, of
  362.       course, the special escape characters    can be either upper
  363.       or lower case.  If you use hex digits, there can be one or
  364.       two of them, and they    can also be either upper or lower
  365.       case.     Escapes can be    very convenient    to use,    for example,
  366.       to advance your printer paper    to the next sheet, you can
  367.       do:
  368.  
  369.  
  370.           1> Echo >PRT:    "\F"
  371.  
  372.  
  373.       Which    sends a    formfeed to the    printer.  You should
  374.       generally be careful about using escapes in filenames,
  375.       since    this can lead to confusion.  One place escape
  376.       characters might be appropriate is in    Filenotes, for
  377.       example:
  378.  
  379.  
  380.  
  381.  
  382.  
  383.       __________
  384.  
  385.         * An exception to this is Echo, which always escapes its
  386.           arguments.  This is inconsistant,    perhaps, but it
  387.           turns out    to be very convenient.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                     - 7    -
  401.  
  402.  
  403.  
  404.  
  405.       1> Filenote "Filename" "\X9B7mReverse    Print Comment\X9B0m"
  406.  
  407.  
  408.       Which    will cause the filenote    to List    in reverse print
  409.       when you display it, making it stand out more    clearly.
  410.  
  411.  
  412.       4.  _A_R_P__a_n_d__W_i_l_d_c_a_r_d_s
  413.  
  414.            ARP has an extensive set    of wildcards, and most ARP
  415.       programs allow them to be used.  ARP supports    ALL of the
  416.       AmigaDOS set of wildcards, as    well as    the more standard
  417.       Unix*    style of wildcards.  ARP supports the following
  418.       wildcard characters, note that these are valid inside    or
  419.       out of quotes:
  420.  
  421.  
  422.           (a|b|c)      Will match one of a, b or c.
  423.                   These    can be patterns.
  424.  
  425.           ?          Matches any single character
  426.           #<pat>      Pattern repeated 0 or    more times,
  427.                   in particular, #? matches anything.
  428.  
  429.           [char]      A set    of characters, for example,
  430.                   [abc]    or [a..c] specify the same set.
  431.  
  432.           [^char]      Match    everything but this set    of characters.
  433.           *          0 or more occurances of any character.
  434.  
  435.  
  436.       These    can be used in combination, of course, so that
  437.       *.(c|h) or *.[ch] will match any filenames ending in
  438.       either .c or .h preceeded by any number of characters,
  439.       including no characters.
  440.  
  441.            In addition, ARP    allows wildcards to be used at
  442.       multiple levels of a directory hierarchy.  For example, if
  443.       you want to type all the files in all    the directories    of
  444.       your INCLUDE directory, you could use
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.       __________
  452.  
  453.         * Unix is a    trade mark of AT&T.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                     - 8    -
  467.  
  468.  
  469.  
  470.  
  471.           1> Type DF0:Include/*/*
  472.  
  473.  
  474.       Which    will take care of things nicely.  You can be more
  475.       selective, for example only typing files that    start with T
  476.       in directories that start with E:
  477.  
  478.  
  479.           1> Type DF0:Include/E*/T*
  480.  
  481.  
  482.       But the best way to get used to the increased    power of the
  483.       ARP wildcard system is to sit    down and enjoy using it.
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.