🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #35203

Re: [SLRN] Help w/macro please

#35203
From: Bjoern Frantzen
Date: Wed, 16 Jul 1997 00:00
38 lines
1739 bytes
Pardoz <pardoz@io.com> wrote:

>	I'm trying to write a slrn macro using select_list_box to set the
>non_Xbrowser variable - I want to be able to choose between starting up

A very good idea!

>	Unfortunately it doesn't work - it pops up the "Select Browser"
>box fine, but after I pick a response I get this error message: "S-Lang
>Error: picker: Stack Underflow".

You're trying to compare strings the same way you compare integers,
something like this should work;

define picker ()  {
  variable browservbl;
  variable rsp;
  variable status = get_variable_value ("non_Xbrowser");

  rsp = select_list_box ("Select Browser:",
                         "Lynx", "Bookmark", "Download", 3, 2);
  if (strncmp (rsp, "Lynx", 4) == 0)
    browservbl = "lynx2.cmd %s";
  if (strncmp (rsp, "Bookmark", 8) == 0)
    browservbl = "echo %s | geturl.cmd > nul";
  if (strncmp (rsp, "Download", 8) == 0)
    browservbl = "echo %s | downurl.cmd > nul";

  set_string_variable ("non_Xbrowser", browservbl);
  call ("browse_url");
  set_string_variable ("non_Xbrowser", status);
} definekey ("picker", "U", "article");

-- 
      -<  Bj�rn  >- 

Technical Details
Message-ID: <slrn5so9nt.1u.bjoff@bgnett.no>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn5sn34c.8o.pardoz@io.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn5so9nt.1u.bjoff@bgnett.no>
Subject: Re: [SLRN] Help w/macro please
Date: Wed, 16 Jul 1997 00:00:00 +0000
From: bjoff@bgnett.no (Bjoern Frantzen)
References: <slrn5sn34c.8o.pardoz@io.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 257111001
Organization: None whatsoever...
Reply-To: bjoff@bgnett.no
Newsgroups: news.software.readers