#1 2021-08-03 07:56:59

jeffp
Member
Registered: 2021-07-20
Posts: 3

What does UrlDecodeDouble do

Hello.

I am trying to follow Sample 06 (Project06Server) then I came around UrlDecodeDouble. What does it do and the other UrlDecode* functions? What is done with the parameters? Sorry, can't find the answer in the docs (or don't understand).

TIA. jeffp

Offline

#2 2021-08-03 08:24:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,570
Website

Re: What does UrlDecodeDouble do

It may be used to directly extract an Url encoded parameter.
https://synopse.info/files/html/Synopse … #TITLE_343

Online

#3 2021-08-03 10:32:15

jeffp
Member
Registered: 2021-07-20
Posts: 3

Re: What does UrlDecodeDouble do

Thank you for your reply, ab.

I have actually read the documentation entry for URLDecodeDouble.

But the explanation is not enough for me, sorry.

function UrlDecodeDouble(U: PUTF8Char; const Upper: RawUTF8; var Value: double; Next: PPUTF8Char=nil): boolean;

U = the URL passed
Upper = Upper of the target parameter? Why?
Value = stores the double value
Next = this is not obvious to me

I struggle to interpret the use of Next here.

Offline

#4 2021-08-03 11:05:41

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

Re: What does UrlDecodeDouble do

Upper = Upper of the target parameter? Why?

Because it's faster, reduces the time spent in the lookup table comparing chars.

Next = this is not obvious to me

Moves the string char pointer to the next to be decoded value, this is again performance benefit so it doesn't have to re-scan the entire URL string every time you call UrlDecode functions.

Example:

URL : user=Peter&password=test
if UrlDecodeValue(U, 'USER=', LUser, @U) and UrlDecodeValue(U, 'PASSWORD=', LPassword) then

Last edited by pvn0 (2021-08-03 11:24:38)

Offline

#5 2021-08-04 10:34:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,570
Website

Re: What does UrlDecodeDouble do

If you are confused by those low-level methods, rather use the high-level Input methods of the request execution context.

Online

#6 2021-08-05 09:08:45

jeffp
Member
Registered: 2021-07-20
Posts: 3

Re: What does UrlDecodeDouble do

ab wrote:

If you are confused by those low-level methods, rather use the high-level Input methods of the request execution context.

Do you happen to have an example for that, please?

Offline

#7 2021-08-05 10:34:52

tbo
Member
Registered: 2015-04-20
Posts: 352

Re: What does UrlDecodeDouble do

jeffp wrote:

Do you happen to have an example for that, please?

You can find information here in the help file (InputInt, InputUtf8, InputIntOrVoid, ...).

With best regards
Thomas

Offline

Board footer

Powered by FluxBB