ENTERPRISE KLUB
2019. szeptember 7., 1055 Budapest, Nyugati tér 9. 14-19 óráig
Részletek
Welcome, Guest. Please login or register.


Author Topic: Miscellaneous questions about BASIC (Read 1413 times)

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.103 Chrome 37.0.2062.103
    • View Profile
Miscellaneous questions about BASIC
« 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 ?
Z80 System

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13431
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 31.0 Firefox 31.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Miscellaneous questions about BASIC
« Reply #1 on: 2014.September.12. 09:52:07 »
Try:
 10 EXT "LOAD PCK.EXT"

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #2 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.
Z80 System

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13431
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 31.0 Firefox 31.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Miscellaneous questions about BASIC
« Reply #3 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.

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #4 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 ?
Z80 System

Offline geco

  • EP addict
  • *
  • Posts: 5381
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 24.0 Firefox 24.0
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #5 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.

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #6 on: 2014.September.12. 13:13:27 »
Quote
Oh ...  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.
Z80 System

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #7 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 ?
Z80 System

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #8 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 ?
Z80 System

Offline geco

  • EP addict
  • *
  • Posts: 5381
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 24.0 Firefox 24.0
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #9 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 .

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #10 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 ... :)
Z80 System

Offline geco

  • EP addict
  • *
  • Posts: 5381
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 24.0 Firefox 24.0
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #11 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

Offline Z80System

  • EP addict
  • *
  • Posts: 3895
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 37.0.2062.120 Chrome 37.0.2062.120
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #12 on: 2014.September.12. 14:29:20 »
Quote
If I remember well, you should use EXT "xxx" instead of : from basic program 

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.
Z80 System

Offline geco

  • EP addict
  • *
  • Posts: 5381
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 24.0 Firefox 24.0
    • View Profile
Re: Miscellaneous questions about BASIC
« Reply #13 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 )