Archive of UserLand's first discussion group, started October 5, 1998.

[solution]Re: A question about searchArgs

Author:Mike Murry
Posted:9/28/1999; 11:14:45 AM
Topic:A question about searchArgs
Msg #:11546 (In response to 10348)
Prev/Next:11545 / 11547

Last month I posted a question on parsing searchArgs. My solution was the following:

webserver.parseArgs(adrPageTable^.searchArgs,@scratchpad.argTable)
local (projectnum = @scratchpad.argtable.project)
local (issuenum = @scratchpad.argtable.issue)
delete (@scratchpad.argtable.project)
delete (@scratchpad.argtable.issue)

The downside to this solution was that if the script died before it got to the delete statements, scratchpad.argtable.xxx was changing from strings to lists, which caused other scripts using this table to not work.

Thomas Creedon was kind enough to offer me this solution

local (argTable)
webserver.parseArgs (adrPageTable^.searchArgs, @argTable)

but I couldn't get this to work. I didn't have the time to explore it further, so I just used my original, imperfect solution. I had a chance to revisit it this morning, and after carefully going over the docserver page on webserver.parseArgs(), I figured out my problem. I'm posting this here in case anyone else needs this info. Thomas' solution was almost right. Since the second argument to webserver.parseArgs() needs to be a table, all you need to do is add

new (tabletype, @argTable)

and Thomas' solution works perfect. The final script sample should then look like this:

local (argTable)
new (tabletype, @argTable)
webserver.parseArgs (adrPageTable^.searchArgs, @argTable)

If I'm the only one who didn't get this, I'm sorry for wasting the space. Otherwise, I hope this helps someone out.




This page was archived on 6/13/2001; 4:52:51 PM.

© Copyright 1998-2001 UserLand Software, Inc.