将击键存储在 X++ 中
有谁知道如何在 X++ 中将击键存储为字符串?
如果我想将它们转换为 ASCII,反之亦然。
下面的工作没有显示预期的行为。
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-
在 stringEdit 的 textChange 方法中,当我输入“A”(或任何值)时,它应该显示“A line 0”(在信息日志中),然后我输入 B 它应该显示“AB line 0”(在信息中)。一旦我按下回车键,输入“Q”显示应该类似于“AB Line 0”(第一行)“Q Line 1”(第二行)等等。我遇到了“\n”(Enter)的问题,所以我需要通过 ASCII 值来实现这一点。谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 AX 表单中存储击键的唯一方法是使用表单上的
task()
方法。但不要为了您评论的目的而这样做!
而是使用枚举值或包含相关值的组合框来获得所需的行为。
更新:
您可以在这里找到有关此主题的一些有用信息:http://www.axaptapedia.com/FormComboBoxControl< br>
在这里: http://blogs.msdn.com/ b/palle_agermark/archive/2005/06/30/434146.aspx
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
我不知道
task()
对您有什么帮助。似乎当
StringEdit
控件包含回车符时,当您在textChange() 中检查时
StringEdit.text()
总是给出错误的结果方法。可能是 AX 错误。您至少可以使用modified()
方法来获得正确的结果。更新。您可能可以从
textChange()
触发modified()
方法 - 这将是一种黑客行为,我没有尝试过。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.尝试字符串控件的
SearchMode
属性。为了有用,字符串值必须映射到索引表字段。Try the
SearchMode
attribute of string control. To be useful the string value has to be mapped to an indexed table field.