Subject Re: attachment for mv_mail programm
From Mervyn Bick <invalid@invalid.invalid>
Date Sun, 19 Nov 2023 16:13:04 +0200
Newsgroups dbase.getting-started

On 2023/11/19 09:59, Dirk C wrote:

> hello Mervin,
> thanks for the information, i think stolen is a heavy word, let say
> borrowed.

"Borrowed" means there's a chance that I'd give it back. :-)  The
technique is so useful that I use it whenever a choice has to be made
from a listbox .  There is no way I'll ever give it back to Marc. :-)
Besides, if I had to stop using all the ideas I've gleaned from the
newsgroups over the years I'd have to stop programming.  :-(

> the first way i used was with a entryfield, using an if construction,
> that filled up the entryfield
> because of the programm the set.atachment() only the first file can be
> used as attachament, the other filenames in the entryfield are denied.
> my way of thinking was to give every getfile() an other variable and
> copie it to an other function,but nevertheless your appraoch gives me
> more understanding

Getfile() is fine for selecting one file.  Using it in a loop to fetch
more than one file could be done but the program users will definitely
NOT like it as the dialogue form has to open and close for each file.
As the DIY route I used in the example moves filenames from a
multidimensional array created by DIR() into an array with only one
dimension for display in the listbox it gives one the opportunity to
decide if a filename should be included or not.  For instance, if I
list, say, program files I always exclude the "Backup of ..." files.

A function can only return one "thing" but that can be an array holding
as many elements as you want.

An email program that can only handle one attachment wouldn't be much
use.  I've never used mv_mail but I'm sure it can handle multiple
attachments.  I've not read the documentation (When all else fails, read
the instructions. :-) ) but at a guest multiple calls to the mv_mail's
setattachment() method is probably the way to go.

for n = 1 to aArray.size

> en nogmaals dankie,

Dis my plesier.