.bas cannot run when generated by FILE.APPEND

Here we can discuss about the problem found
Palm Liu
Posts: 47
Joined: Fri Jun 25, 2021 3:50 am
Has thanked: 10 times
Been thanked: 17 times

.bas cannot run when generated by FILE.APPEND

Post by Palm Liu »

I meet the problem when I want to generate a program code "test.bas" using another working program "gen-code.bas", the "test.bas" cannot run until I press the [SAVE] button. I use this method fine on firmware 1.44

gen-code.bas
1.png

test.bas
2.png
You do not have the required permissions to view the files attached to this post.
SteanX
Posts: 39
Joined: Sat Jun 19, 2021 10:33 pm
Has thanked: 17 times
Been thanked: 6 times

Re: .bas cannot run when generated by FILE.APPEND

Post by SteanX »

Just speculating, but perhaps it needs CRLF at the end rather than just CR?
Interesting application though - a machine that writes its own code. Skynet on Annex :-)
User avatar
Electroguard
Posts: 855
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 273 times
Been thanked: 321 times

Re: .bas cannot run when generated by FILE.APPEND

Post by Electroguard »

Hi,
BAS.LOAD is used by a running script lo load and run a different script.

Loads another .bas program and runs it immediately.
Returns 0 if successful or -1 if the file was not found
Example:
Print BAS.LOAD "/test.bas"

This loses all previous programs vars.


If you want lo load and append code to an existing script without losing existing vars you could try executing the appended code using COMMAND cmd$
Palm Liu
Posts: 47
Joined: Fri Jun 25, 2021 3:50 am
Has thanked: 10 times
Been thanked: 17 times

Re: .bas cannot run when generated by FILE.APPEND

Post by Palm Liu »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Mar 27, 2024 7:38 am Just speculating, but perhaps it needs CRLF at the end rather than just CR?
Interesting application though - a machine that writes its own code. Skynet on Annex :-)
Thanks for you info, you are right! When I use CHR$(10) instead of CHR$(13), it work fine!

I do this test because I will use a ST7796 capacitive touch LCD screen & ESP (I will use ESP32 or ESP32-S3) running ANNEX.
Building a simple OS system with program editor, then turn this unit as standy alone ANNEX computer which can write / generate program.

A NANO size APPLE II computer :D :D :D
Palm Liu
Posts: 47
Joined: Fri Jun 25, 2021 3:50 am
Has thanked: 10 times
Been thanked: 17 times

Re: .bas cannot run when generated by FILE.APPEND

Post by Palm Liu »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Mar 27, 2024 8:14 am Hi,
BAS.LOAD is used by a running script lo load and run a different script.

Loads another .bas program and runs it immediately.
Returns 0 if successful or -1 if the file was not found
Example:
Print BAS.LOAD "/test.bas"

This loses all previous programs vars.


If you want lo load and append code to an existing script without losing existing vars you could try executing the appended code using COMMAND cmd$

Thanks for your info, BAS.LOAD is really useful as I want to build a NANO size APPLE II computer using ESP32 with 4" LCD with touch screen.
Of course, it run ANNEX BASIC instead of APLLE II basic :)
SteanX
Posts: 39
Joined: Sat Jun 19, 2021 10:33 pm
Has thanked: 17 times
Been thanked: 6 times

Re: .bas cannot run when generated by FILE.APPEND

Post by SteanX »

Thanks for you info, you are right! When I use CHR$(10) instead of CHR$(13), it work fine!
Glad this worked for you. I actually meant CHR$(13) & CHR$(10), but if just the LF works, great.
A NANO size APPLE II computer :D :D :D
While not having a the 4" capacitive touch screen (which would actually be really nice), this thing below from M5 Stack might also be interesting as a "Nano Apple II Fridge Magent" for you? I'm pretty sure it would run Annex just fine! And you could kindly request CiccioCB to see if adding sound recording for the Mic might be possible in the future :-) JK CiccioCB - I don't think the Apple II could handle sound input anyway :lol:

Image
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: .bas cannot run when generated by FILE.APPEND

Post by cicciocb »

Yes, it looks like a nice gadget @30$ + shipping (and ~50€ on aliexpress).
But only 8MB of flash and not PSRAM.
A little bit expensive for a gadget. :roll:

About the sound, it something that I wish to implement in the future
User avatar
Electroguard
Posts: 855
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 273 times
Been thanked: 321 times

Re: .bas cannot run when generated by FILE.APPEND

Post by Electroguard »

About the sound, it something that I wish to implement in the future

Sound would be a useful addition to Annex
(some interesting audio links...)

Andreas Spiess - ESP32 Audio Tutorial with lots of examples:

Arduino Audio Tools Library: https://github.com/pschatzmann/arduino-audio-tools


DroneBot Workshop - ESP32 Sound - Working with I2S:

ESP32 Walkie-Talkie: DIY Audio Magic using UDP or ESP-NOW:
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: .bas cannot run when generated by FILE.APPEND

Post by cicciocb »

Thanks Robin,
is something that I already saw in the past.
The audio output exists since a lot of time, in particular the I2S (and recently the VS1053B)
What I need to do is to experiment a little bit and understand if is possible to integrate the audio input in a useful way.

Ideally I should implement it as a stream running in background (like the web radio, for example).

In the while, I bought some microphones that I received some time ago.
SteanX
Posts: 39
Joined: Sat Jun 19, 2021 10:33 pm
Has thanked: 17 times
Been thanked: 6 times

Re: .bas cannot run when generated by FILE.APPEND

Post by SteanX »

I think we briefly discussed the I2S input in a previous form post : [Local Link Removed for Guests].
And haha, I also ordered some I2S microphones quite a while ago that I found in a box again the other day. Sad how there never seems to be enough time to get to all those projects one would want to.

What I can say CiccioCB: Annex32 has been a most fantastic prototype tool to get to more of the projects I've always wanted to do, but couldn't find the time for. Thank you for continuing to develop and enhance it. It sortof reminds me of the early days of Windows development where one would use Visual Basic to prototype with the intention of eventually porting it to C++. Except, often the Visual Basic implementation was good enough that it was not feasible to bother rewriting it in C++. Probably way too long ago for anyone to remember :-)
Post Reply