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

Deploy a Unified Developer Environment (UDE) for D365 F&SCM

Deploying a Unified Developer Environment (UDE) for Dynamics 365 Finance & Supply Chain Management (F&SCM) is a game-changer for d...