From 4c59a4b04031642acbd510228263e117e80389d1 Mon Sep 17 00:00:00 2001 From: Peter Akers Date: Tue, 26 May 2026 10:44:32 +1000 Subject: [PATCH] leading zeros warnings --- docs/exrail/exrail-command-reference.rst | 8 +++++++- docs/exrail/getting-started.rst | 6 ++++++ docs/exrail/tips.rst | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/exrail/exrail-command-reference.rst b/docs/exrail/exrail-command-reference.rst index 5e0b95fcd3..18dd7adcdc 100644 --- a/docs/exrail/exrail-command-reference.rst +++ b/docs/exrail/exrail-command-reference.rst @@ -63,7 +63,13 @@ Handy information .. warning:: - You must avoid using these characters in all descriptions: ``<``, ``>``, ``"`` as these are part of the |DCC-EX| protocol and are likely to prevent descriptions showing up in |JMRi| and other throttle software/clients. + You must avoid using these characters in all descriptions: ``<``, ``>``, ``"`` as these are part of the |DCC-EX| protocol and are likely to prevent descriptions showing up in |JMRI| and other throttle software/clients. + +.. warning:: + + **Do not use leading zeros for any numbers!** + + Any number with a leading zero will be treated as an octal number, so for example ``ALIAS(MY_ALIAS, 010)`` will assign the value of ``8`` to MY_ALIAS, not ``10``. This is a common mistake that can lead to very confusing behavior if you don't know about it. Always use numbers without leading zeros, for example ``ALIAS(MY_ALIAS, 10)`` to assign the value of 10 to MY_ALIAS. .. note:: diff --git a/docs/exrail/getting-started.rst b/docs/exrail/getting-started.rst index f4507a46f1..019135a50b 100644 --- a/docs/exrail/getting-started.rst +++ b/docs/exrail/getting-started.rst @@ -26,6 +26,12 @@ For a full list of keywords, see :doc:`/exrail/exrail-command-reference`. Only Do not waste your time asking ChatGPT, Copilot or Gemini to create EXRAIL scripts. They do not understand EXRAIL and will get it wrong 100% of the time. +.. warning:: + + **Do not use leading zeros for any numbers!** + + Any number with a leading zero will be treated as an octal number, so for example ``ALIAS(MY_ALIAS, 010)`` will assign the value of ``8`` to MY_ALIAS, not ``10``. This is a common mistake that can lead to very confusing behavior if you don't know about it. Always use numbers without leading zeros, for example ``ALIAS(MY_ALIAS, 10)`` to assign the value of 10 to MY_ALIAS. + Types of Sequence ================= diff --git a/docs/exrail/tips.rst b/docs/exrail/tips.rst index 85ca782c45..35e785130b 100644 --- a/docs/exrail/tips.rst +++ b/docs/exrail/tips.rst @@ -23,6 +23,13 @@ Below are some tips and techniques you can implement to get the most out of |EX- Do not waste your time asking ChatGPT, Copilot or Gemini to create EXRAIL scripts. They do not understand EXRAIL and will get it wrong 100% of the time. +Numbers and Leading Zeros +========================== + +**Do not use leading zeros for any numbers!** + +Any number with a leading zero will be treated as an octal number, so for example ``ALIAS(MY_ALIAS, 010)`` will assign the value of ``8`` to MY_ALIAS, not ``10``. This is a common mistake that can lead to very confusing behavior if you don't know about it. Always use numbers without leading zeros, for example ``ALIAS(MY_ALIAS, 10)`` to assign the value of 10 to MY_ALIAS. + Comments ========