Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read-write to binary file

Status
Not open for further replies.

chippybippy

Programmer
Oct 18, 2005
1
US
I lost my qbasic book
I want to open a binary file
find a certain string
then insert a qbasic generated number to that string
my program generates the numbers
I need to replace old numbers with them
these numbers would be in specific pixal points if needed the line is partial text with my number to be inserted within
? thanx
chip
 
'one way as long as the file is not too awfully large
open "mybin.fil" for binary as #1
a$=space$(lof(1))
Get #1,,a$
L%=instr(a$,certain.string$)
if L% then
b$=mid$(a$,1,L%-1)+"123"+mid$(a$,L%+1)
else
b$=a$
end if
close #1
open "mybin.fil" for output as #1
print #1,b$;
close #1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top