Binary and Text File

Angelo
Member Posts: 180
I just wanna ask simple question :
What is binary file? Can anyone show me how to implement it in Navision?binary file is used for what?
Please Advise......
What is binary file? Can anyone show me how to implement it in Navision?binary file is used for what?
Please Advise......
0
Comments
-
[Non English text removed by Administrator]Kiki0
-
Every file on your hard drive is made up of binary data, binary data is data comprising of just 2 symbols (01 also known as base 2) as opposed to decimal (0123456789 which is base 10).
We use the decimal system to count from 1 to 10, but the same can be achieved in binary by using only 2 digits.
bin | decimal
00000001 - 1
00000010 - 2
00000011 - 3
00000100 - 4
00000101 - 5
00000110 - 6
00000111 - 7
00001000 - 8
00001001 - 9
00001010 - 10
It's much the same as decimal - just with 2 symbols instead of 10. This is the way computers store data, they work with 1s and 0s.
You may have heard of bits/bytes - a byte comprises of 8 bits - a bit is either a 1 or 0. The maximum number you can represent with 1 byte is 255 in decimal (or FF in hexadecimal which is a base 16 numbering system, often used for specifying colours on the web) which is shown as 11111111 in binary.
When you open a text file on your computer the program that you open it in (notepad maybe) reads this binary data and converts each byte/set of bytes into a character code (called ASCii or American Standard Code for Information Interchange). The program then shows you the binary data as a textual representation. Look at www.asciitable.com for a list of ascii codes (you can see every letter I type here is really converted into a number and stored in the mibuso.com database)
Binary files are useful for storing data such as images and sounds, and maybe streaming in/out your BLOB data types from Navision (which are a binary data type).
You may want to create your own file format to store some particular data, well you can do this in a binary file - then people can't read it easily. (This is not a method of security, it just helps keep things small and compact - you should by no means put sensitive data in a binary file and leave it unencrypted expecting people not to be able to read it)
Look up the InStream and OutStream objects in your C/AL code reference manual for more information on streaming in and out to binary/text files.Charleh0
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