AnsweredAssumed Answered

Moving a delimited list from one script to the other

Question asked by Greth on Jan 7, 2016
Latest reply on Jan 11, 2016 by jbrown

I've been looking for a specific solution for a while now, but haven't been able to translate the snippets I found to my exact situation. And It'd be nice to have some feedback on whether or not I'm completely insane for doing it this way in the global sense.


So: I have a working solution, but I'm willing to learn about more efficient ways to do this. I'm slowly realising that - beyond the scope of this question - I'm practically making an SAP system in Filemaker, so some more insight would be wonderful:


I am using FM11 Advanced with a host computer using FM10 regular. I have no opportunity to chance said host or upgrade any time soon (It's complicated).


I have a list of invoice PDF files I've created so I can e-mail them to respective clients.


The PDF names are loaded into a repeating variable: $PDFList[].

I loop through all the invoices that I need to PDF, adding their ID to the respective $PDFList[$i]

Then I create the PDFs looping through $PDFList[].


Sample of the delimited list PDF IDs:









Now, I work at an auction house. This is important because we have two types of client. The Buyers and the Sellers. The whole e-mail procedure needs to happen with both but with 'minor' differences. To the e-mail script this just means a different path to export/import and a different list of PDF IDs. So I want to use the PDF and mail part as a separate script, just handing down a parameter with the Delimited List and one with the origin of the information (Buyers or Sellers).

So I have 'The Buyer script' and 'The Seller script' handing down information to 'The e-mail script'.


For the life of me I haven't been able to get $PDFList[] transfered by parameter. It seems like it's impossible to have a repeating variable parameter?


In any case, I'm now dumping the $PDFList[] into a global field, allowing the next script to simply take it from there. But I can't seem to tell the variable that the text is already delimited by ¶. So I've ended up making a second loop, going through the values in the global field and re-creating $PDFList[] from that information.


Would it be easier to simply use $$PDFlist[] as a global variable? I don't know how this would affect performance. It seems bad form to use it.



So the specific questions:


1. Is it possible to pass the whole delimited list using Parameters in this situation? If so, ... Please just spell it out for me because I'm getting desperate.

2. Am I fine just using a $$GlobalVariable instead?