I would like to show a message using the function Confirm() or Error() that would include the full name of a file (i.e. disk, path, file name). Unfortunately, in those functions, the \ character is seen as a request to go to the next line in the message… So, when I try the following code, ERROR(‘Unable to find file c:\tmp\toto.txt’); I get a message looking line Unable to find file c: tmp toto.txt instead of Unable to find file c:\tmp\toto.txt Does anyone know how I can seen \ as a normal character in those functions??? Is it possible or not? If only the Navision c/side reference guide could be more explicit on how special characters can be used as normal characters… PS: I’ve already tested ERROR(‘Unable to find file c:\tmp\toto.txt’); // C like but it does not work… I have the similar question on the use of * and ? in filter expression… How is it possible to find all expressions in which a * character appears, or a ? character. How is it possible to make the difference between the use of those characters as wildcards and the use a normal characters. If you have the answer, please forward… Thanks a lot. Jean-Christophe Lamotte
To print backslash in a message You can use following sintax: message( ‘%1’, ‘Text\text’ ); To search for value containing * or ? use setrange, not setfilter. Best regards, Otto Dreyer NRG Ltd.
When you are keying in a filter, you can quote the whole string (ex, ‘AT&T’), but you cannot quote a chanracter. Navision US recommends that filter characters be avoided in data fields. Personally, I think it’s a design flaw that they did not include a quote/escape character. -jp Edited by - jp on 2/28/00 9:20:16 PM
Thanks to those who answered. I would summarize the solution to the problem as follows… The rule for using \ character as a normal character in functions using the \ character as line separator (i.e. Message(), Error(), Confirm(),…), seems to be the following: - all \ characters appearing directly in the first parameter of the function (the string parameter) will be interpreted as a request to go to the next line in the message. - all \ characters included in the possible value1, value2, etc. parameters will treated as normal characters. Example 1: Message(‘File deletion\Are you sure you want to delete file c:\tmp\myfile.txt ?’); will give the message File Deletion Are you sure you want to delete file c: tmp myfile.txt ? Example 2: Message(‘File deletion\Are you sure you want to delete file %1 ?’,‘c:\tmp\myfile.txt’); will give the message File Deletion Are you sure you want to delete file c:\tmp\myfile.txt ? Example 3: tMyFileName := ‘c:\tmp\myfile.txt’; Message(‘File deletion\Are you sure you want to delete file %1 ?’, tMyFileName); will give the message File Deletion Are you sure you want to delete file c:\tmp\myfile.txt ?