CImage:KwdGetVal CImage:SetRegionValExclude

CImage:KwdGetValEx


The KwdGetValEx method returns a success code and the value of a keyword in the image header. The keyword may be any type of value: string, number, date, time, etc.

Syntax

sValue, bSuccess = CImage:KwdGetValEx( sKwd )

bullet.gif    sKwd is the keyword name.

bullet.gif    sValue is the returned value of sKwd .

bullet.gif    On success, bSuccess is true.

bullet.gif    On failure, bSuccess is false and sValue is nil.

Remarks

This method returns a boolean success code that tells if the keyword exists in the image header. If true, then the keyword value is also returned. Alternatively, KwdGetVal returns only 1 parameter, which is the keyword value.

Example

Suppose a CImage named I exists and contains keyword "FILTER", a string value, and "GAIN", a number value. The following script returns the value of FILTER and GAIN for the image I:

f, bOK = I:KwdGetValEx("FILTER")

-- gets the keyword if it exists

if bOK then

-- keyword exists

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

-- prints FILTER= 'Red'

end

 

g, bOK = I:KwdGetValEx("GAIN")

-- gets the keyword if it exists

if bOK then Printf("Gain=%s", g ) end

-- printf GAIN= 1.52

Related Topics

CImage class

KwdGetVal

KwdGetNumEx

KwdGetStrEx

KwdGetSectEx


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