PBToolboxAI AcheterBuyKaufenAcquistaComprarComprar

← Historique de tous les composants← History of every component← Versionsverlauf aller Komponenten← Cronologia di tutti i componenti← Historial de todos los componentes← Histórico de todos os componentes

L'historique des versions est publié en anglais.Version history is published in English.Der Versionsverlauf wird auf Englisch veröffentlicht.La cronologia delle versioni è pubblicata in inglese.El historial de versiones se publica en inglés.O histórico de versões é publicado em inglês.

JSON — version history

n_pbt_json · Introduced in 3.0

A non-visual object that builds a JSON document type by type, reads it along a path and edits it in place, in pure PowerScript — no page, no engine, free in every edition. Introduced in 3.0.

4.0 — October 2026 #

New #

  • decimal and longlong overloads of of_set_number and of_add_number, and the readers of_get_decimal and of_get_longlong: an amount keeps all its digits (690.50 is written 690.5), an identifier of more than 15 digits reads back exactly.
  • Building an array with thousands of of_add_* calls in a row is fast: 2,000 rows in a few tens of milliseconds, where 3.0 took several minutes.
  • Reading or editing a large document (an 80 KB API response, 2,000 rows) takes time proportional to its size: reading rows one by one (rows/1, rows/2…) or walking keys with of_name no longer starts over from the beginning (of_count took 20 s on such a document).
  • of_load ignores a leading BOM (a UTF-8 file saved with a BOM).
  • The documentation states two rules that do not change: a null string is written "" (for a JSON null, use of_set_raw(path, "null")), and a key written twice is read at its first occurrence.
  • of_get_array(as_path, as_values[]): every element of an array in one call, each one read as of_get_string reads it (a string decoded, an object or an array as its JSON); it returns the number of elements, -4 when there is no array there.
  • of_pretty(al_indent): the document indented with that many spaces per level, or compact on one line with 0 — the smallest text to store or send; of_pretty() keeps the tabs.

Fixed #

  • A null value given to of_set_number, of_add_number, of_set_boolean, of_add_boolean, or a null or empty value given to of_set_raw / of_add_raw, writes null and leaves the rest of the document intact (the whole document became null or stopped being JSON; a null boolean was written false).
  • Writing into a loaded document whose keys are written "k" : v, contain an escaped character or are followed by a line break, or whose root is an array, replaces or adds the value as on a built document (the key was duplicated, or the write wrongly returned -4); of_set_members returns -4 when the root is not an object instead of replacing the document with the fragment.
  • of_set_*("items/1/qty", …) adds a new key to an object placed in an array (it returned -4); an array is crossed by an existing index, only object keys are created.
  • A path with an empty segment (/name, a//b, a/) returns -5 and writes nothing (keys named "" were created, and of_remove could remove another value); readers answer "absent".
  • of_load refuses a badly written number (-, 01, +1, .5, 1., 1e) with -4, and of_is_valid is false (they were accepted).
  • of_get_number resolves exponents (2.5E+3 was read 2.5, 1E-0000005 gave 0) and keeps 17 significant digits (decimals were cut at 9).
  • of_load of a document nested more than 512 levels deep returns -4 and the application stays alive.
  • of_set_number and of_add_number write a decimal point whatever the machine's decimal separator (only a comma was converted).
  • Strings read by any component decode \b and \f; a \u followed by four characters that are not hexadecimal is kept as written.

Behavior changes #

  • Array indexes in a path count from 1, like every position in the library: lines/1 is the first line; lines/0 designates nothing — a read reports it absent, a write returns -5. A loop for i = 0 to n - 1 over "lines/" + String(i) becomes for i = 1 to n.
  • of_load of a text made only of blanks (line breaks, tabs) returns -5, like an empty text (it returned -4): test < 0 to recognise an empty or invalid file.
  • See the 3 → 4 migration guide, sections 11.3, 11.6, 11.32 and 11.42.

3.0 — September 2026 #

New #

  • First release: one object to build (of_set_string, of_set_number, of_set_boolean, of_set_raw, of_set_array, of_set_members, and of_add_* to feed an array; missing levels of a path are created as objects) and to read (of_load, then of_get_string, of_get_number, of_get_boolean, of_type, of_count, of_name, of_exists, of_is_valid) along a path of levels joined by /.
  • In-place editing of a loaded document (of_set_*, of_remove), of_text() for the compact text and of_pretty() for an indented one, of_clear() to start again.
  • Every method that writes returns a long (0, -5 invalid argument, -4 malformed document).
  • A free component: it needs no license key and has no demo limit.