Solved

url parsing - delphi

Posted on 2011-03-18
4
568 Views
Last Modified: 2012-05-11
Hello experts.Please help me.
i have a trouble.

i a memo1.lines are string like this : C:\temp\11.zip|C:\program files......

i have wrote a code that need to parse first dir adress and second
var
localfile,secondfile,total : string;
begin
total := Memo1.Lines[0];
total := localfile + '|' + second;
showmessage(localfile);
showmessage(second);

But this not work.
please help me.
Thanks.
0
Comment
Question by:helyonprime96
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 35163702
use a TStringList


var
  Temp: TStrings;
begin
  Temp := TStringList.Create
  try
    Temp.StrictDelimiter := True;
    Temp.Delimiter := '|';
    Temp.DelimitedText := Memo1.Lines[0];
    showmessage(Temp[0]);
    showmessage(Temp[1]); 
  finally
    Temp.Free;
  end;

Open in new window

0
 

Author Comment

by:helyonprime96
ID: 35163707
ok.thanks.

please help
how can i delimite proxy host and port?

with this code?
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35163742
var
  Str:string;
begin
  str:=Memo1.Lines[0]+'|'; // or str:=Memo1.Text+'|';
  while pos('|',Str) > 0 do
    begin
      ShowMessage(copy(str,1,pos('|',Str)-1));
      delete(str,1,pos('|',Str));
    end;
end;

Open in new window

0
 

Author Closing Comment

by:helyonprime96
ID: 35164244
thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SUM 2 INTEGER ARRAYS INTO 1 10 100
Adoquery sql  left join does not work 25 91
MacOS and programming in React 7 35
VbScript to countdown to New Year's Day 6 55
A short article about a problem I had getting the GPS LocationListener working.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question