X++ Programming Language Tutorial guide | YourSite

X++ Programming Language Tutorial guide

Miscellaneous 2761 views

In this blog we will discuss about some X++ programming syntax. Here we will learn how to write comments in x++, X++ Variable, boolean variable, real variable, date variable, str variable, container variable, if statement, if else statement.


X++ Comments

In this section you will that how to write comments in x++ programming language. There are two types of comments available in x++, single line comments and multiline comments. In the below example you will learn both of them.

Code


static void RummanJob1(Args _args)
{
// This is single line comments

    /*

    This
    is
    multiline
    comment
    */
}

In this section we will learn about the three types of messages

Code


static void RummanJob1(Args _args)
{
    // first: how to show information
        info("This is info");
    // Third: How to show warning
         warning("This is warning.");
    // Second: How to show error
        error("This is a error example");
}

X++ Variable

In this section you will learn different types of variables in x++ programming language.

int variable


static void RummanJob1(Args _args)
{
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // Integer variable
      
    int a ; 
    a = 12;
    info(strfmt("%1", a)); 
}

boolean variable


static void RummanJob1(Args _args)
{
       
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // boolean variable     
    
    boolean bo;
    bo = true;
    info(strfmt("%1", bo)); 

}

real variable


static void RummanJob1(Args _args)
{
       
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // real variable     
    
    real realVariable = 12.4333;
    //realVariable = 12.4333;
    info(strfmt("%1", realVariable)); 

}

date variable


static void RummanJob1(Args _args)
{
       
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // date variable     
    
    date dateVariable = 12\02\1996; 
    info(strfmt("%1", dateVariable)); 

}

str variable


static void RummanJob1(Args _args)
{
       
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // str variable     
    
    str  strVariable = "This is a str variable"; 
    info(strfmt("%1", strVariable)); 

}

container variable


static void RummanJob1(Args _args)
{
       
    // In this section we will work on various types of variables in ax
    // Declaration and initialization of a variable
    // Premitive data types
    // container variable     
    
    container  containerVariable =  ["Welcome", 12021996];
    info(conpeek(containerVariable, 1));
    info(conpeek(containerVariable, 2));

}

X++ Decision Making

if statement


static void RummanJob1(Args _args)
{
       
    // if statement in ax example   
    // by Rumman Ansari
    
    int a;
    a = 2; 
    if(a == 2)
    {
        info("Value of a is 2");
    }

}

if else statement


static void RummanJob1(Args _args)
{
       
    // if else example  
    // by Rumman Ansari
    
    int a;
    a = 2; 
    if(a == 3)
    {
        info("Value of a is 2");
    }
    else{
        info("Value of a is not 2");
    }

}

🚀 More Blogs You Might Like

Explore more articles and keep learning

What is Bounce Rate in SEO? Complete Guide for Beginners
search-engine-optimization
What is Bounce Rate in SEO? Complete Guide for Beginners

Learn what bounce rate is in SEO, how it is calculated, why it matters, common causes of high bounce rates, an...

👁 28 2026-05-24
Read More →
Comprehensive Interviewer Guide - Detailed Article
skill
Comprehensive Interviewer Guide - Detailed Article

Learn how to conduct effective interviews with this comprehensive interviewer guide. Explore hiring strategies...

👁 43 2026-05-22
Read More →
Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)
skill
Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)

Five Industry Shifts Reshaping the AI Ecosystem (2026 Trends)...

👁 38 2026-05-19
Read More →
How to Grow Your Business Mindset Step by Step
skill
How to Grow Your Business Mindset Step by Step

Learn how to develop and grow a successful business mindset step by step. Discover entrepreneurial thinking, p...

👁 56 2026-05-09
Read More →