:
This message was edited by zibadian at 2005-2-27 6:8:41
: : : : What am i doing wrong :
: : : :
: : : : type
: : : : TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);
: : : : var
: : : : strLine : string;
: : : : Flags : TReplaceFlags;
: : : : Begin
: : : : strLine := StringReplace(strLine, ',' ,'","' , Flags);
: : : :
: : : : It's says that the Flags is not good.
: : : : What should i do?
: : : :
: : : :
: : : You don't need to define the TReplaceFlags. They are already defined by Delphi. The last parameter is either a variable of the type TReplaceFlags or a set constructor.
: : :
: :
: : How do i write in the param list ?
: : strLine := StringReplace(strLine, ',' ,'","' , ?????);
: :
: I normally use a set constructor. This makes the replace to look something like this:
:
: strLine := StringReplace(strLine, ',' ,'","' , [rfIgnoreCase]);
:
: Set constructors are detailed in the help files.
: Also not that 2 different declarations of type are NOT the same. Thus your TReplaceFlags is not the same as the SysUtils' TReplaceFlags.
:
Thanks you are truly great one