Wednesday, 15 April 2015

c++ - How can I make a Stata plugin not depend on the order of variables? -


I am writing a plugin for Stata in C ++, and it seems to me that the variable Depending on the sequence of the form, in the form of SF_vdata () , only variables takes integer arguments in the index.

At this time I have the best solution, first store macro with all variable names, and then call your plugin. My plugin can then search the macro of that variable, which she is interested in, and the index takes the base in its position in the list.

This works, but I would like that my plugin is not dependent on the fixed state, the commands are being run first. I know this is silly because the plug-in is required to format the dataset in a specific way, but something seems wrong about calling ds and calling to my plugin Archives the macro before doing it.

Is there no way to access the order of variable names from inside the plug-in if ds is not called first?

I agree with Nick Unfortunately your macro solution is the only answer, and that's what I do . You can only access data using the SF_Data functions directly as "matrix", and all you get by default, there is no header in the table. I use macros to save all data information and pass all the datasets, I'm just reading variables like you, just like you, and have written the translators to maintain the format settings, but so far Value labels are not used.

No comments:

Post a Comment