我需要在 RFT (java) 中一遍又一遍地处理几行代码,因此自定义方法/函数/过程是最好的(也是唯一的)解决方案。
我没有java经验,所以我需要一些帮助。
该方法将接收一些参数并且不会返回任何值。
基本上它会将新记录输入数据库(基于 Web 的应用程序)。有多少记录?这取决于数据,所以我需要让它基于参数。
当前代码看起来像
text__firstname(ANY,NO_FLAGS).setText(dpString("StudentName"));
text__surname(ANY,NO_FLAGS).setText(dpString("StudentSurnameName"));
在 php 中,所需的功能看起来像
function add_student($first_name,$surname){
text__firstname(ANY,NO_FLAGS).setText($first_name);
text__surname(ANY,NO_FLAGS).setText($surname);
}
所以我可以称之为
add_student(dpString("StudentName"),dpString("StudentSurnameName"));