我一直在尝试创建一个简单的函数,该函数将累积一些字符串,然后将其称为它将返回它的字符串,但是由于某种原因,我得到了:
Could not understand line 1 (198)
哪一个太含糊,我一直在论坛中寻找与我进行比较的示例,但似乎还可以,有人可以向我解释我可能做错了什么吗?
码:
put unformatted fcustomer(). /*line one*/
function fcustomer returns char():
define variable vgatherer as character.
define variable i as integer no-undo.
do i = 1 to 10:
assign vgatherer = vgatherer + "thing(s)".
end.
return vgatherer.
end function.
最佳答案
ABL使用单遍编译器,因此必须在使用函数之前对其进行声明。如果您这样更改代码,它将起作用:
function fcustomer returns char():
define variable vgatherer as character.
define variable i as integer no-undo.
do i = 1 to 10:
assign vgatherer = vgatherer + "thing(s)".
end.
return vgatherer.
end function.
put unformatted fcustomer(). /*line one*/
您也可以使用FORWARD短语前向定义函数。检查您的ABL文档以获取详细信息。
关于function - 无法在progress4gl上使用功能,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35560698/