Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] A new config_query

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Andrew \"ruskie\" Levstik" <ruskie AT mages.ath.cx>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: [SM-Discuss] A new config_query
  • Date: Sun, 5 Mar 2006 21:22:49 +0100

I'd like to point out that I've hacked togheter a new config_query
and is available via grimoire functions.

The reason I've did this is to facilitate the selection of multiple
choices in a list which is needed for xorg-server spell to select
various drivers and fonts.

The query is named config_query_checkbox.
It's called the same as config_query_list.

For example:

config_query_checkbox MYTESTVAR "What do you want enabled?" \
nothing everything option1 option2 option3 option4 option5

This would during the cast be shown as:

What do you want enabled?
[0] nothing
[1] everything
[2] option1
[3] option2
[4] option3
[5] option4
[6] option5
Which ones do you want[0]:

Here the user can now select...
Let's say I want option3 and option5

I type in 46 and press enter.

That will select those two options and store them into MYTESTVAR.

The data will be stored as "option3 option5" it then depends on
the guru to provide a mechanism to parse this and act on it.

My suggestion and recommendation is the use of a case statement
or where this can be done a for statement with a few ifs for specifics.

I hope others find this function usefull.

--
Andrew "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru
Geek/Hacker/Tinker

Hacker FAQ: http://www.plethora.net/%7eseebs/faqs/hacker.html

Key id = A7A9E461
Key fingerprint = 757E C16B F5B7 DC27 B003 CCED CF95 3A77 A7A9 E461





Archive powered by MHonArc 2.6.24.

Top of Page