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.

Author
Message
Krash
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 30th Oct 2002 00:20
Just wondering if any one knows how to save an array made with a user defined type without making a huge text file to write to... Thanks in advance.
It's all fun and games 'till someone loses an arm...
Viktor
21
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 01:17
Depending on what is inside the array, I would use Momblock Write command.

Viktor
21
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 01:17
Momblock :lol:, sorry, I mean Memblock!

Krash
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 30th Oct 2002 01:45
my data type contains 2 x,y cooridinates for a box.
like this

type boxtype
x1 as int
y1 as int
x2 as int
y2 as int
endtype

dim boxes(100) as boxtype

so how would I go about inputing this data into a memblock?
(if you would be so kind...)

It's all fun and games 'till someone loses an arm...
Viktor
21
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 02:19
I presume, all int typer are positive, so you can define them as WORD... Sorry, but I did not much with User defined Types, so I´m not sure if this will work. I´m primary designing user interfaces.

MAKE MEMBLOCK 1,size
adr=0
WRITE MEMBLOCK WORD 1,adr,x1
WRITE MEMBLOCK WORD 1,adr+2,y1
WRITE MEMBLOCK WORD 1,adr+4,x2
WRITE MEMBLOCK WORD 1,adr+6,y2
inc adr,8
... Loops and other boxes

rem saving
Text 0,460,"Press REC on tape and press any key.":WAIT KEY
OPEN TO WRITE 1,"Myboxes.any"
WRITE MEMBLOCK 1,1
CLOSE 1

Krash
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 30th Oct 2002 02:25
thanks for the help! It works perfectly.

It's all fun and games 'till someone loses an arm...
Viktor
21
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 13:21
Yeah, it is great to help other coders. I have been teached by the best: LDIR (aka LCD).

Login to post a reply

Server time is: 2024-04-19 03:38:33
Your offset time is: 2024-04-19 03:38:33