quick questions

David Mathog mathog at mendel.bio.caltech.edu
Thu Dec 13 16:04:30 UTC 2001


 > >2.  what Ajax call or calls say if a command line switch was or
wasn't
> >present?
> 
> None. Values can be set on the command line, or by dependence on other
> values, or just default.
> 
> Why would you like to know what was on the command line? It could be
tricky
> for GUI interfaces if they deliberately put everything on the command
line,
> default values and all.

Consider an optional integer parameter "foobar" for which 0 is a valid
value and also where if foobar is not specified, it is calculated based
on the input sequences.  That is,
it does not have a fixed default value.  I see no way to distinguish 
because "calculate value" and "use this value" when AjAcdGetInt returns
0.
The workaround would beto set the default in the .acd file to a magic
default value, say -1000000, which is out of range for the desired
variable, and interpret that value
as "not specified".  There are three problems with this approach:

1.  There may be cases for which there are no magic values available.
2.  In w2h the default value shows up filled in on the Web interface. 
So the user sees -1000000 and wonders what the heck that means, or
thinks that -900000 might
also be valid.
3.  It requires that  range checking be disabled or special cased

I guess I'll have a look at the code for AjAcdGetInt and see if it's
possible to
modify that into AjAcdItemExists, returning a boolean T/F for when the
item has been specified.  Then the code would be (more or less like on
GCG)

if(AjAcdItemExists("foobar")){
   ifoobar=AjAcdGetInt("foobar");
}
else {
   ifoobar=calculated_value();
}

Thanks,

David Mathog
mathog at caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech




More information about the EMBOSS mailing list