Read/write individual parameter values from S-Lang.
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 )
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.
chips> require("paramio")
chips> err = pgetd( "dmextract", "sys_err" )
chips> print(err)
0
chips> print(typeof(err))
Double_Type
pgetd() 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 ChIPS/Sherpa session.
chips> vali = pgeti( "dmextract", "verbose" )
chips> vals = pgets( "dmextract", "verbose" )
chips> vald = pgetd( "dmextract", "verbose" )
chips> valstr = pgetstr( "dmextract", "verbose" )
chips> vmessage( "i=%d s=%d d=%f str=%s", vali, vals, vald, valstr )
i=0 s=0 d=0.000000 str=0
chips> typeof(vali)
Integer_Type
chips> typeof(vals)
Short_Type
chips> typeof(vald)
Double_Type
chips> typeof(valstr)
String_Type
Here we get the value of the "verbose" parameter
as an integer, short, double, and string.
- concept
-
parameter
- modules
-
paramio
- paramio
-
paccess,
paramclose,
paramopen,
pget,
plist_names,
pquery,
pset,
punlearn
- tools
-
dmhistory,
dmkeypar,
dmmakepar,
dmreadpar,
paccess,
pdump,
pget,
pline,
plist,
pquery,
pset,
punlearn
|