Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 3 Monaten, 3 Wochen
Letzter Beitrag:
vor 3 Monaten, 3 Wochen
Beteiligte Autoren:
Piet van Zanten, Fabrice Harari

[WB22] Pageparameter gets truncated

Startbeitrag von Piet van Zanten am 29.01.2018 14: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

Antworten:

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

von Fabrice Harari - am 29.01.2018 15:10
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

von Piet van Zanten - am 30.01.2018 09:15
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.