Loading ...
Sorry, an error occurred while loading the content.

Pass command line parameters to chipmunk basic?

Expand Messages
  • Justin T Fanning
    Is it posable to pass command line parameters to chipmunk basic? I.E. $ basic mycode.bas dog cat bird You have 3 pets: dog, cat, bird $ Thanks, Justin
    Message 1 of 3 , Jun 11, 2008
    • 0 Attachment
      Is it posable to pass command line parameters to chipmunk basic?

      I.E.

      $ basic mycode.bas dog cat bird
      You have 3 pets: dog, cat, bird
      $

      Thanks,


      Justin
    • Jim DeVona
      On Wed, Jun 11, 2008 at 3:14 PM, Justin T Fanning ... Yes, at least with the Mac OS X version. The string argv$ contains the command line arguments. If you
      Message 2 of 3 , Jun 11, 2008
      • 0 Attachment
        On Wed, Jun 11, 2008 at 3:14 PM, Justin T Fanning
        <Justin@...> wrote:

        > Is it posable to pass command line parameters to chipmunk basic?

        Yes, at least with the Mac OS X version. The string argv$ contains the
        command line arguments.

        If you scroll to near the bottom of http://anoved.net/cbas.html,
        you'll see a more detailed example I wrote up a few years ago.

        Jim

        > I.E.
        >
        > $ basic mycode.bas dog cat bird
        > You have 3 pets: dog, cat, bird
        > $
        >
        > Thanks,
        >
        > Justin
      • Justin T Fanning
        Hi Jim, Thank you so much, I m a heavy OSX user, but this particular code is running on CentOS Linux (Redhat). Your tip worked perfectly and I never knew of
        Message 3 of 3 , Jun 11, 2008
        • 0 Attachment
          Hi Jim,

          Thank you so much, I'm a heavy OSX user, but this particular code is
          running on CentOS Linux (Redhat).

          Your tip worked perfectly and I never knew of the field command, thats
          a good find also.

          Test code:

          fields = len(field$(argv$,-1))
          print "There are " + str$(fields-2) + " fields"
          for a = 3 to fields
          print a-2,(field$(argv$,a))
          next a
          exit

          Test run:

          $ basic test.bas 123 456 789
          There are 3 fields
          1 123
          2 456
          3 789
          $

          Thanks very very much!


          Justin

          ---

          On 11 Jun 2008, at 20:46, Jim DeVona wrote:

          > On Wed, Jun 11, 2008 at 3:14 PM, Justin T Fanning
          > <Justin@...> wrote:
          >
          > > Is it posable to pass command line parameters to chipmunk basic?
          >
          > Yes, at least with the Mac OS X version. The string argv$ contains the
          > command line arguments.
          >
          > If you scroll to near the bottom of http://anoved.net/cbas.html,
          > you'll see a more detailed example I wrote up a few years ago.
          >
          > Jim
          >
          > > I.E.
          > >
          > > $ basic mycode.bas dog cat bird
          > > You have 3 pets: dog, cat, bird
          > > $
          > >
          > > Thanks,
          > >
          > > Justin
          >
          >



          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.