Archive: SectionGetFlags


SectionGetFlags
I will make when a section selected than should run a function but when I use SectionGetFlags, it come out ever "0". I don't understand this. Or is this the wrong command? Then when it out comes 1 how do I check this, with iferror or other command? please help


Maybe a stupid idea, but when a function needs to be executed when a section is selected, why not calling this function from that section then???

-Hendri.


The name of the Section is only "" so is not avaiable for selection. When now one in Subsection is selected than runs the function and it write in a file.


Put the function call wherever you like it to be executed. Maybe you can guess from my answer, that I do not fully understand you. I'll try and construct an example tomorrow.

-Hendri.


The example. Compile and see that section 1 will always be executed even if we deselect all sections. From section 1 (hidden!) we can call the function. So this function will always be executed.

Does this answer your question / solve the problem? If not, please specify exactly what you want to do and when you want a function to be executed or not.

Please remind that (in most cases) we do not need to use SectionGetFlags to determine whether or not to execute functions since sections are only executed when they are selected or required (hidden). I believe that is the answer, if not, please explain why this would not work in your case.

-Hendri.


It is not the right.
A new turn:

I will found out when a section is selectet that must for more than 1 section. All this section are in a Subsection. In the section with name "" call the function. This function check the selection of the section. When the check true than goes a other function (by me, write in a file).


function
- check for selected (more than 1 section)
- when selected than write


functionEnd

So I hope that you understand this.

Thanks that you help me.


You're trying to test something. Some sections should be selected and others not. Or at least one section in a subsec should be selected or at most one or...
Call me stupid but your plans have still not become completely clear to me. I cannot create a script if I do not understand what you want to do. If you have difficulties with the language, try contacting me (PM or e-mail) in German, I know a bit German.
In the meanwhile, check this thread, maybe you can solve it yourself then.

BTW, you could also try setting a user variable when a section has been executed and test it afterwards. E.g.:

function .onInit
StrCpy $0 0
funtionend

section 1
StrCpy $0 1
sectionend

function .onInstSuccess
StrCmp $0 0 Done
; commands if section 1 selected
Done:
functionend

Good luck,
-Hendri.

Thanks, this is the right script. I have think it that you can german a little bit, because in shops in holland can be too.


Shops in Holland? I hope you do not mean CoffeeShops ;)
German is a standard subject on the dutch highschool, but that's long ago for me ;) so my German has become worse than it already was at highschool...

Greetz,
-Hendri.


For the half scripts is this good, but not for the rest.

Because the headline only write when one or more of the section is selected. And then must it over the text. This is in the game better for the viewer.
For example:

"blank" "==========================" ;headline
"blank" "Pistolen" ;headline
"blank" "==========================" ;headline
"+usp" "H&K USP .45 Tactical" ;text
"+glock18" "Glock18 Select Fire" ;text
"+deagle" "Desert Eagle .50AE" ;text
"+p228" "SIG P228" ;text
"+elite" "Dual Beretta 96G Elite" ;text
"+fiveseven" "FN Five-Seven" ;text


OK, my advise: try contacting me in German, since I do not understand what you're saying. Did you read the thread on SectionSetFlags?

-Hendri.


Schubi,

First of all, reread this thread and you will find my link to a post about SectionSetFlags!

Second, I stated "Contact me by PM or e-mail in german". This was explicitely stated this way to avoid "stange" (you know what I mean) languages on the Forum. It's my opinion that everyone should be able to understand the talk to avoid people are insulting eachother while the insulted does not know. I really do not like that.

Third and final, your post was far too long. Attach scripts next time and read the Forum rules!

I copied your post and I will look into your script. I will help you, but please stick a bit to the rules!

No hard feelings, greetz,
-Hendri.


Originally posted by Smile2Me
It's my opinion that everyone should be able to understand the talk...
Obviously this isn't working for Schubi. There are more than one of us that speak german, I think he should be allowed to post in his mother language if he feels that it's necessary. That way, more people may be able to help.

-Scott

Scott,

might be, but I just do not allow for it. Sorry. I already have the experience on another Forum that people start gossips about other people on the Forum in another language so most people (and especially the one the gossips where about) could not understand it. I just want to prevent that, because I do not like that. It's as simple as that. If this is not in the general Forum rules, it should be.

From the Forum rules:
If you find it easier to express yourself en Français, auf Deutsch, en Espanol, in Nederlands, in Italiano, you might want to start out in our Winamp World Domination Forum. You'll find help and pointers in almost every language we can think of.
So allowing Schubi to contact me in his native tongue was a nice offer, is my opinion.

Schubi,

I tested a script with subsections. There is (so far I can see) a bug in NSIS 2.0a0!!! If you uncheck a subsection (so not the sections in that subsection) the flags of those sections and the subsection itself will still be turned on. On the other hand, if you uncheck the sections of a subsection by hand, it does reset the flags. So my advise: use 1.98 and a script as I attached. Be carefull with SectionDividers: they have there own flag!

Good luck,
-Hendri.

BTW, here's the test script I used to try determine how sections and subsections are numbered in NSIS 2.0a0. Test it yourself. I spend some time trying different possibilities and that's when I ran into this bug (what I think is a bug). Try it and maybe you will figure out how sections are numbered. Maybe I'm still sleeping at the moment (8.10 AM :))...

Good luck,
-Hendri.