PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB22] Pageparameter gets truncated
[WB22] Pageparameter gets truncated
Iniciado por guest, 29,ene. 2018 15:57 - 2 respuestas
Publicado el 29,enero 2018 - 15:57
Hi,

Has anybody got the problem that the last digit of a numerical parameter gets truncated in an awp page?
The parameter is read and stored in a global integer. eg 123456
On first load he correct article is read based on the id and displayed on the page, but when doing some server action in the init code of the page the parameter is fetched again but reads 12345 instead of 123456.
If I put a space after the id, then all goes well, but that should not be necessary.
I'm stuck here, what's happening?

Kind regards,
Piet
Publicado el 29,enero 2018 - 16:10
Hi Piet,

I found that out the hard way when I was testing the built-in HFSQL replication system. It requires to use 8 bytes integer for the iD, and I had that exact problem when I was passing some values to the browser code...

The reason is quite simple: All browser code is translated into JavaScript... And JavaScript numerical limit (the maximum value you can store) for an 8 bytes int is WAY lower than in wlanguage... So as soon as you use a value that cannot be stored by js, you loose part of it...

as for you solution of adding a space to it, it simply transform the parameter into a string, and JS supports that without any problem.

So no direct solution except one like the one you already found (or switching to GUIDs for records ID, like I did in MY WXreplication system).

Best regards
Publicado el 30,enero 2018 - 10:15
Hi Fabrice,

Thanks, fortunately I just found the problem.
I had the click code of a link triggered by browser code, but the action of the link was set to "none".
Probably related to what you described, but when I changed the action of the link to submit all went well.

Kind regards,
Piet