Help with Array

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Help with Array

Post by Nakia » Wed Oct 16, 2013 5:45 am

Hi,

I am trying to send an email with attachments which need to be all files in a specific folder.
I have come up with the below but I can figure out how to get x (the incrementing repeat loop variable) into the tAttachments Array...

Code: Select all

   set the defaultFolder to specialFolderPath("temporary")
   repeat with x =1 to the number of lines of the files
      put URL ("binfile:" & specialFolderPath("temporary")&slash&line x of the files) into tAttachments[x]["data"]
      put "text/xml" into tAttachments[x]["type"]
      set the itemdel to slash
      put item -1 of (specialFolderPath("temporary")&slash&line x of the files) into tAttachments[x]["name"]
      set the itemdel to comma
   end repeat
I have tried for example but the IDE doesn't like it

Code: Select all

put "text/xml" into tAttachments[&x&]["type"]
I am sure it's very simple

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: Help with Array

Post by Nakia » Wed Oct 16, 2013 6:02 am

Hang on, turns out I might have got it right...seems like it's working...

Post Reply