{"id":306,"date":"2026-01-05T01:12:07","date_gmt":"2026-01-04T17:12:07","guid":{"rendered":"https:\/\/aliens.ph\/blog\/?p=306"},"modified":"2026-01-05T01:12:07","modified_gmt":"2026-01-04T17:12:07","slug":"making-listplus-switchable-in-wwiv-part-3","status":"publish","type":"post","link":"https:\/\/aliens.ph\/blog\/2026\/01\/05\/making-listplus-switchable-in-wwiv-part-3\/","title":{"rendered":"Making ListPlus switchable in WWIV part 3"},"content":{"rendered":"\n<p>In a previous post, I modified the Main Defaults screen to display the ListPlus Enabled switch status. This status simply reads the variable <strong>lp_options<\/strong> and shows whether the <strong>cfl_enable<\/strong> bit is on or off, which we had defined in an earlier post. I&#8217;ll write about what I did to give the WWIV BBS user the ability to toggle that bit.<\/p>\n\n\n\n<p>Since I want ListPlus to be available to users who have ANSI enabled, it makes sense to make the toggle as well as the switch visible to users who have <strong>okansi()<\/strong> = True.  In <strong>defaults()<\/strong>, a section of code adds keys that the BBS tests for input. I simply add <strong>L<\/strong> to our allowable keys.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    737     bout.outstr(\"|#9Defaults: \");\n    738     std::string allowable = \"Q?1234567BCDIKMNTUW\";\n    739     if (okansi()) {\n    740       allowable.append(\"89AS\");\n    741       if (a()->fullscreen_read_prompt()) {\n    742         allowable.push_back('G');\n    743       }\n    744     }\n    745     switch (const auto ch = onek(allowable, true); ch) {<\/code><\/pre>\n\n\n\n<p>I modify line 740 to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    740       allowable.append(\"89ALS\");<\/code><\/pre>\n\n\n\n<p>This makes the <strong>onek()<\/strong> function call in line 745, to accept L as input, aside from the other keys in the string <strong>allowable<\/strong>.<\/p>\n\n\n\n<p>Now that onek() will accept <strong>L<\/strong>, I need to define a switch case, to handle what to do if the BBS receives an <strong>L<\/strong>. To make it easier to find the code, I insert the case definition for &#8216;L&#8217; right after that for &#8216;K&#8217;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    802     case 'K':\n    803       wwiv::bbs::menus::ConfigUserMenuSet(\"\");\n    804       need_menu_reload = true;\n    805       break;\n       +    case 'L':\n       +      a()->user()->data.lp_options ^= cfl_enable;\n       +      break;\n    806     case 'M':\n    807       a()->user()->toggle_flag(User::noMsgs);\n    808       break;\n<\/code><\/pre>\n\n\n\n<p>I used XOR assignment to toggle the cfl_enable bit of lp_options of the user. If it is currently on, XOR will set it off. If it is currently off, XOR will set it on.<\/p>\n\n\n\n<p>That&#8217;s it. I&#8217;ve made the user&#8217;s cfl_enable bit (ListPlus) toggleable from the Main Defaults menu of WWIV.<\/p>\n\n\n\n<p>Next time, I&#8217;ll describe the rest of the code modifications needed to make the switch actually turn ListPlus on or off in WWIV.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post, I modified the Main Defaults screen to display the ListPlus Enabled switch status. This status simply reads the variable lp_options and shows whether the cfl_enable bit is on or off, which we had defined in an earlier post. I&#8217;ll write about what I did to give the WWIV BBS user the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[6,86,7],"tags":[87,5,2],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-bbs","category-retrocomputing","category-wwiv","tag-bbs","tag-retrocomputing","tag-wwiv"],"_links":{"self":[{"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":1,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/posts\/306\/revisions\/307"}],"wp:attachment":[{"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aliens.ph\/blog\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}