Solved

Random and Binary mode

Posted on 1998-06-18
2
232 Views
Last Modified: 2010-05-03
What is the essencial diference between Random mode and Bynary mode when i create a file.?
When is the best to use one or the other?
 Regards.

Francisco
0
Comment
Question by:flafee
2 Comments
 
LVL 1

Accepted Solution

by:
redbaron082997 earned 70 total points
ID: 1463658
Random is either read or write. Binary mode allows you to read a file determining the number of bytes read, not the number of characters.
For files opened in Binary mode, all of the Random rules apply, except:

·      The Len clause in the Open statement has no effect. Put writes all variables to disk contiguously; that is, with no padding between records.
·      For any array other than an array in a user-defined type, Put writes only the data. No descriptor is written.
·      Put writes variable-length strings that are not elements of user-defined types without the 2-byte length descriptor. The number of bytes written equals the number of characters in the string. For example, the following statements write 10 bytes to file number 1:

VarString$ = String$(10," ")
Put #1,,VarString$
0
 

Author Comment

by:flafee
ID: 1463659
Thank you, your answer is very helpful !

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now