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.

Syntax

sValue = CImage:KwdGetVal( sKwd )

bullet.gif    sKwd is the keyword name.

bullet.gif    sValue is the returned value of sKwd .

bullet.gif    On success, the method returns a string.

bullet.gif    On failure, the method returns nil.

Remarks

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.

Example

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:

f = I:KwdGetVal("FILTER")

-- read the keyword value

Printf( "Filter= '%s'",f)

-- prints Filter= 'Red'

f = I:KwdGetVal( "GAIN" )

-- read the keyword value

Printf( "Gain= '%s'", f )

-- printf Gain= '1.52'

Related Topics

CImage class

KwdGetValEx

KwdGetNum

KwdGetStr


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.