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_KEYVALUE_PAIRS - NeoWebScript
Synopsis * Description

Loads key-value pairs from a string into an array.

Synopsis

  • import_keyvalue_pairs arrayName string

Description

load the key-value pairs from string into array arrayName, as -element string.

Example: import_keyvalue_pairs foo "-action paint -customer fred"

Will set element action of array foo to paint and element customer to fred.

The normal usage would be to get optional key-value pairs as arguments to a proc, as in:

proc sell_item {customer item args} {
import_keyvalue_pairs options $args
.
.
}

This will pull an arbitrary number of optional key-value pairs, read into the args list when the proc began execution (because of the special meaning Tcl attaches to this keyword in argument lists), and store the key-value pairs into the options array.

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