Solved

merging two random files

Posted on 1998-10-07
1
146 Views
Last Modified: 2010-04-30
I would like to merge two random files into a third random file. I am using the get and put statements but I am getting  nowhere. I am using VB4-16bit.
Please show me how to open each of the two files and read each of them into a third file.
Code please..
0
Comment
Question by:dtucker
1 Comment
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1438741
OPEN file1$ FOR BINARY AS #1
OPEN file2$ FOR BINARY AS #2
ON ERROR RESUME NEXT
KILL file3$
ON ERROR GOTO 0
OPEN file3$ FOR BINARY AS #3
'
spin:
buffer$ = SPACE$( 1024 )  ' assume a 1k read
GET #1,, buffer$
IF EOF( 1 ) GOTO ... ' EOF processing
PUT #3,, buffer$
'
buffer$ = SPACE$( 1024 )  ' assume a 1k read
GET #2,, buffer$
IF EOF( 2 ) GOTO ... ' EOF processing
PUT #3,, buffer$
GOTO spin
' =======

Place EOF processing here

CLOSE

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help me. 3 48
MsgBox 4 48
fso.FolderExists("\\server\HiddenFolder$") 4 52
MS Access 03, TransferText, decimal places 8 47
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

26 Experts available now in Live!

Get 1:1 Help Now