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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UH OH!!!!!! LINE Input & Large File

Status
Not open for further replies.

devangelista

Technical User
May 14, 2002
12
US
I have some code such as follows:

Open "C:\Somefile.txt" for Input as #1
Line Input #1, Detail$

If the "Somefile.txt" is a large file, it blows up.

Somefile.txt does not have any carriage returns or line feeds and wraps the text so I may have a 2MB file.

How can I grab the first 13 characters encountered of a large text file into a string variable?????

Please Help...

Thanks

Dave ///
 
Use:

DIM string13 AS STRING * 13

Open "C:\Somefile.txt" for Input as #1
Line Input #1, string13

 
Or you could try:

OPEN "qb45qck.hlp" FOR INPUT AS 11
[red]Detail$ = INPUT$(13, 11)[/red]
'
PRINT
PRINT "123456789+123"
PRINT Detail$
PRINT


Obviously the PRINT statements are optional, but I've kept it pretty close to what you have...only a slight modification is necessary. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
"MiggyD" Thank you for your contribution. This worked just perfectly. I've tested the routine with a 3MB file which would have definately honked at me. No problems.

It's amazing how much I have forgotten about a 20 year old programming language but the Federal Reserve Banking system is a MS-DOS based 486 PC and they tell me "Don't even think" of running this stuff on a network or a pentium grade PC because it will blow the Encryption board inside.

qBasic Rocks Again! :)

Thank you trollacious and qbasicking for your posts. I used your suggestions elsewheres in my code.

Best Regards to all and thanks Tek-Tips!

David Evangelista
IT Director / FiNET, Inc.
 
Well at least they allow you to use a 486. I work for a local municipality and their highway department is still using a [machinegun] 386 to read the gas pumps. [cry]

Anyways, I'm glad to have helped. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
"blow the encryption board"?? Sounds fishy, hehe. A modern system could probably even do the encryption without specialized hardware (though they may want to keep it as hardware to prevent people from being able to decrypt files just by stealing the software). If they really must have it as hardware, there are many possibilities. Probably the most realistic one would be for them to just pay the measly cost of having someone design a new encryption board, hopefully one which won't explode if you place it next to a network card ^_^ I just hate the way money beaurocrats think sometimes [thumbsdown]
 
hehe. I guess that did not articulate as I had hoped it would...

The FRB has a new "Windows NT" version but still again, it needs the encryption board. I guess the FED downloads a key to the prom and from there, the software allows files to be sent back and forth. It's a strange system all the way around. The software will not even load if it does not have a printer attached to LPT1 and if it goes offline (for whatever reason!) the software halts until it's back online. Wierd... But nonetheless, I've implemented the above code and my problem with multiple files are fixed. These newsgroups are excellent. This is the second time I used them to post problems and within hours, I've got a solution.

I'm also a programmer but I signed up as a "Technical User". I'd like to change that but I don't see how in my profile to do that, any ideas?

Well, -- anyways -- I can't stand the FRB or any banking establishment but they are a necessary evil (unless I begin stuffing my mattress... :)

Later

Dave ///
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top