Split Strings in Navision

Hi omyvadiya,

What is it that you’re trying to do with this code? Are you trying to parse a string with multiple values, delimited by the pipe character (|), into individual variables whereby each variable would contain the value of one of the values from the source string?

If that’s what you’re trying to do, then consider this. You’re starting with a single variable that contains a string value, and that string value actually represents one or more values. If you’re trying to split the single string into multiple strings, then you need to define the variables (multiple variables) that will contain the results of the split process. So, if your source string has 3 values, then you would need 3 string variables to contain the output of the split process. Looking at your code, you have only a single variable for storing the output from the split process. You have a couple of options for doing this, but the easiest would be to define an array of Text1024 variables, and assign each word that comes out of the split process to an individual array element.

And, since you have the possibility of having more than one word in your source string, you’ll want to build a loop that processes the source string one word at a time until the entire source string has been processed.

That should get you started on your next version of your code. Hope it’s helpful information.