Quick Question on switch statement and :1, :2 - Protocols

This is a discussion on Quick Question on switch statement and :1, :2 - Protocols ; I am using the following and was wondering if the :1 and :2 are just labels to clarify code. I am guessing that the "if if the return code of the minput statement is a 1, to exit with a ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Quick Question on switch statement and :1, :2

  1. Quick Question on switch statement and :1, :2

    I am using the following and was wondering if the :1 and :2 are just
    labels to clarify code. I am guessing that the "if < \v(input).." says
    if the return code of the minput statement is a 1, to exit with a
    return code of 1, otherwise check continue ?

    If that is true, then I think the :1 and :2 are nothing more than
    labels and have no affect on the script itself ?

    minput 30 "password:"
    if < \v(input) 1 exit 1
    switch \v(minput) {
    :1 echo
    :2 echo

  2. Re: Quick Question on switch statement and :1, :2

    In article ,
    newexpectuser wrote:
    : I am using the following and was wondering if the :1 and :2 are just
    : labels to clarify code. I am guessing that the "if < \v(input).." says
    : if the return code of the minput statement is a 1, to exit with a
    : return code of 1, otherwise check continue ?
    :
    Read the manual or type "help switch" to find out how the SWITCH command
    works. Type "help xxx" to find out how any command xxx works.

    : If that is true, then I think the :1 and :2 are nothing more than
    : labels and have no affect on the script itself ?
    :
    The SWITCH command is explained on page 385 of "Using C-Kermit". You
    can't learn a programming language without a manual.

    - Frank

  3. Re: Quick Question on switch statement and :1, :2

    Frank da Cruz wrote in message news:...
    > In article ,
    > newexpectuser wrote:
    > : I am using the following and was wondering if the :1 and :2 are just
    > : labels to clarify code. I am guessing that the "if < \v(input).." says
    > : if the return code of the minput statement is a 1, to exit with a
    > : return code of 1, otherwise check continue ?
    > :
    > Read the manual or type "help switch" to find out how the SWITCH command
    > works. Type "help xxx" to find out how any command xxx works.
    >
    > : If that is true, then I think the :1 and :2 are nothing more than
    > : labels and have no affect on the script itself ?
    > :
    > The SWITCH command is explained on page 385 of "Using C-Kermit". You
    > can't learn a programming language without a manual.

    First I want to make sure Kermit can fulfill our business needs as
    a simple file transfer protocol running unattended versus other
    communications protocols. It's strength lies in robust commands
    especially the /delete on the send command. Right now I am finding
    it lacking it knowing a file is still in progress of being
    put into a directory and therefore transfering a "partial" file and
    then issuing an error message.

    Once I find out it can do the above, I'll be purchasing the manual
    to support future scripts.
    >
    > - Frank


  4. Re: Quick Question on switch statement and :1, :2

    newexpectuser wrote:
    : First I want to make sure Kermit can fulfill our business needs as
    : a simple file transfer protocol running unattended versus other
    : communications protocols. It's strength lies in robust commands
    : especially the /delete on the send command. Right now I am finding
    : it lacking it knowing a file is still in progress of being
    : put into a directory and therefore transfering a "partial" file and
    : then issuing an error message.

    : Once I find out it can do the above, I'll be purchasing the manual
    : to support future scripts.

    This is like asking whether or not the 'C' programming language can be
    used to develop an operating system by asking someone who does not
    know the 'C' programming language and does not know how to build
    operaing systems. You will not be able to answer the question because
    (a) you do not know the Kermit programming language; and (b) you do
    not understand the requirements of the system you need to create and
    the where the restrictions come from.

    Kermit can absolutely solve your problem in wide variety of ways. Some
    of your problems are caused by fundamental limitations of the FTP protocol.
    Others, such as the visibility of partially transfer files, are limitations
    of the operating system and file system the FTP server is hosted on.

    Frank has been very patient about responding to your queries both to
    the newsgroups and the kermit-support mailing list. He has pointed
    you to both the manual he wrote "Using C-Kermit 2nd Ed." as well as
    the extensive online resources (manual supplements, case studies,
    script library, etc.) I do not believe it is his responsibility to
    write programs for you in order for you to justify buying a single
    copy of a book. Frank (and I) have made clear that Kermit can meet
    the requirements of the problem as you have described it. Frank is
    willing to answer specific questions related to the use of the Kermit
    language and commands when the text of the documentation is not clear.

    If you do not have time to learn the tool, I would suggest you hire
    someone who knows the tool to develop the necessary scripts or assist
    you in architecting the solution such that you can fill in the missing
    pieces.

    --
    Jeffrey Altman * Volunteer Developer Kermit 95 2.1 GUI available now!!!
    The Kermit Project @ Columbia University SSH, Secure Telnet, Secure FTP, HTTP
    http://www.kermit-project.org/ Secured with MIT Kerberos, SRP, and
    kermit-support@columbia.edu OpenSSL.

  5. Re: Quick Question on switch statement and :1, :2

    I appreciate your input.

    However, I have gone through several articles on the website,
    searching through the newsgroups and reviewing case studies and have
    not found anything that addresses the issue I am having.

    If there is online training or even classroom training, I'd find this
    as being beneficial.

    The case study I was pointed to, mentioned ftping a file to a central
    server in a "working" directory where another script running on the
    central server would look for files in a "ready" directory. I can
    understand this concept, as it is obvious you wouldn't want to process
    a file that is still being in transit.

    It goes on to suggest of having the script move the file from the
    working directory to the ready directory, but what if there is a
    partial file there, it would still try to move this partial file and
    try to process it.


    Jeffrey Altman wrote in message news:...
    > newexpectuser wrote:
    > : First I want to make sure Kermit can fulfill our business needs as
    > : a simple file transfer protocol running unattended versus other
    > : communications protocols. It's strength lies in robust commands
    > : especially the /delete on the send command. Right now I am finding
    > : it lacking it knowing a file is still in progress of being
    > : put into a directory and therefore transfering a "partial" file and
    > : then issuing an error message.
    >
    > : Once I find out it can do the above, I'll be purchasing the manual
    > : to support future scripts.
    >
    > This is like asking whether or not the 'C' programming language can be
    > used to develop an operating system by asking someone who does not
    > know the 'C' programming language and does not know how to build
    > operaing systems. You will not be able to answer the question because
    > (a) you do not know the Kermit programming language; and (b) you do
    > not understand the requirements of the system you need to create and
    > the where the restrictions come from.
    >
    > Kermit can absolutely solve your problem in wide variety of ways. Some
    > of your problems are caused by fundamental limitations of the FTP protocol.
    > Others, such as the visibility of partially transfer files, are limitations
    > of the operating system and file system the FTP server is hosted on.
    >
    > Frank has been very patient about responding to your queries both to
    > the newsgroups and the kermit-support mailing list. He has pointed
    > you to both the manual he wrote "Using C-Kermit 2nd Ed." as well as
    > the extensive online resources (manual supplements, case studies,
    > script library, etc.) I do not believe it is his responsibility to
    > write programs for you in order for you to justify buying a single
    > copy of a book. Frank (and I) have made clear that Kermit can meet
    > the requirements of the problem as you have described it. Frank is
    > willing to answer specific questions related to the use of the Kermit
    > language and commands when the text of the documentation is not clear.
    >
    > If you do not have time to learn the tool, I would suggest you hire
    > someone who knows the tool to develop the necessary scripts or assist
    > you in architecting the solution such that you can fill in the missing
    > pieces.


  6. Re: Quick Question on switch statement and :1, :2

    In article ,
    newexpectuser wrote:
    : ... I have gone through several articles on the website,
    : searching through the newsgroups and reviewing case studies and have
    : not found anything that addresses the issue I am having.
    :
    : If there is online training or even classroom training, I'd find this
    : as being beneficial.
    :
    If there was sufficient demand for classroom training, we'd have classes.
    (In fact we did have them from the mid-1980s through the early 1990s but
    then demand slacked off.)

    : The case study I was pointed to, mentioned ftping a file to a central
    : server in a "working" directory where another script running on the
    : central server would look for files in a "ready" directory. I can
    : understand this concept, as it is obvious you wouldn't want to process
    : a file that is still being in transit.
    :
    : It goes on to suggest of having the script move the file from the
    : working directory to the ready directory, but what if there is a
    : partial file there, it would still try to move this partial file and
    : try to process it.
    :
    I answered this in my response to your previous posting. I would like to
    stress that the Kermit command language is just that: a language. If we
    publish a sample script, it is not carved in stone -- it is a sample. You
    are supposed to copy it and then adapt it to do what you want it to do.
    In this case, it already did. But if it didn't, you would just edit it
    with an ordinary text editor, save it, and execute it. If it has bug,
    debug it using any of Kermit's many and varied debugging tools, traces,
    and logs.

    Try things by hand and seen what they do. Use the STATUS command at the
    prompt to see if the previous command succeeded or failed. Use the HELP
    command at the prompt to find out all sorts of things, and to get
    descriptions of commands. For example "help if" and "help exit" would
    have told you why the FTP sample script did not do what you think it did.
    Kermit helps you to help yourself; you don't have to post to the newsgroup
    every time you have a question and then wait a long time for an answer.
    Ask Kermit. Or search the website.

    - Frank

+ Reply to Thread