| AHELP for CIAO 4.2 | pgets |
Context: paramio |
Synopsis
Read/write individual parameter values from S-Lang.
Syntax
Integer_Type pgetb( paramfile, param ) Short_Type pgets( paramfile, param ) Integer_Type pgeti( paramfile, param ) Float_Type pgetf( paramfile, param ) Double_Type pgetd( paramfile, param ) String_Type pgetstr( paramfile, param ) pputb( paramfile, param, Integer_Type intval ) pputs( paramfile, param, Short_Type shortval ) pputi( paramfile, param, Integer_Type intval ) pputf( paramfile, param, Float_Type floatval ) pputd( paramfile, param, Double_Type doubleval ) pputstr( paramfile, param, String_Type stringval )
Description
These functions provide read and write access to individual parameter values for a tool. Unlike the generic pget() and pset() routines provided by paramio, these functions typecast the variable into the given type.
As with all the paramio routines, the PF_Errno variable is set to 0 on success, or on error it is set to one of the error codes listed in the paramio documentation.
The paramio module is not available by default; to use it in a S-Lang program, it must be loaded using the S-Lang require() function:
require("paramio");Example 1
slsh> require("paramio");
slsh> err = pgetd( "dmextract", "sys_err" );
slsh> print(err);
0
slsh> print(typeof(err));
Double_Typepgetd() is used to return the value of the sys_err parameter of dmextract as a double.
Note that the require("paramio") line only needs to be issued once per Slsh/Sherpa session.
Example 2
slsh> vali = pgeti( "dmextract", "verbose" ); slsh> vals = pgets( "dmextract", "verbose" ); slsh> vald = pgetd( "dmextract", "verbose" ); slsh> valstr = pgetstr( "dmextract", "verbose" ); slsh> vmessage( "i=%d s=%d d=%f str=%s", vali, vals, vald, valstr ); i=0 s=0 d=0.000000 str=0 slsh> typeof(vali); Integer_Type slsh> typeof(vals); Short_Type slsh> typeof(vald); Double_Type slsh> typeof(valstr); String_Type
Here we get the value of the "verbose" parameter as an integer, short, double, and string.
Bugs
See the bugs page for the paramio module on the CIAO website for an up-to-date listing of known bugs.
![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)