You are not logged in.
Pages: 1
Before trying to reinvent the wheel and doing manual parsing of Ctxt.URL, is there a ready function or property that (pre)parses GET parameters into, say, a TStringList?
Thanks!
Offline
Hi Arnaud, thanks for the reply.
Yup, had a look at the UrlDecode* functions. I reckon the easiest way out is to use UrlDecodeNextNameValue and assign the pair to a StringList/Dictionary eh? Or perhaps to take the parameter portion of the URI, remove the '?', perform a string replace of all & into CRLF, and assign it directly to a StringList? I guess both a do-able.
The reason I asked this is because I would like to allow for optional parameters and to pre-assign default values to those that are not set.
Thanks again Arnaud, for the fantastic framework!
Offline
IMHO a TStringList/Dictionary is not mandatory.
The UrlDecode*() functions allow to define a set of variables in a loop, with minimal performance impact.
You can assign default values by setting some values before the loop.
Offline
Pages: 1