Giter Club home page Giter Club logo

conversion's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tcj222 zantiu

conversion's Issues

StringToArrayOfLint(str, arr) should return the number found elements instead of success

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

  • 0 : means not successful
  • StringToArrayOfLint() < lengthOf(arr) means: all elements > lengthOf(arr) are valid
  • StringToArrayOfLint() > lengthOf(arr) --> can't happen

Conversion into WSTRING missing

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.

Array boundaries are not checked in StringToArrayOfLint

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),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.