Al: String handling with .Net

Created on 30 Jan 2017  路  7Comments  路  Source: microsoft/AL

I know .Net is not available (yet?). But I'd like to do some simple string handling, like:

  • System.String
  • System.Array
  • System.IO.StringReader

Is .Net on the agenda already?
Do you have any idea when something simple like this would be possible?

shipped suggestion

Most helpful comment

It's on the agenda and it's high on the priority list of .NET replacement functions we want to do.
As with our other .NET wrappers, we're unlikely to cover all properties and methods from the types. We'll implement as much as we can to ensure you get core use, but it would be kind of you (and others) to illustrate how you use the string/array/string reader types to ensure we cover the core use you need.

All 7 comments

It's on the agenda and it's high on the priority list of .NET replacement functions we want to do.
As with our other .NET wrappers, we're unlikely to cover all properties and methods from the types. We'll implement as much as we can to ensure you get core use, but it would be kind of you (and others) to illustrate how you use the string/array/string reader types to ensure we cover the core use you need.

OK, @stuartglasson , looks good.

How do you want me to illustrate it?

Code or pseudo code would be good.
What we're looking for is an understanding of how much of some particular .NET type needs to be implemented by us in order to be useful.

Well, let's point to the codeunit I'd like to be able to create in .al :-). That gives you all code that I was thinking about...

https://github.com/waldo1001/Waldo.NAV/blob/master/WaldoNAVPad/Split/COD82111.TXT

I use .NET for splitting strings with the following code snippets:

image

It can of course be done with plain AL, but would require much more code.

I find that the split functionality should be done with strings over a member access.
stringArrayB := stringA.Split();
And really great would be array access by an indexer.
stringB := stringArrayB[10]; stringArrayA := stringArrayB[1].Split();
If we are already there. It would be super advantageous if arrays were either A) expandable or dynamically definable or there would still be something like List. Currently arrays in classic AL are in my opinion a joke and are only annoying.

String handling functions have been delivered in August update. Please log new issues for specific things that might still be missing:
https://blogs.msdn.microsoft.com/nav/2017/08/03/nav-development-preview-august-update/

Was this page helpful?
0 / 5 - 0 ratings