Welcome at schweda.net | EN | DE
 
 
 
 
 
This post is machine-translated. The original post in german language can be found here.

The following snippets are meant to show how to extract the individual elements from a string with fixed separators.

Variant 1: Convert the string to a container using str2con()

static void Job1(Args _args)
{
    str paramAsStr = "Wert1@@Wert2@@Wert3";
    container paramAsCon;
    int i;

    paramAsCon = str2con(paramAsStr, "@@");
    
    for (i=1;i<=conLen(paramAsCon);i++)
    {
        info(conPeek(paramAsCon, i));    
    }
}


Variant 2: Convert the string to a list using strSplit()

static void Job1(Args _args)
{
    str paramAsStr = "Value 1|Value 2|Value 3";
    List paramAsList;
    ListEnumerator le;

    paramAsList = strSplit(paramAsStr, "|");
    
    le = paramAsList.getEnumerator();
    while(le.moveNext())
    {
        info(le.current());    
    }
}

 

These post applies to following versions:
Dynamics AX 2012

Add comment

 

 
Feeds
RSS RSS feed
RSS RSS feed (Comments)
RSS RSS feed (Category)
 
 
posts of the actual month
Dezember 2018
MoDiMiDoFrSaSo
 12
3456789
10111213141516
17181920212223
24252627282930
31 
 
 
© 2006-2018 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.