Summary

Visual LANSA

Summary

FRM095 - Calling a Function

Important Observations

  • Functions are called locally using the CALL command. The CALL can pass a working list into the called function.
  • The called function must have a RCV_LIST() defined on its FUNCTION statement
  • Passed working lists must be identically defined, in caller and called function.
  • The EXCHANGE command enables an "exchange list" of fields to be passed into the called function.
  • A called function uses EXCHANGE to return fields to the caller.
  • Remote functions running on the server are called using CALL_SERVER_FUNCTION
  • The CALL_SERVER_FUNCTION can handle passing and returning working lists and the fields exchange list.

Tips & Techniques

  • In a real application, the client/server connection would normally be established by a "connect" form at the start of the application.
  • In this example we depended on the Visual LANSA IDE to start the connect to server.

What You Should Know

  • How to CALL a function
  • How to use the EXCHANGE command to pass field values into a called function
  • How to use CALL_SERVER_FUNCTION