Axapta 2009 : Split, Export แบ่งคำด้วย String
- static void Job1(Args _args)
- {
- str paramAsStr = "Value 1|Value 2|Value 3";
- container paramAsCon;
- int i;
- paramAsCon = str2con(paramAsStr, "|");
- for (i=1;i<=conLen(paramAsCon);i++)
- {
- info(conPeek(paramAsCon, i));
- }
- }
ส่วน Version 2012 เป็นต้นมามี Function 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());
- }
- }
https://www.schweda.net/blog_ax.php?bid=628&wdl=en
No comments:
Post a Comment