I've seen some questions about this but I still don't know the right answers.
You have opened a File variable and are using it to export data from Microsoft Navision. Suppose you execute the following line of C/AL code:
XFile.WRITE('Line No.);
where 'Line No.' is a field of type integer. What is the total number of bytes that will be added to the file due to the above line of code, if 'Line No.' had a value of 1000, and if the TEXTMODE for xFile was set to FALSE
A) 4 bytes
6 Bytes
C) 8 bytes
D) 2 bytes
Somewhere I heard that the correct answer must be C)
If the TEXTMODE was set on TRUE the correct answer must be
I tested this via this code
xfile.WRITEMODE(TRUE);
xfile.TEXTMODE(FALSE);
xfile.QUERYREPLACE(TRUE);
xfile.CREATE('c:\false.txt');
xfile.WRITE('1000');
The size of the dokument was 5 bytes
With this code
xfile.WRITEMODE(TRUE);
xfile.TEXTMODE(TRUE);
xfile.QUERYREPLACE(TRUE);
xfile.CREATE('c:\true.txt');
xfile.WRITE('1000')
The size of the dokument was 6 bytes
Who can Help me with the correct answer to the case (TEXTMODE = FALSE) ?? :shock:
Comments
2) Because Integer is 4 byte, if you have textmode = false, file will have size of SizeOf(Variable) + 1 byte EOF. = 5 bytes
3) If you have textmode = true, the filesize is LENGTH(Variable) + 2 bytes (CR+LF) = 6 bytes in case of value '1000'
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks these where 2 correct answers of my 94% =D>