{"id":36,"date":"2011-03-09T18:06:44","date_gmt":"2011-03-10T00:06:44","guid":{"rendered":"http:\/\/til4code.wordpress.com\/?p=4"},"modified":"2011-03-09T18:06:44","modified_gmt":"2011-03-10T00:06:44","slug":"nsis-section-flag-tests","status":"publish","type":"post","link":"https:\/\/code.angelmarquez.com\/blog\/2011\/03\/09\/nsis-section-flag-tests\/","title":{"rendered":"NSIS Section flag tests"},"content":{"rendered":"<p><span style=\"text-decoration:underline;\"><strong>Today I learned:<\/strong><\/span><\/p>\n<p>[sourcecode language=&#8221;Python&#8221;]<br \/>\nSectionGetFlags ${SEC_AI} \u00a0 \u00a0 \u00a0$0<br \/>\n${If} $0 == ${SF_SELECTED}<br \/>\n[\/sourcecode]<\/p>\n<p>I was using the above code and getting inconsistent behavior. Turns out ${SF_SELECTED} is defined in sections.nsh bitmask style. The statement above ONLY works for a section that is selected and has no other attributes set. A read-only section that is selected, for example, will be set to &#8220;17&#8221; &#8212; 1 (selected) + 16 (readonly). Turns out that LogicLib has a way to make life easier:<\/p>\n<p>[sourcecode language=&#8221;python&#8221;]<br \/>\n${If} ${SectionIsSelected} ${SEC_AI}<br \/>\n[\/sourcecode] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I learned: [sourcecode language=&#8221;Python&#8221;] SectionGetFlags ${SEC_AI} \u00a0 \u00a0 \u00a0$0 ${If} $0 == ${SF_SELECTED} [\/sourcecode] I was using the above code and getting inconsistent behavior. Turns out ${SF_SELECTED} is defined in sections.nsh bitmask style. The statement above ONLY works for a section that is selected and has no other attributes set. A read-only section that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[11,31],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-nsis","tag-logiclib","tag-nsis"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":0,"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/posts\/36\/revisions"}],"wp:attachment":[{"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/media?parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/categories?post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.angelmarquez.com\/blog\/wp-json\/wp\/v2\/tags?post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}