if 'text' in b.Strings then
the operator 'IN' help me a lot, but don´t work here. =]]]]
Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7
what the problem?
Re: what the problem?
show an example, what you want to do
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: what the problem?
Полюбасу антимакро ломаетVizit0r wrote:show an example, what you want to do
Re: what the problem?
find a specific text in lines GetGumpFullLines
ex:
ResizePics: X Y ID Width Height Page ElemNum
0 ResizePic: 23 471 9200 200 100 0 1
1 ResizePic: 29 516 9200 185 30 0 5
2 ResizePic: 108 476 9200 105 19 0 7
3 ResizePic: 117 476 9200 34 19 0 11
4 ResizePic: 117 476 9200 30 19 0 13
5 ResizePic: 134 476 9200 20 19 0 16
6 ResizePic: 134 476 9200 18 19 0 18
7 ResizePic: 134 476 9200 17 19 0 20
8 ResizePic: 134 476 9200 30 19 0 22
9 ResizePic: 134 476 9200 15 19 0 24
10 ResizePic: 134 476 9200 19 19 0 26
11 ResizePic: 142 476 9200 33 19 0 29
12 ResizePic: 156 476 9200 31 19 0 32
13 ResizePic: 156 476 9200 20 19 0 34
14 ResizePic: 163 476 9200 30 19 0 37
15 ResizePic: 117 476 9200 95 19 0 38
16 ResizePic: 133 476 9200 16 19 0 41
17 ResizePic: 160 476 9200 33 19 0 44
18 ResizePic: 167 476 9200 36 19 0 46
i need find 105 19,
if '105 19' in b.Strings then //"DON`T WORK"
if b.Strings = '2 ResizePic: 108 476 9200 105 19 0 7' then //"WORKS, BUT DOESN'T RIGHT"
ex:
ResizePics: X Y ID Width Height Page ElemNum
0 ResizePic: 23 471 9200 200 100 0 1
1 ResizePic: 29 516 9200 185 30 0 5
2 ResizePic: 108 476 9200 105 19 0 7
3 ResizePic: 117 476 9200 34 19 0 11
4 ResizePic: 117 476 9200 30 19 0 13
5 ResizePic: 134 476 9200 20 19 0 16
6 ResizePic: 134 476 9200 18 19 0 18
7 ResizePic: 134 476 9200 17 19 0 20
8 ResizePic: 134 476 9200 30 19 0 22
9 ResizePic: 134 476 9200 15 19 0 24
10 ResizePic: 134 476 9200 19 19 0 26
11 ResizePic: 142 476 9200 33 19 0 29
12 ResizePic: 156 476 9200 31 19 0 32
13 ResizePic: 156 476 9200 20 19 0 34
14 ResizePic: 163 476 9200 30 19 0 37
15 ResizePic: 117 476 9200 95 19 0 38
16 ResizePic: 133 476 9200 16 19 0 41
17 ResizePic: 160 476 9200 33 19 0 44
18 ResizePic: 167 476 9200 36 19 0 46
i need find 105 19,
if '105 19' in b.Strings then //"DON`T WORK"
if b.Strings = '2 ResizePic: 108 476 9200 105 19 0 7' then //"WORKS, BUT DOESN'T RIGHT"
Re: what the problem?
pascal language don't know "in" in such use, as you want.
"in" can be used for check item in set.
for search in string use
1) Pos - http://delphi.about.com/od/beginners/l/blrtlPos.htm
2) BMSearch
"in" can be used for check item in set.
for search in string use
1) Pos - http://delphi.about.com/od/beginners/l/blrtlPos.htm
2) BMSearch
BMSearch(StartPos : Integer; const String, Substring : String) : Integer
example:
BMSearch(1, 'dsade', 'de')
will return 4
if find nothing - return zero
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: what the problem?
sorry, but what is the problem?
Compiler: [Error] (takegump.sc at 17:29): Type mismatch
Compiler: [Error] (takegump.sc at 17:29): Type mismatch
Code: Select all
Program test;
var b : TStringList;
i, test : integer;
Begin
test := 0;
b := TStringList.Create;
SetSilentMode(False);
for i := 0 to GetGumpsCount - 1 do
Begin
GetGumpFullLines(i,b);
for i := 0 to b.Count-1 do
test := test + 1;
if BMSearch(1, b.Strings[i], 'recado') <> 0 then
Begin
addtosystemjournal(test);
End;
End;
b.free;
End.
Re: what the problem?
in pascal, strings must be selected by ' '
a := 'sdfdfdfgfdg';
a := 'sdfdfdfgfdg';
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: what the problem?
addtosystemjournal(IntToStr(test));