option base

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bob engler

    option base

    I am doing a "Fields = split(buf, " ") but I want the first field found
    to go into Fields(1) not Fields(0). I have declared "Option Base 1" at
    the start of my subroutine.

    Any ideas or help?

    Thanks


  • Larry Serflaten

    #2
    Re: option base

    "bob engler" <engler@0sand 1s-software.com> wrote[color=blue]
    > I am doing a "Fields = split(buf, " ") but I want the first field found
    > to go into Fields(1) not Fields(0). I have declared "Option Base 1" at
    > the start of my subroutine.
    >
    > Any ideas or help?[/color]


    How about adding a space to the front of the string?

    Fields = Split(" " & Buf, " ")


    LFS




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

    Comment

    • Rick Rothstein

      #3
      Re: option base

      > I am doing a "Fields = split(buf, " ") but I want the first field found[color=blue]
      > to go into Fields(1) not Fields(0). I have declared "Option Base 1" at
      > the start of my subroutine.
      >
      > Any ideas or help?[/color]

      Split always starts from element zero. The only way I can see to do what you
      want is this (if you are using a dynamic array, declare its lower bound as
      zero)...

      Fields = Split(" " & bug, " ")

      and then simply ignore element zero.

      Rick - MVP


      Comment

      Working...