![]() |
Can anyone here code Delphi?
not the most popular language i know :winkwink:
but i have something i would like an experienced programmer to overlook 59* 101_924 is my ICQ Thanks |
I can. What do you need?
|
mind msging me?
i have a problem with POS & COPY Thanks |
damn, not since delphi 3
i feel fucking old (and im only 19) i havent needed it in a long time, ive only done web based stuff lately. delphi rocks :thumbsup |
i wouldnt say it rocks but :winkwink:
|
still seeking help
you will not regret it thats for sure :winkwink: |
:glugglug
|
|
my icq is above!
|
Icq sent
:thumbsup |
thanks
but keep it coming guys i never forget a person who helped me with something :winkwink: |
post the whole problem here
|
Quote:
|
Quote:
|
Of course i can post it here :)
here we go: procedure TForm1.FormCreate(Sender: TObject); var temp :string; begin AssignFile(Txt, 'a.txt'); Reset(Txt); Memo1.Lines.Clear; Memo2.Lines.Clear; While not EOF(txt) do begin ReadLn(txt, temp); Memo1.Lines.Add(temp); end; CloseFile(Txt); end; procedure TForm1.SearchButtonClick(Sender: TObject); var temp :string; such :string; result :array[0..100] of string; i, j, anf, lang: integer; begin such:=edit1.Text; Reset(Txt); i:=0; j:=0; While not EOF(txt) do begin ReadLN(Txt, temp); total:=length(such); beg:=pos(such, temp); if anf <> 0 then begin result[i]:=copy(temp, beg, total); memo2.lines.add('Found in line '+inttostr(j)+' the result '+result[i]); inc(i); end; inc(j); end; end; end. no the problem lets say the text file looks like this: "1 2 3 4 5 1 2 3 oaewrhgoawehg owehg wioehgweg 1woeihgwoeihgw" and i search for "1" it only displays that its found in line 1 and in line 3 however i want it to find the other 1's in line1 as well but i am not able to work with that somebody told me something about posEx but i am not able to work with that and it has to be done with POS and COPY :( i am freshing up my delphi knowledge a bit and am stuck here :winkwink: my programmers told me delphi is a joke and that noone still codes with it - well ... i learnt it in school so hehe :glugglug |
just by looking it over, it seems that after 1 is found it automatically increases j, so even if there is a second one on the same line, j will be increased and possibly give you the wrong line its on..?
|
Heh... I actually do know a guy who's a Delphi expert... I always make fun of him, this time he may actually be useful for something :1orglaugh
ICQ him at 145213011, tell him I gave you his UIN so he doesn't freak out. |
thanks to both- init for the tip and fuzebox for the icq# :winkwink: :thumbsup
|
All times are GMT -7. The time now is 12:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123