Jump to content

This topic is 8086 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a text fierld that has several values all separated by a single space (i.e 2 34 323 4,0 34 432)

I need a script to get each value into either a series of individual fields or different segments of a repeating field. But I just am running blank

Any help would really appreciated.

John

Posted

The same approach either for series of fields or single repeated field:

Crete an layout with only target fields(or single repeated field)

Leave default tab order (or create custom one, but include all target fields on it)

Create also an global number field gCounter

Now the script

Set Error Capture [On]

Allow User Abort [on] //swich to off when tested

Set Field[gCounter, WordCount(yourTextFieldHere)]

If [gCounter]

Go To Field [first]

Loop

Insert Calculated Result[MiddleWords(yourTextFieldHere,WordCount(yourTextFieldHere)-gCounter+1,1)]

Go to Field [next]

Set Field [gCouner, gCounter-1]

exit loop if [gCounter=0]

end loop

Dj

end if

Posted

Thanks for the help - looks like it ought to work but...

I am using a repeating field to hold the data but your script only populates the first occurence of the repeating field.

The step Goto Next Field does not take you to the next occurence of the repeating field

Any suggestions - pretty sure ive typed it right

thanks

John

Posted

'Go to next field' uses whatever the current tab order is. It will work as long as the tab order is set correctly. If your repeating field has the repetitions going vertically, and you have other fields in the same horizontal line as the repeating field, you will find that the default tab order (which goes left to right, top to bottom) causes you to jump in and out of the repeating field. Either move the repeating field so that there are no other fields beside it, or set a custom tab order. Or, go to a layout that has only the applicable field on it when you run the script.

This topic is 8086 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.