The code above creates the following message:
Microsoft Business Solutions-Navision
Type conversion is not possible because 1 of the operators contains an invalid type.
Text + Char
OK
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005
For cemkaraer: In general when you need to convert something to text, you can almost always use the FORMAT command. Works with chars, integers, decimals, dates and so forth.
Comments
Create a txt variable
MyEndLine[1] := 10;
MyEndLine[2] := 13;
in your code MyFile.write('your text'+MyEndLine);
If you set the MyFile.TEXTMODE(true);
Navision will add this so you don't have to.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Dynamics NAV Developer since 2005
They need to be of the type "char" instead. And you probably need to do like this instead:
MyFile.write('your text'+MyEndLine[1] + MyEndLine[2]);
David
PS. By the way, the 10 and 13 are the ASCII numbers for carriage return and line feed. That's why they change line for you :-)
Microsoft Business Solutions-Navision
Type conversion is not possible because 1 of the operators contains an invalid type.
Text + Char
OK
Dynamics NAV Developer since 2005
Thank you for the correction :-)
For cemkaraer: In general when you need to convert something to text, you can almost always use the FORMAT command. Works with chars, integers, decimals, dates and so forth.
-David
MyEndLine is not an array. It's text type. And text is an array of characters.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n