Good morning everybody,
I would please need your help to sort out a little problem:
I am automatically generating file names in NAV 4.0 for external files which should look like this:
Date_SeqNR_Name.Extension e.g. 20060426_01_Test.txt
Problem is: I cannot combine the string-parts as Date is Type Date, SeqNr is Type Integer and Name + Extension are Strings. (Text)
Is there any way of converting data types in C/AL ? Like the parsing e.g. in Java ?
sorry, maybe my question is really simple, but I couldn t find a solution for it yet...
many thanks in advance
cheers,
mp
... I am not a programmer, I just write code.
Answers
Withe that fct, you could make something like :
FileName := STRSUBSTNO('%1%2%3_ .......',DATE2DMY(WORKDATE,3),
DATE2DMY(WORKDATE,2),
..... );
// MyStr := FORMAT(TODAY,0,'<Day,2><Month,2><Year,2>');
// MESSAGE(FORMAT(TODAY,0,'<Day,2><Month,2><Year,2>'));
If you need to add a special space character say underscore you can use it like this
// MyStr := FORMAT(TODAY,0,'<Day,2>_<Month,2>_<Year,2>');
So yours would be
MyStr := STRSUBSTNO('%1_ %2_%3.txt',FORMAT(TODAY,0,'<Year,4><Month,2><Day,2>'),FileCounter,Filename);
Giving 20060427_1_Myfile.txt
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
works fine \:D/
thank you so much !
cheers, manu