TIPTOP|4GL No member function 错误解决

小助手读文章 00:00 / 00:00

部分源代码:

......
DEFINE i,l_len,l_split    LIKE type_file.num5
DEFINE l_str                 LIKE type_file.chr1000
......
          LET l_len = l_str.getLength()
          FOR i = 1 TO l_len
              IF l_str.subString(i,i) MATCHES '[,;]' THEN
                  LET l_split = i
                  EXIT FOR
              END IF
          END FOR
......

编译时出现如下错误:

<toptest:/u1/toptest/topcust/csf/4gl> r.c2 csft900
csft900  ..............
../42m/csf_csft900.4gl:1984:23:1984:39:error:(-6606) No member function 'getLength' for class 'Field' defined.
../42m/csf_csft900.4gl:1986:18:1986:37:error:(-6606) No member function 'subString' for class 'Field' defined.
../42m/csf_csft900.4gl:1998:19:1998:38:error:(-6606) No member function 'subString' for class 'Field' defined.
The compilation was not successful.  Errors found: 3.
 The file '../42m/csf_csft900.err' has been written.

出现此问题原因是 l_str 的类型定义错误,getLength、subString 只能处理 STRING 类型,不能处理 varchar2 类型。

修改后源代码:

......
DEFINE i,l_len,l_split    LIKE type_file.num5
DEFINE l_str                 STRING
......
          LET l_len = l_str.getLength()
          FOR i = 1 TO l_len
              IF l_str.subString(i,i) MATCHES '[,;]' THEN
                  LET l_split = i
                  EXIT FOR
              END IF
          END FOR
......

编译无报错:

<toptest:/u1/toptest/topcust/csf/4gl> r.c2 csft900
csft900  ..............
<toptest:/u1/toptest/topcust/csf/4gl> r.l2 csft900
/u1/genero/fgl.dev/bin/fgl2p -o csft900.42r  libgre.42x WSHelper.42m lib.42x sub.42x qry.42x  csf_csft900.42m

csft900.42r has been generated successfully!

网上的 TIPTOP 4GL 中文资源真不好找......


ArmxMod for Typecho
个性化、自适应、功能强大的响应式主题

推广

 继续浏览关于 tiptop易拓鼎捷4glt100 的文章

 本文最后更新于 2018/12/06 12:30:00,可能因经年累月而与现状有所差异

 引用转载请注明:VirCloud's Blog > 运维 > TIPTOP|4GL No member function 错误解决