[proFit-list] passing lists to functions

proFit Support profit at quansoft.com
Sun Feb 28 02:59:00 CST 2016


Does the function have to be a pro Fit function? Or do you just need a piece of code that can be called from two different pro Fit programs?

In the former case, have a look at the “Complete Program” example, which is pasted into a the window when you choose Help->Source Examples->Complete Program from the toolbar of a script window (in Python mode). It shows how two programs can share a common global variable. Similarly, they could share a common Python function. The only drawback here is that both programs and the function reside in the same source script.

In the latter case, i.e. if you need that function to be a pro Fit function, you can probably just add a ‘## function’ statement that exports the common function to pro Fit as a pro Fit function — did not try this, though.

An alternative approach would be to pass the data through a pro Fit window. This would, however, be considerably slower than direct communication between two Python scripts.

Best regards

Kurt Sutter
QuantumSoft


> On 26 Feb 2016, at 23:38, Calvert, Andrew <acalvert at usgs.gov> wrote:
> 
> I need to perform calculations on 1D and 2D lists using Python functions and programs.  I can get the calculations to work within a program (build the 2D list from a data window and perform the calculations), however, I would prefer to do the calculations in a function because I would like to access the same function from several programs.  
> 
> I seem to be unable to pass a list as an argument to a proFit function.  I am able to pass single variables, but not lists.  Is this true?
> 
> 
> -- 
> Andrew Calvert (acalvert at usgs.gov <mailto:acalvert at usgs.gov>)
> Volcano Science Center, US Geological Survey
> 345 Middlefield Road, MS-910
> Menlo Park, CA 94025
> ph: 650-329-5276; fax: 650-329-5203
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20160228/fdc5ca08/attachment.html>


More information about the proFit-list mailing list