2011-07-11 32 views
3

我想在我的程序在2007年德尔福未说明的标识符PosEx'

function ExtractText(const Str: string; const Delim1, Delim2: string): string; 
var 
    pos1, pos2: integer; 
begin 
    result := ''; 
    pos1 := Pos(Delim1, Str); 
    if pos1 > 0 then begin 
    pos2 := PosEx(Delim2, Str, pos1+1); 
    if pos2 > 0 then 
     result := Copy(Str, pos1 + 1, pos2 - pos1 - 1); 
    end; 
end; 

我做了谷歌搜索我发现我需要“FastCode.Libraries-0.6.4使用此代码。压缩“我下载它,但不知道如何使用它来使代码高于作品。请帮忙!

+4

什么是错误?那个未声明的标识符? '用'中有'StrUtils'吗? –

回答

6

PosEx在StrUtils单位中定义。确保将其包含在您的使用条款中。

+1

感谢很多家伙我添加了StrUtils使用和问题解决了,当我看到StrUtils我教了它的SysUtils我想我买了眼镜xD – beingbad