Enterprise Forever

:UK => Programming => Topic started by: Z80System on 2014.September.11. 23:46:21

Title: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.11. 23:46:21
I would like to load an exos extension by code, in basic.

When I do it in command mode:

run "pck.ext"

then the extension is loaded well,

but when I try to do it in a program:

10 run "pck.ext"
run

then insufficient memory error occurs,
and after that, the
:help
will list the extension strings many times,
not only once.

How can I load an exos extension module by basic program ?
Title: Re: Miscellaneous questions about BASIC
Post by: Zozosoft on 2014.September.12. 09:52:07
Try:
 10 EXT "LOAD PCK.EXT"
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 11:16:07
Quote
 10 EXT "LOAD PCK.EXT"
The LOAD executed only in command mode.

I think only the RUN can load an EXOS module in a BASIC program.

But after the loading, the basic program restarts ... I do not know why ... Because I load the pck.ext at the beginning of the program, it will be a loop till I have memory to load the ext.
Title: Re: Miscellaneous questions about BASIC
Post by: Zozosoft on 2014.September.12. 11:17:49
Quote from: Z80System
The LOAD executed only in command mode.
The BASIC LOAD, but I suggested the EXDOS LOAD command.
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 11:22:17
Quote
The BASIC LOAD, but I suggested the EXDOS LOAD command.
Oh ... :oops: I'm blind ... I will try.

And why does the BASIC LOAD restart the program ?
Title: Re: Miscellaneous questions about BASIC
Post by: geco on 2014.September.12. 13:13:22
Quote from: Z80System
And why does the BASIC LOAD restart the program ?
I think the reason is that, the program is loaded by RUN "xxxx" and when loading is finished BASIC interpreter wants to start it, and in your case you loaded an extension which did not overwrite your basic program, so 10 RUN "xxxx" remained in the memory, and it went to forever loop.
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 13:13:27
Quote
Oh ... (http://enterpriseforever.com/Smileys/phpbb/ds_icon_redface.gif) I'm blind ... I will try.


Hmmm ... I tried it ...

With the EXDOS LOAD way, there is no BASIC program restart.

But after that the :FILE call to the PCK.EXT (also form the BASIC program) does not work well.

I get a wrong string back form the :FILE call.

When I use the RUN loading, the :FILE call works well.
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 13:19:30
Quote
I think the reason is that, t
Yes, it is interesting and sounds logical,

but why does the BASIC RUN not realize that the file is not a BASIC program, and not restarting ?
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 13:21:18
Quote
But after that the :FILE call to the PCK.EXT (also form the BASIC program) does not work well.
Maybe is it some correspondence with the BASIC ALLOCATE functionality ?
Title: Re: Miscellaneous questions about BASIC
Post by: geco on 2014.September.12. 13:23:21
Quote from: Z80System
but why does the BASIC RUN not realize that the file is not a BASIC program, and not restarting ?
Possibly it is not checked, because normally BASIC programs are loaded and started with RUN "xx" command .
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 13:48:25
Quote
Possibly it is not checked, because normally BASIC programs are loaded and started with RUN "xx" command .
Okay, maybe the RUN is not intended to load other types of modules than BASIC,

but in this case, the EXDOS LOAD way, suggested by zozo would have to work ... :)

And that does not restart the program, but does not work, either ... :)
Title: Re: Miscellaneous questions about BASIC
Post by: geco on 2014.September.12. 14:26:55
Quote from: Z80System
Okay, maybe the RUN is not intended to load other types of modules than BASIC,

but in this case, the EXDOS LOAD way, suggested by zozo would have to work ... :)

And that does not restart the program, but does not work, either ... :)
If I remember well, you should use EXT "xxx" instead of : from basic program :D
Title: Re: Miscellaneous questions about BASIC
Post by: Z80System on 2014.September.12. 14:29:20
Quote
If I remember well, you should use EXT "xxx" instead of : from basic program (http://enterpriseforever.com/Smileys/phpbb/ds_icon_biggrin.gif)

Yes, the loading working well, the :FILE call does not work, and that call is the same, in both situations ... only the loading is different. I did not use : in EXT lines, of course.
Title: Re: Miscellaneous questions about BASIC
Post by: geco on 2014.September.12. 14:35:46
Quote from: Z80System
Yes, the loading working well, the :FILE call does not work, and that call is the same, in both situations ... only the loading is different. I did not use : in EXT lines, of course.
Then I do not have idea, I used once loading extension and start it from Basic program ( VLOAD , and it worked well )