Does anybody knows how to store keystroke as a string in X++?
And also if I want to covert them to ASCII and vise-versa.
And the below job does not shows the expected behaviour.
public void textChange()
{
int i, j;
int L = 12;
int h = 4;
int t = 54;
str tmpStr;
;
i = strLen(strKeep(seField.text(), '\n'));
info(seField.text() + ' Lines: ' + int2str(i));
super();
if (i >= H)
{
error(strFmt("max lines = %1", h));
}
}
Actually i am trying to implement something like-
in a textChange method of stringEdit when i enter "A"(or any value) it should display "A line 0"(in info log) then i enter B it should display "AB line 0" (in info). Once i press enter and the enter "Q" display shoud be something like "AB Line 0"(1st line) "Q Line 1"(2nd line) and so on. I face problem with "\n"(Enter) So I need to achieve this through ASCII value. Thanks.
Try the
SearchMode
attribute of string control. To be useful the string value has to be mapped to an indexed table field.I don't see how
task()
is going to help you.It seems that when the
StringEdit
control contains carriage returns,StringEdit.text()
is always giving a wrong result when you're checking it in thetextChange()
method. Probably an AX bug. You can use themodified()
method to get the correct result at least afterwards.Update. You can probably trigger the
modified()
method fromtextChange()
- that would be a hack, I didn't try it.The only way to store keystrokes in an AX form is use the
task()
method on the form.But do not do it for the purpose you commented on!
Rather use a enum value or a combobox feeded with the relevant values to get the wanted behavior.
UPDATE: You may find some useful information on this subject here: http://www.axaptapedia.com/FormComboBoxControl
and here: http://blogs.msdn.com/b/palle_agermark/archive/2005/06/30/434146.aspx