connect 2022 banner tablet connect 2022 banner mobile

亿博电竞新

By Ramesh Singh | March 9, 2016

I was recently working on a customer project where I wanted to use regular expressions to do string comparison in 亿博电竞 AX 2012. The customer wanted to identify the type of card and validate the card from the card number, based on the range of card numbers assigned to the card issuer. We can use regular expression to compare the card number with major providers and derive the type of card and validity of the card number.

Shortcomings in the #define Command

X++ provides several pre-compiler directives that we can use. The directives are processed before the resulting X++ code is given to the X++ compiler. These directives declare and handle macros and their values.

I decided to use the #define command, to store the constant value for regular expression for various card issuers in a macro. I ran into an existing shortcoming in the #define command. When we have closing brackets ‘)‘ in a macro value, 亿博电竞 AX gives a compiler error with the description ‘Syntax error.’

Syntax Error in 亿博电竞 AX

 

Compiler Output Error in 亿博电竞 AX

 

The workaround for this is to use localMacro instead.

  Local Macro in 亿博电竞 AX

 

 

How to use Regular Expression in 亿博电竞 AX

A regular expression is a pattern that the regular expression engine attempts to match in input text. 亿博电竞 AX also provides extensive support for regular expression. Using Regular Expression in 亿博电竞 AX is very simple, due to the ability to call .NET objects from AX.

Regular Expression in 亿博电竞 AX

 

Happy coding!

 

Related Posts

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

亿博电竞
csgo完美世界 加拿大28pc预测神测网 飞鱼电竞下注积分 加拿大28冷号APP计划 lol联赛 大圣电竞开盘