PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Pass PAGE / Report as parameter
Pass PAGE / Report as parameter
Débuté par Daniel, 29 aoû. 2017 10:33 - 3 réponses
Posté le 29 août 2017 - 10:33
Hi

Is it possible to pass a PAGE or a Report as a parameter in a procedure?
Something similar to:

PROCEDURE Test (testPage is PAGE, testReport is Report)
do something
END

if not, how would I be able to access the page/report controls in a procedure without specifying IN the procedure which page/report it is? I'm trying to write a procedure which auto-fills all report controlls with the content of the corresponding page control.

Thank you
Posté le 29 août 2017 - 13:21
Hi Daniel

I -THINK- that you are looking for the "indirection" mechanism. Look it
up in the help but basically, you pass the name of the elements as
string, and you work in your code with something like this :
{ElementName,TypeOfElement}=Value

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 8/29/2017 à 2:33 AM, Daniel a écrit :
Hi

Is it possible to pass a PAGE or a Report as a parameter in a procedure?
Something similar to:

PROCEDURE Test (testPage is PAGE, testReport is Report)
do something
END

if not, how would I be able to access the page/report controls in a
procedure without specifying IN the procedure which page/report it is?
I'm trying to write a procedure which auto-fills all report controlls
with the content of the corresponding page control.
Thank you
Posté le 31 août 2017 - 08:13
Thank you very much! This was just what I needed.

One more question: is there a method to get all controls from a PAGE?
I could iterate through al with EnumControl( ) and add them to a list, but I thought maybe there's an other way.

Thanks
Posté le 31 août 2017 - 12:50
Hi Daniel

EnumControl IS the way.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 8/31/2017 à 12:13 AM, Daniel a écrit :
Thank you very much! This was just what I needed.

One more question: is there a method to get all controls from a PAGE?
I could iterate through al with EnumControl( ) and add them to a list,
but I thought maybe there's an other way.

Thanks