Sizes of files when textmode are False or TRUE

wwestendorp
Member Posts: 178
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:
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

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:
0
Comments
-
of posting it in the existing developer one ](*,)0
-
1) Integer is 4byte (max value 2,147,483,647 = 0x7FFFFFFF = 4 bytes)
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'0 -
kine wrote:1) Integer is 4byte (max value 2,147,483,647 = 0x7FFFFFFF = 4 bytes)
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'
Thanks these where 2 correct answers of my 94% =D>0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions