1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question about @FIELDS

Discussion in 'Support' started by vefatica, Apr 15, 2009.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Of @FIELDS the docs say "If string is double quoted, you must specify sep_list."

    But what would be the point of double quoting string? When it's double quoted, %FIELDS seems to always count it as **1** field:

    Code:
    v:\> echo %@words[".",".a.b.c."]
    1
    
    v:\> echo %@words[" "," a b c "]
    1
    Is that WAD?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    I misspoke/mis-tested. But it's the same with @FIELDS:

    Code:
    v:\> echo %@fields[" "," a b c "]
    1
    
    v:\> echo %@fields[".",".a.b.c."]
    1
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    vefatica wrote:

    Yes. Why are you (pointlessly) double quoting the string?

    Rex Conn
    JP Software
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Wed, 15 Apr 2009 20:38:59 -0500, rconn <> wrote:

    |vefatica wrote:
    |
    |
    |---Quote---
    |> Of @FIELDS the docs say "If *string*is double quoted, you must specify *sep_list*."
    |>
    |> But what would be the point of double quoting *string?* When it's double quoted, %FIELDS seems to always count it as **1** field:
    |>
    |>
    |> Code:
    |> ---------
    |> v:\> echo %@words[".",".a.b.c."]
    |> 1
    |>
    |> v:\> echo %@words[" "," a b c "]
    |> 1
    |> ---------
    |> Is that WAD?
    |---End Quote---
    |Yes. Why are you (pointlessly) double quoting the string?

    I should have been using @FIELD above (it behaves the same). I quoted the
    string to try to preserve leading separators. How do I preserve leading
    space-separators with @FIELDS? Why did you pointlessly say "If *string*is
    double quoted, you must specify *sep_list*."? (Actually I know the answer to
    that one.)
    --
    - Vince
     

Share This Page