Rus:Доработал модуль и добавил новые функции.
Модуль предоставляет три функции:
function geStrToInt(const Str: String; out Value: maxIntVal; Size: LongWord = isInteger): Boolean; // для десятичных чисел со знаком.
function geStrToUInt(const Str: String; out Value: maxUIntVal; Size: LongWord = isLongWord): Boolean; // для десятичных чисел без знака.
function geHOBStrToUInt(const Str: String; out Value: maxUIntVal; Size: LongWord = isQWord): Boolean; // для работы с шестнадцатеричными, восьмеричными и двоичными значениями.
Инициализация данных происходит при включении модуля в проект. Поэтому больше ни чего инициализировать не надо.
Модуль редактирован для разных архитектур. Проверялось только на 64-х битной системе, на 32-х битной не должно вызвать проблем. Для 16-ти и 8-ми битных надо проверять.
В модуле можно поднять уровень текущей архитектуры (UP_CPU в начале модуля). Но вы должны знать, что компилятор это позволяет и система под которую вы это делает (в основном от компилятора зависит). Для 64-х битной системы поднять уровень нельзя на данный момент. При сильном желании (если так хотите) можно, объявите свои данные и работайте с ними. Процедуры вообще не должны зависеть от разрядности системы, поэтому можно поднимать хоть до бесконечности.
Добавлен файл конфигурации.
Все функции работают быстрее стандартных (в 2-3 раза), которые используют функцию Val.
Модуль идёт под свободной лицензией Zlib.Внимание!!! при использовании данного модуля, не включайте в отладчике флаг переполнения! Это может вызвать у вас ошибку переполнения при исполнении вашей программы.
Модуль использует способ переполнения для более быстрой обработки чисел.При работе с шестнадцатеричными, восьмеричными и двоичными данными, вы будете работать только с без знаковыми числами UInt.
Я не считаю, что данные числа должны быть знаковыми (по моему и неудобно). Потому, если вам это необходимо, то вы сами можете доделать те функции, которые вам необходимы.
Шестнадцатеричные можно объявлять: '$', '0x' или '0X'.
Восьмеричные можно объявлять: '&' или '0' (не видел больше ни каких объявлений, если не прав, поправьте меня).
Двоичные можно объявлять: '%', '0b' или '0B'.
Тестируйте, сообщайте об ошибках. Буду править если что сделал не так.
_____________________
Eng:Modified the module and added new features.
The module provides three functions:
function geStrToInt(const Str: String; out Value: maxIntVal; Size: LongWord = isInteger): Boolean; // for signed decimal numbers.
function geStrToUInt(const Str: String; out Value: maxUIntVal; Size: LongWord = isLongWord): Boolean; // for unsigned decimal numbers.
function geHOBStrToUInt(const Str: String; out Value: maxUIntVal; Size: LongWord = isQWord): Boolean; // for working with hexadecimal, octal and binary values.
Data initialization occurs when the module is included in the project. Therefore, there is no need to initialize anything else.
The module has been edited for different architectures. It was tested only on a 64-bit system, it should not cause problems on a 32-bit system. For 16-bit and 8-bit it is necessary to check.
In the module, you can raise the level of the current architecture (UP_CPU at the beginning of the module). But you should know that the compiler allows it and the system under which you do it (mainly depends on the compiler). For a 64-bit system, it is impossible to raise the level at the moment. If you really want to (if you want to), you can, declare your data and work with them. Procedures in general should not depend on the bit depth of the system, so you can raise it at least indefinitely.
Added configuration file.
All functions work faster than standard ones (by 2-3 times), which use the Val function.
The module comes under the free Zlib license.Attention!!! When using this module, do not enable the overflow flag in the debugger! This can give you an overflow error when you run your program.
The module uses an overflow method for faster processing of numbers.When working with hexadecimal, octal, and binary data, you will only be working with unsigned UInts.
I do not believe that these numbers should be signed numbers (in my opinion, and inconveniently). Therefore, if you need it, then you yourself can complete the functions that you need.
Hexadecimal can be declared: '$', '0x' or '0X'.
Octal can be declared: '&' or '0' (didn't see any other declarations, if wrong, correct me).
Binary can be declared: '%', '0b' or '0B'.
Test, report bugs. I will correct if I did something wrong.