Skip to main content

Problem:

How to use nested expressions with the INVOKE statement using the .NET version of Net Express.

Resolution:

Some in-line invoke statements can become quite complex when accessing multiple methods and properties directly within a .NET Framework class. Expressions within parenthesis are evaluated first.

Example:

set wsHashedBytes to clsHashAlgo::"Create"(clsCryptoCfg::"CreateFromName"("MD5") ::"ToString")::"ComputeHash"(wsClearBytes)

The equivalent set of invoke statements would look like:

set wsTempString to "MD5"

invoke clsCryptoCfg "CreateFromName" using wsTempString returning wsMD5Service

invoke clsHashAlgo "Create" using wsMD5Service::"ToString" returning wsHashAlgo

invoke wsHashAlgo "ComputeHash" using wsClearBytes returning wsHashedBytes

Old KB# 1545