Plugin arguments question
In a plugin procedure, how can I know or detect the many of arguments inputed by the user?
Archive: Plugin arguments question
Plugin arguments question
In a plugin procedure, how can I know or detect the many of arguments inputed by the user?
popstring until it returns something other than 0
I though that I will be something in:
(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
ooops (from NSIS\Contrib\ExDLL\exdll.c):
you should empty the stack of your parameters, and ONLY your
parameters.
so i guess its not so smart to popstring like that.
the way the system plugin does it(i think, was to lazy to check) is to have all parameters in one string and then it parses that string
The Banner plugin uses popstring I think...
-Stu
Originally posted by Lobo Lunaryes, i think you could parse the variables string
I though that I will be something in:
(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
Originally posted by Afrow UKyes The Banner plugin and alot of other plugins use popstring, but not like this:
The Banner plugin uses popstring I think...
-Stu
I think that it will be a nice idea to have this, with it the developer can stop the execution when isn't enough paramters...
while( popstring(buf)==0 )DoSomething(but); //<--bad, dont do thisBecause buf will be null if you use the function and all the strings poped are destroyed in this case.
int nCounter;
char* buf;
while(popstring(buf)) {
nCounter += 1;
// Do something with the string or you'll lose it...
}
the easy option is to have a known end item such as '--' and only take off values upto then. that's what kichik suggested when i asked way back.
if the plugin has a fixed parameter list then just a fixed number of popstrings is fine, it's variable ones that cause the most problems and other values already on the stack don't help things either. but that's how things are with plugins at the moment.
-daz