Forum OpenACS Development: Invalid switch

Collapse
Posted by Zamil Murji on
Am i doing something wrong?

In my .tcl file I have a line that reads:

set existing_id_l [sdb_qi_project_id_l -threed "0" $qi_project_id]

In a procs file I have the following:

ad_proc -public sdb_qi_project_id_l {
    -threed
    -available:boolean
    -name:boolean
    qi_project_id
} {
}

...
    set threed_sql ""
    if { [exists_and_not_null threed] } {
    if $threed {
        set threed_sql "AND data_type = '3D OUTLINE'"
    } else {
        set threed_sql "AND data_type != '3D OUTLINE'"
    }
    }
...

But if i load my page, I get the following error:
Invalid switch: "-threed"
    while executing
"sdb_qi_project_id_l__arg_parser"
    (procedure "sdb_qi_project_id_l" line 1)
    invoked from within
"sdb_qi_project_id_l -threed "1" $qi_project_id"
    invoked from within
"set existing_id_l [sdb_qi_project_id_l -threed "1" $qi_project_id]"
    ("uplevel" body line 134)
    invoked from within
"uplevel {
          #sdb/www/sdb-mapview.tcl

ad_page_contract {
    Display a map of the selected area
...

What am i doing wrong?

Collapse
2: Re: Invalid switch (response to 1)
Posted by Tom Jackson on

Maybe -threed is supposed to be -thread?

Collapse
3: Re: Invalid switch (response to 1)
Posted by Zamil Murji on
My understanding was that you could name your switch anything you want. Am I wrong?
Collapse
4: Re: Invalid switch (response to 3)
Posted by Jeff Davis on
What gets displayed in the api browser for the proc? It should show the switches it found when parsing the ad_proc declaration.
Collapse
5: Re: Invalid switch (response to 4)
Posted by Zamil Murji on
Thanks everybody for the input.

It turns out that there was an error with one of the procs in my tcl file. After fixing this error, everything below it worked just fine.

Thanks again