<h3>Techniques to Extract Values</h3>

Extracting multiple values from a line and calling separate programs on each:

In your logpro file create a hook and either an expect (can be any of error, warning, ignore or required).

<verbatim>
(hook:add "quadval" "echo \"Value1: #{m1}\";echo \"Value2: #{m2}\";echo \"Value3: #{m3}\";echo \"Value4: #{m4}\"")

;; Use expect:required to extract some values
(expect:required   in "LogFileBody" = 1 "Quad values" hook: "quadval")
</verbatim>

If the logfile for this example contains this line:
<verbatim>
A case where we are capturing multiple values on a single line and exectuting
multiple calls to load them

First: 1 Second: 2 Third: 3 Fourth: 4
</verbatim>

Then the output will show the calls to echo in the hook:add line:

<verbatim>
LOGPRO Required: Quad values = 1 in section LogFileBody on line 40
NONERR HOOK CALLED: echo "Value1: 1";echo "Value2: 2";echo "Value3: 3";echo "Value4: 4"
Value1: 1
Value2: 2
Value3: 3
Value4: 4
First: 1 Second: 2 Third: 3 Fourth: 4
</verbatim>

If you are using megatest to capture results and roll them up you could use a hook specification like this:

<verbatim>
megatest -set-values :value #{m1} :expected_value 0 :tol 1 :category extents :variable ll :units km
(hook:add "qualval" (conc
     "megatest -set-values :value #{m1} :expected_value 0   :tol 1 :category extents :variable first  :units km;"
     "megatest -set-values :value #{m2} :expected_value 0   :tol 1 :category extents :variable second :units km;"
     "megatest -set-values :value #{m3} :expected_value 100 :tol 1 :category extents :variable third  :units km;"
     "megatest -set-values :value #{m4} :expected_value 100 :tol 1 :category extents :variable fourth :units km"))
</verbatim>
Note: "conc" is the string concatenation operator in Chicken Scheme.