loadFile method - New Method

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

loadFile method - New Method

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:27 pm

by JADE Kid - Ray Hidayat >> Tue, 4 Jul 2000 21:44:10 GMT

I discovered at the JADE plant, in front of all the other JADE Kids, that JADE can't load large files using a command like this:
fileTrans.info := file.readBinary (file.fileLength);
How embarrassing.
It always comes up with an error that says something, but I can't remember it.

So I redesigned it to read it in chunks that are 64k - 1 (65535) long. But still, it comes up with an error (a different one. Not enough cache or something), so I redesigned it, so as it reads all the chunks, it begins and ends a transaction.
But still, it comes up with the same error.
So I have came up with a solution.
You have loadPicture, so why not have loadFile.
Then I wouldn't have to write so much not-working code.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: loadFile method - New Method

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:28 pm

by Michael Jones >> Tue, 4 Jul 2000 22:13:16 GMT

How big was this file?
I've tested 4mb files with no problems. For memory/performance reasons you shouldn't really be dealing with chunks anywhere near this size, so i can't see
a problem with this.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: loadFile method - New Method

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:28 pm

by JADE Kid - Ray Hidayat >> Wed, 5 Jul 2000 21:30:04 GMT

I can't even remember which file I put in. Or how big it was. It was probably at least 1 MB

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: loadFile method - New Method

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:28 pm

by Craig Shearer >> Tue, 4 Jul 2000 23:19:58 GMT

I suspect your problem was probably due to cache sizing. You need at least as big a cache as the file you're trying to read in.

Craig.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: loadFile method - New Method

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:28 pm

by JADE Kid - Ray Hidayat >> Wed, 5 Jul 2000 21:30:36 GMT

Well, I divided it into chunks, still I get problems.
Plus it is a lot slower.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 28 guests