Welcome! Log In Create A New Profile

Advanced

[WB25] passing a control as a parameter to a class

Posted by Neil Porter 
[WB25] passing a control as a parameter to a class
May 02, 2020 12:50PM
I've written a class where I've declared a control as a member:

cMyclass is a Class

m_control is Control

END

I pass my reference to that control in my constructor method:

PROCEDURE Constructor(EditControl is Control)

:m_control <- EditControl


I have another method where I want to add values for assisted input:


PROCEDURE LoadArray()

AssistedInputDeleteAll(:m_control)

LOOP
// Add values to my assisted lookup

AssistedInputAdd(:m_control,"My value will go here")

// read the next record

END

AssistedInput Add is being called by looking ini the debugger m_control is always ""

Is there a trick to passing a control to a class, or have I made got the assignment wrong?

TIA

Neil.
I don't use controls for that... I pass the full name of the control (window.control) and use indirections to do whatever I want on it.
Re: [WB25] passing a control as a parameter to a class
May 02, 2020 04:06PM
It must be something about about the AssistedInput functions.

:m_control..State = Invisible and {:m_controlname}..state = invisible work fine but neither.

AssistedInputAdd(:m_control,"My String Value") or AssistedInputAdd({:m_controlname},"My String Value") work.

How frustrating.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: