Function to Select Consecutive Members of a String (FMP4)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Function to Select Consecutive Members of a String (FMP4)

Jeff Tripp
Greetings:

I have a string that looks like "XOXOXXXOXOOOXXX . .
."

I want to:

Set the Field I'm in to the 1st character in the
string, then
Go Next Field
Set the Field I'm in to the 2nd character in the
string, then
Go Next Field
Etc.

There can't be any intervening steps for my purposes,
otherwise the current field is no longer the right one
. . .


TIA

Jeff T
978-546-6232
Reply | Threaded
Open this post in threaded view
|

Re: Function to Select Consecutive Members of a String (FMP4)

Gary (Lists)
"Jeff Tripp" wrote:

> I have a string that looks like "XOXOXXXOXOOOXXX . . ."
>
> I want to:
>
> Set the Field I'm in to the 1st character in the string, then
> Go Next Field
> Set the Field I'm in to the 2nd character in the string, then
> Go Next Field

Use the Text functions:  Left(), Right(), etc.

Field "STR" is "XOXO"

Left("STR",1) --> "X"
--
Gary

p.s. The parameters may be reversed...I didn't open FM 4 to see exactly the
order, Jeff.  But you get the idea.
Reply | Threaded
Open this post in threaded view
|

Re: Function to Select Consecutive Members of a String (FMP4)

Ross Dickson
In reply to this post by Jeff Tripp
Jeff,
Index is a number field

Set Field [Index, 1]
Go to Field [First of your tabbed series of fields]
Loop
   Set Field [ ,Middle(String,Index,1)] -- don't specify field
   Go to Next Field
   Set Field [Index, Index + 1]
   Exit Loop If [Index >= Your limit]
End Loop

Ross

Jeff Tripp wrote:

> I have a string that looks like "XOXOXXXOXOOOXXX . .
> ."
> I want to:
>
> Set the Field I'm in to the 1st character in the
> string, then
> Go Next Field
> Set the Field I'm in to the 2nd character in the
> string, then
> Go Next Field
> Etc.
> There can't be any intervening steps for my purposes,
> otherwise the current field is no longer the right one
> . . .
> Jeff T
Reply | Threaded
Open this post in threaded view
|

Re: Function to Select Consecutive Members of a String (FMP4)

Jeff Tripp
In reply to this post by Jeff Tripp
Ross:

That is tight. Thanks.

Jeff T


--- Ross Dickson <[hidden email]> wrote:

> Jeff,
> Index is a number field
>
> Set Field [Index, 1]
> Go to Field [First of your tabbed series of fields]
> Loop
>    Set Field [ ,Middle(String,Index,1)] -- don't
> specify field
>    Go to Next Field
>    Set Field [Index, Index + 1]
>    Exit Loop If [Index >= Your limit]
> End Loop
>
> Ross
>
> Jeff Tripp wrote:
> > I have a string that looks like "XOXOXXXOXOOOXXX .
> .
> > ."
> > I want to:
> >
> > Set the Field I'm in to the 1st character in the
> > string, then
> > Go Next Field
> > Set the Field I'm in to the 2nd character in the
> > string, then
> > Go Next Field
> > Etc.
> > There can't be any intervening steps for my
> purposes,
> > otherwise the current field is no longer the right
> one
> > . . .
> > Jeff T
>