Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: soldat-game on January 05, 2017, 01:14:59 pm

Title: IndexOf bug bad work
Post by: soldat-game on January 05, 2017, 01:14:59 pm
Code: [Select]
Procedure TestIndex();
var Temp: TStringList;
begin
Temp:= File.CreateStringList;
Temp.Append('Test');
Temp.Append('TeSt');
Temp.Append('TEst');
Temp.Append('TesT');
WriteLn(inttostr(Temp.IndexOf('Test'))); //Return 0
WriteLn(inttostr(Temp.IndexOf('TeSt'))); //Return 0
WriteLn(inttostr(Temp.IndexOf('TEst'))); //Return 0
WriteLn(inttostr(Temp.IndexOf('TesT'))); //Return 0
Temp.Free;
end;
Title: Re: IndexOf bug bad work
Post by: Savage on January 05, 2017, 06:40:54 pm
You're right, there should be additional parameter for case-sensitiveness.
Title: Re: IndexOf bug bad work
Post by: Falcon` on January 06, 2017, 03:38:24 am
there's CaseSensitive (http://www.freepascal.org/docs-html/rtl/classes/tstringlist.casesensitive.html) property on TStringList (http://www.freepascal.org/docs-html/rtl/classes/tstringlist.html), unfortunately as far as i've checked it's not exported into SC3. You'll have to wait for soldat 1.8
Title: Re: IndexOf bug bad work
Post by: soldat-game on January 06, 2017, 11:35:01 am
My whole script accounts leaned against the already indexOf