New Option to Log X++ Max-Length String Truncation

In X++ you can optionally declare a string to have a specified maximum length:   str 5 maxLen5String;   Semantically, if you try to store more than 5 characters to this string, it will be truncated.   In March 2010 we blogged here about the X++ max-length string type, and asked how we should handle…

0

X++ script host.

I was looking at the API that we publish for the X++ compiler, and it struck me that it would be really easy to implement a script host for X++. This is a program that allows you to execute arbitrary X++ code that is stored in files in the file system. In this way, you…


Working with System.Char in X++

There are situations where it is useful to workl with characters in X++. As you know, X++ does not have the concept of characters in the defined in the language: Only strings are defined. However, it is not impossible to work with characters in X++, if you use the managed System.Char type. It will not win any…


More help needed from community: Do you rely on string truncation?

Previously the X++ language allowed the LEFT and RIGHT keywords on definitions of string variables. That is no longer valid X++. However, we still allow specifying an explicit string length. The X++ language runtime implicitly does string truncation on assignment, both directly and when passing parameters. Consider the following example: {    str 5 s;    s…


Removal of legacy functions

There are several legacy X++ language functions found in Dynamics AX that we have been considering for removal.  All of the following APIs are no longer used internally, and some are relics from an earlier era (pre-Unicode).  Given the lack of use, we do not wish to propagate these APIs into the new IL runtime stack, and…


Conditional breakpoint workaround

As you may know, the Ax debugger does not feature conditional breakpoints. It does obviously allow you to set breakpoints, but there is no option to make them active depending on some condition that is evaluated each time the breakpoint is encountered. There are some programming scenarios where it is highly advantageous to be able…

4

Transforming X++ code to managed code: Check the video…

The channel 9 video: https://channel9.msdn.com/posts/Charles/Peter-Villadsen-and-Gustavo-Plancarte-Inside-Ax-Translator-X-to-MSIL/ showcases some work that the X++ team has done to investigate the options for transforming X++ code into managed code. We are publishing it here in the hope that it may spark some interesting discussions and feedback. Even though we are passionate about this work, you should not infer that this feature will…

1

Using the Cross company feature from the Business Connector.

In Ax 2009 the new cross company feature was introduced. It allows the programmer to specify a container containing strings denoting company names to the crosscompany hint: container c = [‘dat’, ‘dmo’];select crosscompany: c * from custtable where custtable.Name == “Jones”; That is all very well in X++, of course, but how do you handle…

1

Caveat: Using the += and -= operators for dates.

As you may know, it is possible in X++ to add integers to dates. The semantics are that the integer value is considered a number of days to add or subtract to the date.{    Date d;    // …    d = d + 7; // Seven days later    // …    d…

3

Getting rid of the "Loss of precision" warning message

A question came up at today’s webinar where a developer had a (presumably legitimate) reason to cast a real value into an integer value. The X++ language does not allow explicit casting (there’s no support for it in the language), but the compiler will do its best to satisfy the user and do the conversion on…

1