Array assistance

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

Array assistance

Patrick Larkin-2
Hello -

Lasso 8.6 question.

I've used arrays to store a set of email addresses and then use that array to send out a mailing.

I'd like to also store the person's name in that array so after the email is sent, I can output a list of names along with their email addresses for the sender.

Right now, I do something like

--------
var:'email_addresses' = (Array);

inline(
        -database='myEmail',
        -table='info',
        -ReturnField='email_address',
        -findall)
       
        $email_addresses->(Insert:(field:'email_address'));

/inline;
-------

Then I can use $email_address to create a recipient list and finally to print a list to screen of the addresses for the sender.  

The person who uses this requested that I include the first and last name of the recipient along with the email addresses.  

I'm looking at the chapter in the manual on Arrays and am not sure where to go.  A map?  I see reference to paired values.  That's what I need I think.  But to send the email, I need just the email address but to print out the report, I need names and email.  I'm not sure how to manipulate the array in the most efficient manner.  

I wrote this a long time ago and I don't use arrays often.  

       


Patrick Larkin
Developer/Administrator of Special Systems / Webmaster
Bethlehem Area School District




#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Array assistance

stevepiercy
On 1/30/13 at 4:17 PM, [hidden email] (Patrick Larkin) pronounced:

> Hello -
>
> Lasso 8.6 question.
>
> I've used arrays to store a set of email addresses and then use that array to send
> out a mailing.
>
> I'd like to also store the person's name in that array so after the email is sent,
> I can output a list of names along with their email addresses for the sender.
>
> Right now, I do something like
>
> --------
> var:'email_addresses' = (Array);
>
> inline(
>   -database='myEmail',
>   -table='info',
>   -ReturnField='email_address',
>   -findall)
>  
>   $email_addresses->(Insert:(field:'email_address'));

$email_addresses->insert(array(field('email_address'), field('fname'), field('lname')));

iterate($email_addresses, local('e'));
    #e->get(1) + ' ' + #e->get(2) + ' ' + #e->get(3);
    // or whatevah format you need for output
/iterate;

--steve


> /inline;
> -------
>
> Then I can use $email_address to create a recipient list and finally to print a
> list to screen of the addresses for the sender.  
>
> The person who uses this requested that I include the first and last name of the
> recipient along with the email addresses.  
>
> I'm looking at the chapter in the manual on Arrays and am not sure where to go.  A
> map?  I see reference to paired values.  That's what I need I think.  But to send
> the email, I need just the email address but to print out the report, I need names
> and email.  I'm not sure how to manipulate the array in the most efficient manner.  
>
> I wrote this a long time ago and I don't use arrays often.  
>
>  
>
>
> Patrick Larkin
> Developer/Administrator of Special Systems / Webmaster
> Bethlehem Area School District
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>