CImage:KwdGetVal
The KwdGetVal method returns the value of a keyword from the image header. This method works with a keyword of any type, including string, number, date, time, etc. The value returned is a string.
sValue = CImage:KwdGetVal( sKwd ) |
This method returns the value of a keyword of any type. No test is performed to determine if the keyword actually exists but nil is returned for general failure, which could also indicate that the keyword is invalid or improperly formatted. To test whether the keyword exists, call KwdExists before this method. Alternatively, KwdGetValEx returns 2 parameters: a boolean status code and the keyword value.
Suppose a CImage named I exists and contains keywords "FILTER", a string valued keyword, and GAIN, a number valued keyword. The following script returns the value of both keywords from for the image I:
|
-- read the keyword value |
|
-- prints Filter= 'Red' |
|
-- read the keyword value |
|
-- printf Gain= '1.52' |