Home

TOTVS Technology

Child pages
  • Variadic

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Portuguese
Section

Scope
Version 17.3.0.0 and later

Section

From

version

17.3.0.0,

the

resource

of

parameter

of

variadic

type

is

available

for

TL++.

Variadic

is

a

type

of

data

to

be

used

in

functions

that

need

to

receive

a

variable

amount

of

parameters.

For

a

proper

use,

the

function

must

have

types

of

all

parameters

properly

defined,

besides,

the

Variadic

parameter

must

be

displayed

only

once

and

in

the

last

position

of

the

list

of

parameters.

To

get

to

know

the

amount

of

parameters

that

were

passed

in

a

function

call

using

Variadic,

access

the

:vCount

propriety.

And

to

access

the

parameters

themselves

must

access

the

:vArgs\[<position

of

parameter>\]

propriety;

To

illustrate

the

use,

in

the

following

example,

a

function

receiving

a

variable

amount

of

parameters

and

print

all

values

received:

Code Block
languagecpp
firstline1
titleVariadic.tlpp
linenumberstrue
Function exemplo(parm As Variadic)
   Local i
   For i := 1 To parm:vCount
     Conout(parm:vArgs[i])
   Next
Return

...