BSAVE-BLOAD?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Pardon me, its late and I'm tiered,.. umm but this program work for you with no errors? I mean taking that you are here, its not... I just know Nek gave me the code and it fixed what I needed... here. If you want a code I know that works well with no errors....

Code: Select all

SCREEN 13
arraySize = 10 * 10 / 2 + 1 
DIM image(arraySize) AS INTEGER 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
DATA 7,7,8,8,8,8,8,8,7,7 
FOR Y = 1 TO 10 
  FOR X = 1 TO 10 
    READ Z 
    PSET (X, Y), Z 
  NEXT 
NEXT
GET (1, 1)-(10, 10), image 
BsaveSize = 10 * 10 + 4 
DEF SEG = VARSEG(image(0)) 
BSAVE "Image.imx", VARPTR(image(0)), BsaveSize 
DEF SEG
Thats for your BSAVE part,.. and ...

Code: Select all

SCREEN 13 
CLS 

arraysize = 10 * 10 / 2 + 1 
DIM SHARED image(arraysize) AS INTEGER 
DEF SEG = VARSEG(image(0)) 
BLOAD "Image.imx", VARPTR(image(0))
:roll: That should work, the only errors would be where I converted mine to yours so if you see Ship1 ne where, well, umm..... ZZZZzzzz :wink: Good luck..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Good morning.

I think I counted to 2000 so I'm better...he he.

Are you saying why is my way better? Righting down the pixels to txt files then GETing them in the main program? Well it was until Nek told us about how to get the size of the array needed, other wise I calculated it out in the program. Well your way is better and I'm going to convert soon as possible.

You know I did a different way of saving them to a file, instead of PSETing them right to the screen I saved them in an array, then PSETed them to the screen in another loop....Of course I neede to do this for the txt files.... But I will change this asap.

Thanks for the code but I'll come up with my own...If everyone took everyone elses code the QB community would suffer cause innovations in coding would slow down because there's no more need for them....I phosiphse a lot....
"But...It was so beutifully done"
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Well my attempt failed, I will try doing it yourway.
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Okay, good luck! :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

For some reason I got a String something something error but I then change the programming, and my tests work now, I will change my programm asap.
"But...It was so beutifully done"
Post Reply