Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

merging two random files

Posted on 1998-10-07
1
150 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

840 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