Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Memory Banks - End Position

Author
Message
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 9th Feb 2015 21:49
Hi people,

I'm wanting to copy multiple text files into the one memory bank that can then be searched. But to copy each text file into the one bank, one after another, is a little trickier than I first thought. Here are the commands I'm looking at;

- MAKE BANK FROM FILE Bank Number, Source Filename, Start Position, Number of bytes

So each text file gets loaded first into it's own memory bank.

- COPY BANK Source Bank Number, Start Position, Size, Target Bank Number, Target Position

And then I copy nBank onto Bank 1. The final size of Bank 1 I think is easy to calculate, that's just the sum of all the text file bytes. So;

Source Bank = nBank
Start Position = 1
Size = Is this in bytes? If so, the size of nBank
Target Bank Number = 1
Position = .... you got me.

I think that I need to identify the end position of each nBank, but the only way I can sudo this is super slow, and it's checking the original text file, not the bank;



I had a look about on the forums but couldn't find too much info covering this. Does anyone have any ideas?

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 9th Feb 2015 23:34 Edited at: 9th Feb 2015 23:44
Maybe datafile size(FileId) ?

There is also map file to bank, to avoid first loading..

All hail the new flesh
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 9th Feb 2015 23:44 Edited at: 9th Feb 2015 23:44
datafile size?

Edit: didn't see the last post.

Le Verdier
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 9th Feb 2015 23:45
In M1U !
DLL 22!

All hail the new flesh
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 10th Feb 2015 01:05
I think I tried this last night, and noted that for ANSI text files that each byte represents a character.

I don't think I'll worry about the other types of txt files. Let's see if I can put something together on the train.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2026-07-05 05:55:04
Your offset time is: 2026-07-05 05:55:04