Separating information


I would like some help for an issue that I have to solve.
I´m creating an Report to export Clients information to an .txt file in a specific layout.
On the file I have to separate each information using ‘|’.

My problem is to separate the address information because in one field I have two information.

On the Client table I have the address information like: Street ABC, 12345
I have to export to the .txt file = |Street ABC|12345|

I need to find the comma and separate the information before and after it.

How can I do this?


Before exporting use either FINDSTR or STRSUBSTNO function.

Sorry, instead of FINDSTR, it is STRPOS which can be used for finding comma in the string.

From Help:


The STRPOS function only returns the position of the first occurrence of the substring.


This example shows how to use the STRPOS function.

String := Text000;
SubStr := Text001
Pos := STRPOS(String, SubStr);
MESSAGE(Text002 + Text003 + Text004, SubStr, String, Pos);
// The STRPOS function is case sensitive. Furthermore it only
// returns the position of the 1st occurrence of the substring.

Create the following text constants in the C/AL Globals window:

Thanks a lot!!!

Using this tip I could solve my problem.