[EMBOSS] How to use toggle properly ?

Guy Bottu gbottu at vub.ac.be
Thu Apr 24 15:33:53 UTC 2008


Peter Rice wrote:
> Sebastien Moretti wrote:
> 
>>> Just one further point - the user can still change the value of 
>>> symbcons by putting -symbcons=value on the commandline so you need to 
>>> use the -cons toggle (or boolean) value to test whether to use the 
>>> value in your program.
>>
>>>> How can I do this ?
> 
> > Simply test the value of cons in your application, and ignore the value 
> of symbcons if cons if false.

As Peter points out, the
standard: "$(cons)"
in the ACD is only for preventing the program to prompt for symbcons when run 
interactively in a text terminal or presenting the symbcons box in a GUI 
(provided that the GUI handles the ACD correctly). But the program can still 
obtain a value for probcons. So, inside the C code of the program we need :

if (ajAcdGetBool("cons") {
   myconsensussymbolstring = ajAcdGetString("symbcons");
   HERE SOME CODE THAT COMPUTES THE CONSENSUS
} else {
   OPTIONALLY SOMETHING TO DO IF YOU DO NOT WANT A CONSENSUS
}

if you use a toggle instead of a boolean it would be ajAcdGetToggle

	Guy Bottu



More information about the EMBOSS mailing list