getting c nonsense in basic when trying to load a program through a string in +3 basic

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

strangely if i use load s$(to 8), it says nonsense in basic but works when i run it. but when i execute the command without a line no it works without an error. why is this?
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
+3code

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by +3code »

?
To me both runs without error
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by PeterJ »

777 wrote: Sun Aug 02, 2020 2:25 pm strangely if i use load s$(to 8), it says nonsense in basic but works when i run it. but when i execute the command without a line no it works without an error. why is this?
Post a screenshot.
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

PeterJ wrote: Sun Aug 02, 2020 2:55 pm
777 wrote: Sun Aug 02, 2020 2:25 pm strangely if i use load s$(to 8), it says nonsense in basic but works when i run it. but when i execute the command without a line no it works without an error. why is this?
Post a screenshot.
https://www.picpasteplus.com/v.php?i=cdcc1baf1c

now its saying end of file found
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by PeterJ »

Do a screen grab of the output of the program and s$ when you run it as it was originally written.
+3code

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by +3code »

777 wrote: Sun Aug 02, 2020 3:34 pm
PeterJ wrote: Sun Aug 02, 2020 2:55 pm Post a screenshot.
https://www.picpasteplus.com/v.php?i=cdcc1baf1c

now its saying end of file found
"Image does not exist"
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

PeterJ wrote: Sun Aug 02, 2020 3:37 pm Do a screen grab of the output of the program and s$ when you run it as it was originally written.
https://www.picpasteplus.com/v.php?i=da2f960375
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

+3code wrote: Sun Aug 02, 2020 3:39 pm
777 wrote: Sun Aug 02, 2020 3:34 pm https://www.picpasteplus.com/v.php?i=cdcc1baf1c

now its saying end of file found
"Image does not exist"
its working
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

PeterJ wrote: Sun Aug 02, 2020 2:55 pm
777 wrote: Sun Aug 02, 2020 2:25 pm strangely if i use load s$(to 8), it says nonsense in basic but works when i run it. but when i execute the command without a line no it works without an error. why is this?
Post a screenshot.
here it is again

https://upload.picpaste.me/image/iujYP
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

PeterJ wrote: Sun Aug 02, 2020 3:37 pm Do a screen grab of the output of the program and s$ when you run it as it was originally written.


here again...

https://upload.picpaste.me/image/iuQIx
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
+3code

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by +3code »

777 wrote: Mon Aug 03, 2020 12:30 am
PeterJ wrote: Sun Aug 02, 2020 2:55 pm Post a screenshot.
here it is again

https://upload.picpaste.me/image/iujYP
I don't see the "nonsense in basic" error with that code.
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by PeterJ »

Do you not need double quotes around the filename [mention]777[/mention]

Your code would I imagine result in:

Code: Select all

LOAD E
Rather than

Code: Select all

LOAD "E"
Which I imagine is why you are getting nonsense in basic.
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 1024MAK »

:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
+3code

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by +3code »

PeterJ wrote: Mon Aug 03, 2020 6:33 am Which I imagine is why you are getting nonsense in basic.
I don't obtain any error with the code he posted.
User avatar
777
Manic Miner
Posts: 512
Joined: Fri Jun 26, 2020 11:23 am
Location: sw uk

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by 777 »

+3code wrote: Mon Aug 03, 2020 12:11 pm
PeterJ wrote: Mon Aug 03, 2020 6:33 am Which I imagine is why you are getting nonsense in basic.
I don't obtain any error with the code he posted.
its ok i think ive sussed it. u cant load or merge anything when you have a program running. although you can save.
i started programming the spectrum when i was 8 :-

1 plot rnd*255,rnd*175
2 goto 1
+3code

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by +3code »

777 wrote: Tue Aug 04, 2020 1:15 am
+3code wrote: Mon Aug 03, 2020 12:11 pm I don't obtain any error with the code he posted.
its ok i think ive sussed it. u cant load or merge anything when you have a program running. although you can save.
Ok, now I understand what you mean :D

The BASIC file to be loaded must be saved first as auto-run (with LINE), so all runs ok.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by Joefish »

I think someone should write a 'C' compiler that reports:

Code: Select all

Error: Basic nonsense in C
:lol:
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: getting c nonsense in basic when trying to load a program through a string in +3 basic

Post by PeterJ »

Joefish wrote: Tue Aug 04, 2020 11:33 am I think someone should write a 'C' compiler that reports:

Code: Select all

Error: Basic nonsense in C
:lol:
Slightly off topic, but this is a fun version of C:

https://lhartikk.github.io/ArnoldC/

This is an example of the syntax:

Code: Select all

IT'S SHOWTIME
TALK TO THE HAND "hello world"
YOU HAVE BEEN TERMINATED
Post Reply