Hi,

the following block of code in image.a4d (v4.0.0ß8) does not work :

    :(collection has($params; "img_field"))
        $imgPtr := get field pointer($params{"img_field"})

        if (not(nil($imgPtr)))
            $qryPtr := get field pointer($params{"qry_field"})

            if (not(nil($qryPtr)))
                get field properties($imgPtr; $type)

                if ($type = Is Alpha Field)
                    $value := $params{"qry_value"}
                else
                    $value := num($params{"qry_value"})
                end if

                query(table($imgPtr)->; $imgPtr-> = $value)
                $pict := $imgPtr->
            end if
        end if

and should be (changes commented):

    :(collection has($params; "img_field"))
        $imgPtr := get field pointer($params{"img_field"})

        if (not(nil($imgPtr)))
            $qryPtr := get field pointer($params{"qry_field"})

            if (not(nil($qryPtr)))
get field properties($qryPtr; $type) // get properties of $qryPtr and not $imgPtr

                if ($type = Is Alpha Field)
                    $value := $params{"qry_value"}
                else
                    $value := num($params{"qry_value"})
                end if

query(table(table($imgPtr))->; $qryPtr-> = $value) // Need a second "Table(...)" to convert table back to a de- referencable pointer // Search Field should be $qryPtr & not $imgPtr
                $pict := $imgPtr->
            end if
        end if

Regards, Michael.

PS cc'd directly as the mailing list does not seem to be working.
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to