使用winmessage的方法以外的变量时错误

问题描述 投票:0回答:1

所以,我在我的应用程序包内的类此代码。如果我把winmessage方法里面有没有问题,但是当它的外面说,它需要的声明。任何人知道为什么会这样?这里是我的代码:

发生错误的部分是在WinMessage(描述);

class CopyFromProg
   method CopyFromProg();
   method getProg(&acad_prog As string);
   method getDesc(&desc As string);
   property string program;
   property string description;
end-class;

method CopyFromProg
end-method;

method getProg
   /+ &acad_prog as String +/
   &program = &acad_prog;
end-method;

method getDesc
   /+ &desc as String +/
   &description = &desc;
end-method;

WinMessage(&description);
peoplesoft peoplecode
1个回答
2
投票

你在你的类定义。

该定义只能包括类声明,方法定义和构造函数。

为了显示你的&description你能做到以下几点,一个事件,例如FieldChange:

import TEST_APPPACK:CopyFromProg;
Local TEST_APPPACK:CopyFromProg &test;

&test = create TEST_APPPACK:CopyFromProg();
&test.description = "yeet";
WinMessage(&test.description); /* Popup string "yeet" */

你也可以改变你的应用程序类定义的方法,包括将输出描述:

class CopyFromProg
   method CopyFromProg();
   method getProg(&acad_prog As string);
   method getDesc(&desc As string);
   method showDesc();
   property string program;
   property string description;
end-class;

method CopyFromProg
end-method;

method getProg
   /+ &acad_prog as String +/
   &program = &acad_prog;
end-method;

method getDesc
   /+ &desc as String +/
   &description = &desc;
end-method;

method showDesc
   /******** output &description ********/
   WinMessage(&description);
end-method;

然后,在事件中,你将能够使用:

import TEST_APPPACK:CopyFromProg;
Local TEST_APPPACK:CopyFromProg&test;

&test = create TEST_APPPACK:CopyFromProg();
&test.description = "yeet";
&test.showDesc(); /* Popup string "yeet" */
© www.soinside.com 2019 - 2024. All rights reserved.