Pass Local Variables Between Functions? - Is it possible to pass local variables from one function to another? - Messages
When dealing with long, multi-page function definitions, is it possible to break a function in multiple "sub-fuctions" (that will each fit on one page)?
...Is there some way to pass multiple local variables from one function to another?
Thanks!
[albumimg]1586[/albumimg]
WroteWhen dealing with long, multi-page function definitions, is it possible to break a function in multiple "sub-fuctions" (that will each fit on one page)?
...Is there some way to pass multiple local variables from one function to another?
Can't see how to relate your matrix to the the double question: split/pass.
You can do whatever you need whether from source or from work sheet result.
Too vague questions are hard to doctor w/o work sheet.
I am just working with some data table (matrix) calculation and manipulation. And, though simple, the functions / routines that I have come up with are rather long and can extend over the page breaks, which is making portions of them difficult or impossible to see.
My hope was that if I could break the longer function into a few smaller functions, then I could control the page break locations, as well as make the local equations more user-friendly (for checking) by having the local variables (and their values) pass from one embedded function to the next.
But I don't think the local variables will pass between the functions that way. :*(
function3 (x) = function2 (function1 (x))
Off_b = Off_a (names (table1, table2, value)) in the attached worksheet
[albumimg]1587[/albumimg]
piecewise - forum1.sm (72 KiB) downloaded 38 time(s).
At the very end plug the header and insert that bloody col [very easy].
That ease debugging wrt syntax is incorrect.
However anything defined at some point is available at the same level and on deeper levels, thus you can make all more compact/readable by calling one or more functions after defining you data.
Wrote... My hope was that if I could break the longer function into a few smaller functions, then I could control the page break locations, as well as make the local equations more user-friendly (for checking) by having the local variables (and their values) pass from one embedded function to the next.
But I don't think the local variables will pass between the functions that way. :*(....
I believe you can do this, but you have to pass the function and their parameters in seperately. I do this for my Worst Case Analysis tool set I created which you can find here: https://en.smath.com/forum/yaf_postsm47624_Worst-Case-Analysis-Toolset.aspx#post47624
You do have to be careful of how you define the function and it's inputs, but it works. Attached is a simple example as well using pythagorean theorem. File not found.File not found.
WroteI am just working with some data table (matrix) calculation and manipulation. And, though simple, the functions / routines that I have come up with are rather long and can extend over the page breaks, which is making portions of them difficult or impossible to see.
My hope was that if I could break the longer function into a few smaller functions, then I could control the page break locations, as well as make the local equations more user-friendly (for checking) by having the local variables (and their values) pass from one embedded function to the next.
But I don't think the local variables will pass between the functions that way.
I get lost between your request and the work sheet. The way you do, you create
the system you process further. Just process the simple creation. once done,
easy to restore the header and rows "identity". We have the modules from Matrix Treasury. Just finish the maths, post and will do.
Those data you have entered, if they come from simple unique design: fine.
If they come from immense data base, per say from like a National Standard,
some more involved tools are needed, just to be adapted.
What page length have to do in there ? Use separators per piece maths.
Maybe you can use the normal for loop construction.
Maybe otherwise from other modules attached
Utilities Matrix Truth Table [Locate row_col].sm (43 KiB) downloaded 34 time(s).
-
New Posts
-
No New Posts