🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1260

Re: AResponseInfo->Referer question

#1260
From: Hans Galema
Date: Mon, 04 Apr 2005 08:20
29 lines
1896 bytes
Ulli wrote:

> First I wanted to have a Keywoard to know that the following is a 
> control string, but I think this solution will be o.k. too - or better ;)

   <a href="Site_1.html?command=switch&Light_1=on">Light 1 on</a>

> Just one other question, ist there a more elegant way to split 
> parameters at the "=" char than with .Pos amd .SubString

If there is only one key=value pair then that would be ok. You would
not even need to decode then as you could simply check:

   if ( Pos ( URL, "Light_1=on" ) )
     {
     //switch light 1 on
     }

   if ( Pos ( URL, "Light_1=off" ) )
     {
     //switch light 1 off
     }

You could even do that when you have more key=value pairs.

Otrherwise have a look at TStringList. CommaText and Names and Values
properties. Please read the help for that.

Hans.
Technical Details
Message-ID: <4250f95a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <opsoh67weogmwg2m@localhost> <424c50c6$1@newsgroups.borland.com> <opsojsglxqgmwg2m@localhost> <424d61f9@newsgroups.borland.com> <opsoo6ljd2gmwg2m@localhost>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,4b33aa1f27c59276
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 04 Apr 2005 10:20:34 +0200
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Re: AResponseInfo->Referer question
References: <opsoh67weogmwg2m@localhost> <424c50c6$1@newsgroups.borland.com> <opsojsglxqgmwg2m@localhost> <424d61f9@newsgroups.borland.com> <opsoo6ljd2gmwg2m@localhost>
In-Reply-To: <opsoo6ljd2gmwg2m@localhost>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <4250f95a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112602970 129.125.201.248 (4 Apr 2005 01:22:50 -0800)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail