Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Defining arguments – PB Docs 2019 – PowerBuilder Library

Defining arguments – PB Docs 2019

Defining arguments

Like built-in functions, user-defined functions can have any
number of arguments, including none. You declare the arguments and
their types when you define a function.

Passing arguments

In user-defined functions, you can pass arguments by reference,
by value, or read-only. You specify this for each argument in the Pass
By list.

By reference. When you pass an argument by reference, the function has
access to the original argument and can change it directly.

By value. When you pass by value, you are passing the function a
temporary local copy of the argument. The function can alter the
value of the local copy within the function, but the value of the
argument is not changed in the calling script or function.

Read-only. When you pass as read-only, the variable’s value is available
to the function but it is treated as a constant. Read-only provides
a performance advantage over passing by value for string, blob,
date, time, and datetime arguments, because it does not create a
copy of the data.

If the function takes no arguments

Leave the initial argument shown in the Prototype window
blank.

To define arguments:

  1. Declare whether the first argument is passed by reference,
    by value, or read-only.

    The order in which you specify arguments here is the order
    you use when calling the function.

  2. Declare the argument’s type. You can specify any datatype,
    including:

    • Built-in datatypes, such as integer and real

    • Object types, such as window, or specific objects, such
      as w_emp

    • User objects

    • Controls, such as CommandButtons

  3. Name the argument.

    If you want to add another argument, press the Tab key or
    select Add Parameter from the pop-up menu and repeat steps 1 to
    3.

Passing arrays

You must include the square brackets in the array definition,
for example, price[ ]or price[50], and the datatype of the array
must be the datatype of the argument. For information on arrays, see
the section called “Declaring arrays” in PowerScript Reference.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x