|
From: | Thomas L. Scofield |
Subject: | Re: passing parameters to dynamically-linked functions |
Date: | Wed, 6 Aug 2008 08:50:27 -0400 |
What I chose to do was put all the optional parameters in a cell array (do that in the .m file) and pass that along to the dynamically linked file. That's probably unnecessary work, but I got more comfortable with the Octave API in the process. One thing I did not learn how to do is access a 2D cell array from within the dynamically linked function. std::string target = args (0).string_value (); Cell c = args (1).cell_value (); octave_idx_type numswitches = c.length (); octave_idx_type i = 0; while (i < c.nelem ()/2 && target.compare (c.elem(2*i).string_value ())) i++; seems to work fine (I've packed both the option itself, say "Quality", along with its setting, say 75, into the cell array one right after the other), but things did not seem to work when I had them side-by-side in a 2D array. I had some other bugs along the way, so perhaps I ought to try it again. At any rate, I was mainly concerned with whether there was some standard way to pass parameters like these along, and if there was wanted to follow the convention. On Aug 5, 2008, at 11:18 PM, John W. Eaton wrote:
Thomas L. Scofield -------------------------------------------------------- Associate Professor Department of Mathematics and Statistics Calvin College -------------------------------------------------------- |
[Prev in Thread] | Current Thread | [Next in Thread] |