Tcl Powered!NeoWebScript

Home
 
Download
User Info
New User FAQ
Tutorials
Demos
Commands
Variables
Troubleshooting
Sysop Info
Sysop FAQ
Theory
Installation
Management
Tests
Troubleshooting
Feedback
Resources
Release Notes
Credits
Disclaimer
IMPORT_SWITCH_ARGS - NeoWebScript
Synopsis * Description

Loads switches from a string into an array.

Synopsis

  • import_switch_args arrayName string ?switchList?

Description

Scan string for a starting series of switches, and ends with a terminating "--" switch or a non-switch. All switches must contain a starting hyphen, followed by one or more alphanumeric characters. Switches are stored as elements in arrayName: the element name is the switch (sans the prefixed hyphen), and the element value is the index of the switch within string. The optional switchList contains a list of switches to filter for; if this variable is set, the command will load switches that are only in the list. The element args is reserved, storing the remain string that are not matched as switches. The element switches is reserved to store a list of the switches in the order they were parsed (from left to right). For example:

   import_switch_args foo "-happy -sad red green blue"
   parray foo
=> foo(args)     = red green blue
=> foo(happy)    = 0
=> foo(sad)      = 1
=> foo(switches) = happy sad

Copyright © 1995-1999 NeoSoft Inc., 1770 St. James Place, Suite 500, Houston, TX 77056 USA. All Rights Reserved