L
L
libera2016-01-15 20:47:27
Delphi
libera, 2016-01-15 20:47:27

Loop memo line by line?

for rt := 0 to mmo1.Lines.Count-1 do
         copy:=mmo1.Lines.Strings[rt];
     idhtp1.ProxyParams.ProxyServer:=Copy(proxy,1 ,Pos(':',proxy)-1);
     idhtp1.ProxyParams.ProxyPort:=StrToInt(Copy(proxy ,Pos(':',proxy)+1,Length(proxy)));

Not work.
It only takes the last line.
And I need to go in order.
I have an example of a 10th prosk, I need to use it, but it takes only the last one.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
kalapanga, 2016-01-15
@kalapanga

What you write is what you have. The loop only loops over the lines. And work with a line at you goes already after a cycle.
In general, they forgot begin end!

O
ORTOL, 2016-01-16
@ORTOL

You know, I felt very sad ...
Before, when people wanted to learn something, they ASKED QUESTIONS and received
answers to them ... That is, they could do it (ask questions) ...
But now I notice people have forgotten how THE ABILITY to ask questions,
to be able to express / convey their thoughts, and so this situation is deplorable already ...
And what generally drives you into depression is that you, having stepped over this barrier, are engaged in programming.

R
rediskus, 2016-01-17
@rediskus

Yeah...

for rt := 0 to mmo1.Lines.Count-1 do
   BEGIN
      str:=mmo1.Lines[rt]; // это строка
      idhtp1.ProxyParams.ProxyServer:=Copy(str,1 ,Pos(':',str)-1);
      idhtp1.ProxyParams.ProxyPort:=StrToInt(Copy(str ,Pos(':',str)+1,Length(str)));
   END;

ugh nah...

A
Alexey S., 2016-01-15
@Winsik

carefully review the 2nd and (3,4) lines

L
libera, 2016-01-15
@libera

If you have a lead, then copy then the proxy is registered there. But still doesn't work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question