simatic-ax / conversion Goto Github PK
View Code? Open in Web Editor NEWLibrary: Include various converter-function variants like 'ToString', 'ToInt' or 'ToArrayOf'.
License: Other
Library: Include various converter-function variants like 'ToString', 'ToInt' or 'ToArrayOf'.
License: Other
Currently the function StringToArrayOfLint returns bool for success or false for not successful.
success := StringToArrayOfLint(str, arr);
But in case that the string contains more elements as the destination array can store, shall the function return true
or false
?
On the one hand:
the string can be converted to an array (but not all elements) - so can be successful.
On the other hand:
It could be important that all elements of the string are converted
So the proposal:
When the StringToArrayOfLint returns the number of converted elements, the user can decide by his own how to handle it
For some usecases it is necessary to switch from STRING to WSTRING or some other type to WSTRING. This functionality is not provided by the official AX packages. The proposed way to do so is to create a STRING-TO-WSTRING conversion to avoid duplicating code and create general purpose code.
Example '200' will be converted in '2';
Having a code snippet like this:
VAR
str: STRING := '[12, 345, 6789, 56789, 123]';
arr : ARRAY[0..3] OF LINT;
succes: BOOL;
END_VAR
succes := StringToArrayOfLint(str, arr);
I expect, that the function StringToArrayOfLint returns false, because, the destination array (size) can not store string (5 elements),
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.