AX2012 X++ code to combine the folder path


// Create a job and paste the below code



static void RB_PathCombine(Args _args)
{
    str         path1 = @"C:\TestDir";
    str         path2 = @"C:\TestDir\";
    str         path3 = "MyFolder";
    str         combination;


    combination = System.IO.Path::Combine(path1, path3);
    info (strFmt("Combinig '%1' with '%2' gives '%3'", path1, path3, combination));

    combination = System.IO.Path::Combine(path2, path3);
    info (strFmt("Combinig '%1' with '%2' gives '%3'", path2, path3, combination));
}

No comments:

Post a Comment