Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

merging two random files

Posted on 1998-10-07
1
Medium Priority
?
167 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
[X]
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
1 Comment
 
LVL 12

Accepted Solution

by:
mark2150 earned 150 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

636 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