View previous topic :: View next topic
|
Author |
Message |
Keith Malek
New User
Joined: 06 Feb 2014 Posts: 2 Location: Canada
|
|
|
|
Hello All,
I have a question that I can’t seem to find an answer for.
I’ve been programming for IBMPersonal Communications from VBA i.e.
autECLOIAObj.WaitForInputReady
autECLPSObj.SetCursorPos 6, 19
autECLOIAObj.WaitForInputReady
autECLPSObj.SendKeys "Hello World"
My question is, is there a way of sending text to a field number i.e.
autECLPSObj.autECLFieldList.Refresh(1)
If (Not autECLPSObj.autECLFieldList.Count = 0 ) Then
If ( autECLPSObj.autECLFieldList(1).Numeric ) Then
' do whatever
Endif
Endif
So something like (autECLPSObj. SendKeys.autECLFieldList(1) "Hello World") that way it sends "Hello World" to field number 1 in the presentation space.
I’m not sure If I am explaining it well or not. Please let me know.
Thank you in advance. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Do you have a good definition of what is returned from teh expression "autECLFieldList(1)"?
You MAY have to find a way to extend that reference until it returns a field object, like autECLPSObj. SendKeys.(autECLPSObj.autECLFieldList(1)) or something similar.
A lot of it depends on the object definitions. Do you have alink to the PCOMM object model library? |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
A-ha!
The fieldlist object has a SetText method...
' Build the list and set the first field with some text
autECLPSObj.autECLFieldList.Refresh(1)
autECLPSObj.autECLFieldList(1).SetText("IBM is a cool company") |
|
Back to top |
|
|
Keith Malek
New User
Joined: 06 Feb 2014 Posts: 2 Location: Canada
|
|
|
|
Cool. Thank you all for your help. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
If you were dead set to use Sendkeys, like if it's the only way to send special characters or something:
Use the FieldList object to get teh Row/Col of the field you want, then use them in the presentation space calls:
Dim Row as Long
Dim Col as Long
Row = autECLPSObj.autECLFieldList(1).StartRow
Col = autECLPSObj.autECLFieldList(1).StartCol
autECLPSObj.SendKeys "IBM is a really cool company", Row, Col
OR
autECLPSObj.SetCursorPos Row, Col
autECLPSObj.SendKeys "IBM is a really cool company"
OR
autECLPSObj.SetText("Hello World", Row, Col)
However, the manual warns that SetText can NOT send those PF Keys like [enter] and [PF1], so you probably want to use that Sendkey method. |
|
Back to top |
|
|
|