Basic course for newbies

Página 4/11
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9

Por Manuel

Ascended (18788)

imagem de Manuel

22-12-2013, 17:44

nice one, Poltergeist. Although the program does not become very readable Smile But it's nice that you explained all parts. Anyway, perhaps I was out of line anyway for this topic.

As I have plenty of time, I am willing to explain any topics (that I know of) to beginners here. So, please come up with requests.

Por edoz

Prophet (2441)

imagem de edoz

23-12-2013, 14:01

Nice to see all those examples. I think I have an idea to make something. I nice (basic) loader for the playsoniq. There is now a basic loader to load the SMS files into the playsoniq. The current loader display's all the SMS files and after that you have to 'type in the filename' manually you want to load. Maybe I can improve this one. The first thing I was thinking about is to use the cursor key's (or joystick) to select a filename, Instead of type it in manually. Maybe the possibility to change subdirectory's and to save the (last) setting for each game. (60Hz, FM, etc.) . Let's see... how far I can go.. would it be possible to get a screenshot from each SMS rom, maybe from the rom itself ? Or is this not possible ?

First thing I was wondering about. How can I get all the files into a array ? Or is there an other smart way to do this ?

Por ericb59

Paragon (1071)

imagem de ericb59

23-12-2013, 14:23

Hi,

I have some issues about the copy function !
I tried to use it to save array to floppy disk, but I can't load the data in an other program...

For example :
10 DIM A(4):for I=1to4:A(i)=i:next I
20 copy A to "a:data.bin"

it save the array data to a file...
If I clear all, and try this
DIM b(4)
Copy "a:data.bin" to B

It works well, B array is filled with data...

But, when I tried to import the DATA.BIN file in a much bigger Basic program it does'nt work !
Array remains empty ! Why ?

Por edoz

Prophet (2441)

imagem de edoz

23-12-2013, 14:41

Is it not that you have to place the copy command into the NEXT loop ?
But is it not better to save it with the open file command ? (I don't know what you want to save ?)
And B/a is the filename ? not the data itself ?


10 DIM A$(4)
20 A$(1) = "TEST"
30 A$(2) = "TEST1"
40 A$(3) = "TEST2"
50 A$(4) = "TEST3"
60 OPEN "DATA.OUT" FOR OUTPUT AS #1
70 FOR I=1 to 4:PRINT #1,A$(I):NEXT I
80 CLOSE #1
90 END



Por ericb59

Paragon (1071)

imagem de ericb59

23-12-2013, 14:38

I want to save the content of an array to a file, to reload it easily...

Por edoz

Prophet (2441)

imagem de edoz

23-12-2013, 14:43

And to read it use:

open "data.out" for INPUT AS #1

You 'data' is then inside the filename data.out

Por ericb59

Paragon (1071)

imagem de ericb59

23-12-2013, 14:43

Yes edoz, OUTPUT can do the job.
But, COPY can do it also with just 1 instruction...

Por edoz

Prophet (2441)

imagem de edoz

23-12-2013, 14:46

Ok, as I'm a beginner, I'm not aware of this. It looks to me that in your sample you replace the filename and not save data into a file. But .. maybe this is something I also don't know... Wink

Por edoz

Prophet (2441)

imagem de edoz

23-12-2013, 14:49

DIM b(4)
Copy "a:data.bin" to B

So you save with your instruction the complete array, that contains, b(0),b(1),b(2),b(3),b(4) to file a:\data.bin ?
And is this in append mode ?

Por ericb59

Paragon (1071)

imagem de ericb59

23-12-2013, 14:55

Yes
But no append mode.

Página 4/11
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9