Need Lasso 8.6.3 Array help

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

Need Lasso 8.6.3 Array help

Stanley Weber
Hi all,

I would like to combine the results of some Action_params into one array parsed by individual words.


For example, I can assemble the action_params into an array such as this if only one word is submitted for each action_param:
     array:  (), (female), (), (baclofen), (), ()

However, if I use 2 words in the action_param, I get:
     array:  (), (female), (), (baclofen diazepam), (), ()

I want the eventual array to be:
     array:  (), (female), (), (baclofen), (diazepam), (), ()

so that the action_param results "baclofen diazepam" are individual items in the resulting array.

Any advice?

Thank you.

Stan

____________________________________________
Stanley S. Weber, Pharm.D., FASHP, BCPP
Chief Assessment Officer
School of Pharmacy
University of Washington
South Campus Center, Suite 244
1601 NE Columbia Road, Box 357631
Seattle, Washington 98195

206.616.8762
 


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Need Lasso 8.6.3 Array help

stevepiercy
Either prevent the user from submitting two words in the input
field or process it by splitting on whitespace.

To do the latter, you need to inspect each element.  There's
several methods, but the easiest to grasp is to initialize a new
array, iterate through each element in the old array, split on
whitespace, then insert the split elements into the new array.

--steve


On 8/3/18 at 9:09 AM, [hidden email] (Stanley Weber) pronounced:

>Hi all,
>
>I would like to combine the results of some Action_params into
>one array parsed by individual words.
>
>For example, I can assemble the action_params into an array
>such as this if only one word is submitted for each action_param:
>array:  (), (female), (), (baclofen), (), ()
>
>However, if I use 2 words in the action_param, I get:
>array:  (), (female), (), (baclofen diazepam), (), ()
>
>I want the eventual array to be:
>array:  (), (female), (), (baclofen), (diazepam), (), ()
>
>so that the action_param results "baclofen diazepam" are
>individual items in the resulting array.
>
>Any advice?
>
>Thank you.
>
>Stan
>
>____________________________________________
>Stanley S. Weber, Pharm.D., FASHP, BCPP
>Chief Assessment Officer
>School of Pharmacy
>University of Washington
>South Campus Center, Suite 244
>1601 NE Columbia Road, Box 357631
>Seattle, Washington 98195
>
>206.616.8762
>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>