Announcement

Collapse
No announcement yet.

HOW TO RUN BATCH FILE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HOW TO RUN BATCH FILE

    hi

    if im in DOS PROMPT and i did write this command

    c:\type con>com2 <enter>
    !#1 hello how are you <enter>
    !#2 welcome <enter>
    <ctrl C> ---this will end the statement

    WHAT I DID IS CREATING BATCH FILE 'PORT.BAT'
    THE STATEMENT IN THE BATCH FILE IS :

    TYPE CON<COM2
    !#1 hello how are you
    !#2 welcome

    AND I DID CREATE ONE PB PROGRAM

    SHELL "PORT.BAT"

    BUT ONCE I RUN IT , IT IS STOP AFTER THE FIRST LINE
    ----> TYPE CON<COM2
    AND THE CURSOR STAND ON THE SECOND LINE WAITING FORM ME TO WRITE THE DATA

    IS THERE ANY WAY TO PASS THE SECOND AND THIRD LINES AS PARAMETERS


    I NEED ONE PB PROGRAM TO RUN THESE STATEMENTS


    ------------------
    Nidal
    Nidal

  • #2
    This seems like a very unusual way to simply send two lines of data through the COM port, when you can do the same thing from within a PowerBASIC application without any of the drama involved in STDIN redirection, error trapping, etc. For example:
    Code:
    $ERROR ALL ON
    ON ERROR RESUME NEXT
    OPEN "COM2:9600,N,8,1" FOR OUTPUT AS #1
    IF ISFALSE ERR THEN 
      PRINT #1, "!#1 hello how are you"
      PRINT #1, "!#2 welcome"
      CLOSE #1
    END IF
    I hope this helps.

    PS: Please avoiding using captials/uppercase in your messages, as it is often perceived as SHOUTING, and may even be offensive to some some folks. Thanks!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      PS: Please avoiding using captials/uppercase in your messages, as it is often perceived as SHOUTING, and may even be offensive to some some folks. Thanks!
      hi lance


      thank for the code you give to me it is working fine

      but about the captials/uppercase rule this is the first time for me
      that i know about it.

      any way thanks

      ------------------
      Nidal
      Nidal

      Comment


      • #4
        Nidal, the use of caps is all a matter of perception. Caps can
        be also used for emphasis. There is no actual law, that I know
        of, that says you can't.

        Besides if you program a computer to do what you MEANT for it to
        do instead of doing what you TELL it to do, there wouldn't be
        any need for shouting.


        ------------------
        There are no atheists in a fox hole or the morning of a math test.
        If my flag offends you, I'll help you pack.

        Comment


        • #5
          It's common courtesy and standard netiquette practice to avoid using capitals... plus unwarranted shouting is against the law on this BBS!

          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            We....how unwarranted is the shouting? I'm here in the United
            States....there are alot of users around the world.....perhaps
            for them to hear what I am saying I should <U>SHOUT LOUDER</U>

            Then again....I think that just depends on who you are..



            ------------------
            Amos
            mailto:[email protected][email protected]</A>

            [This message has been edited by Amos Vryhof (edited June 06, 2002).]

            Comment


            • #7
              There is no actual law, that I know of, that says you can't.
              RFC 1855 would beg to differ:
              [*]Use mixed case. UPPER CASE LOOKS AS IF YOU'RE SHOUTING.
              If you try to make something idiot-proof, someone will invent a better idiot.

              Comment

              Working...
              X