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

Re: [Clip] Re: Convert strong with first and last name into two strings

Expand Messages
  • Phil
    Eb, thanks for the suggestions. The first suggestion doesn t work, or, I should say, doesn t accomplish what I want to accomplish. I had a wizard with separate
    Message 1 of 5 , Jun 10, 2013
    • 0 Attachment
      Eb, thanks for the suggestions.

      The first suggestion doesn't work, or, I should say, doesn't accomplish what I want to accomplish. I had a wizard with separate fields for first and last names. I was getting tired of copying the first name, then pasting and copying the last name, then pasting.

      I wanted to copy and paste the full name, then parse it out.

      Your second suggestion looks like it fits the bill, and is less awkward than my approach. I will try it. I also see you set it to handle a middle initial if present, ignore otherwise. I need to concatenate the middle initial to the first name, but bet I can figure that out.



      ________________________________
      From: Eb <ebbtidalflats@...>
      To: ntb-clips@yahoogroups.com
      Sent: Monday, June 10, 2013 9:58 AM
      Subject: [Clip] Re: Convert strong with first and last name into two strings



       
      Phil,

      I know you figured it out, but...

      There are better ways to separate multi-word wizard entries.

      1. Possibly the best way, a two wizard assignment:
      ^!Set %first%=^?{Enter first name}; %last%=^?{enter last name}

      2. If you don't like multi-part wizards, an easy way to separate space-delimited strings is to use a space-delimited array:

      ^!SetListDelimiter ^%space%
      ^!SetArray %nameparts%=^?{Enter name}
      ^!Set %first%=^%nameparts1%
      ^!Set %last%=^%nameparts^%nameparts0%%
      ^!If ^%nameparts0%<>3 SKIP
      ^!Set %mi%=^%nameparts2%
      ^!SetListDelimiter ;

      Note: the last line is needed only if you make other array assingments following the above code. Match the delimiter to your needs.

      Cheers,

      Eb

      --- In ntb-clips@yahoogroups.com, "Stephen" <freetochoose@...> wrote:
      > ...
      > accept input of a name, e.g. John Altavilla and convert it into two variable Last and first.
      > ...
      > ^$StrPos("SubStr";"Str";CaseSensitive)$
      > ...
      > ^$StrCopy("Str";Index;Amount)$
      >
      > to pull out the first name, and again to pull the last name.
      >




      [Non-text portions of this message have been removed]
    • Eb
      Hmm, Did you mean, that you are copying and pasting text manually? Anyway, variables concatenate easily in noteTab: ^!Set %x%=^%y% ^%z% ^!Set %x%=^%y%^%z% By
      Message 2 of 5 , Jun 10, 2013
      • 0 Attachment
        Hmm,

        Did you mean, that you are copying and pasting text manually?

        Anyway, variables concatenate easily in noteTab:

        ^!Set %x%=^%y% ^%z%
        ^!Set %x%=^%y%^%z%

        By the way, not pertaining to your problem, but generally very useful - the way NT parses lines makes it easy to swap array elements:

        ^!SetArray %x%=One;Two;Three
        ;SWAP elements:
        ^!SetArray %x%=^%x2%;^%x1%
        ^!Info ^%x%


        Revisiting suggestion 1:

        ^!Set %first%=^?{Enter first name}; %last%=^?{enter last name}
        ^!Set %fullname%=^%first% ^%last%

        Revisit 2nd sugg:

        ^!SetListDelimiter ^%space%
        ^!SetArray %nameparts%=^?{Enter name}
        ^!Set %first%=^%nameparts1%
        ^!Set %last%=^%nameparts^%nameparts0%%
        ;------------------------_VV
        ^!If ^%nameparts0%<>3 SKIP_2
        ^!Set %mi%=^%nameparts2%
        ;added line, concat first and mi:
        ^!Set %first%=^%first% ^%mi%
        ;a side effect (benefit) of space-delimited arrays:
        ^!Info [L]Full name:^%tab%^%nameparts%
        ^!SetListDelimiter ;

        Cheers,


        Eb

        --- In ntb-clips@yahoogroups.com, Phil <freetochoose@...> wrote:
        > ... I was getting tired of copying the first name,
        > then pasting and copying the last name, then pasting.
      Your message has been successfully submitted and would be delivered to recipients shortly.