Editing basic on a spectrum

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Editing basic on a spectrum

Post by Wall_Axe »

I'm using an emulator.(USP)
I press shift to get the arrows (cursor keys) but often it prints 8 instead. Does the spectrum do this?

I was pressing inv video and some other things I didn't understand while editing a line.

Then it went into something that seemed like a bug.
No matter what I pressed it did low long beep noises,like an error noise.
Does anyone know what it is?
I can't seem to stop editing this line no matter what I press.
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Editing basic on a spectrum

Post by 1024MAK »

A rubber key does not mistake the 8 key for the cursor arrow. Well, as long as you are actually pressing the shift key…

The plus and 128K/+2 (gray) machines do sometimes produce the wrong character or action if you don’t quite press one of the “extra” keys “just right”. This is due to these keyboards having to make two sets (pairs) of electrical contacts at the same time.

An emulator may get things wrong if it’s processing speed is too slow.

If you have control characters in a BASIC line (and Inverse Video and the colours are control codes) and then delete part of the control code sequence, the syntax checker will not be happy and will buzz a warning. To get out of this, either work out and delete all the remaining control codes. Or just press the EDIT key again to bring the line back from memory (but you will lose any changes you made).

Mark
:!: 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.
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: Editing basic on a spectrum

Post by Bubu »

In a real 48K Spectrum, if you want to edit a line in BASIC you should press CAPS SHIFT and 1, so you edit the selected line
Or if you want to change the selected line, then press CAPS SHIFT and 6, or 7 (down or up)
If something works, don't touch it !!!! at all !!!
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: Editing basic on a spectrum

Post by Turtle_Quality »

I would recommend using BasinC as your Basic editor / monitor - the editor is designed for use on a modern keyboard and it much much easier than using a standard emulator with the original editor (cut and paste helps a lot), plus you can single step through basic programs with windows showing values of variables.

It still insists on correct syntax for a line to be entered though, if you're entering Line 30 and you want to go back to fix a typo in Line 10, well Line 30 needs to be acceptable before you switch line.
Definition of loop : see loop
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Re: Editing basic on a spectrum

Post by Wall_Axe »

Thanks for the answers everyone
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Re: Editing basic on a spectrum

Post by Wall_Axe »

thanks, when i press run it just offers to save the file in its own format and thats it
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: Editing basic on a spectrum

Post by Turtle_Quality »

What editor are you using now BASINC, ZX-Editor or still a standard Spectrum emulator ? Can you send a screen shot ?
Definition of loop : see loop
Wall_Axe
Manic Miner
Posts: 500
Joined: Mon Nov 13, 2017 11:13 pm

Re: Editing basic on a spectrum

Post by Wall_Axe »

That's in reference to zx-editor
User avatar
Alessandro
Dynamite Dan
Posts: 1910
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Editing basic on a spectrum

Post by Alessandro »

You must associate an emulator with the file format you wish to open first.

For example: click on the first icon on the left and choose to create a simple TAP file. Select "no loader" (default) and click on "OK", then in the following window, enter a program name in the box on the right and press "OK". Select "autostart header" and then a program line number if you wish to make the program run automatically from that line, as you would do in Sinclair BASIC with a SAVE "name" LINE command.

In "Tools", select "Options", then "Applications". Click on the icon with a red arrow and the yellow "+" symbol, then from "file format" select the first "Simple tape files" option, so that "TAP" will appear on the right. Click on the box on the right in the "Application" column and select the executable of the emulator you want to use by clicking on the icon with the dots ("..."). Then click on "OK".

From this moment on, every TAP file you create with ZX-Editor will be opened in the chosen emulator when you click on the "run" icon.

For further information, consult the program help by pressing F1 while the program window is in focus, as you would do with any Windows application.
C.Born
Manic Miner
Posts: 235
Joined: Sat Dec 09, 2017 4:09 pm

Re: Editing basic on a spectrum

Post by C.Born »

you should NOT fear your zx and run off to an emulator

this is correct to start with
Bubu wrote: Wed Aug 09, 2023 11:04 pm In a real 48K Spectrum, if you want to edit a line in BASIC you should press CAPS SHIFT and 1, so you edit the selected line
Or if you want to change the selected line, then press CAPS SHIFT and 6, or 7 (down or up)
editing works a bit different then usual.
in 48k MODE !!!

Code: Select all

  10 LET z$="HELLO": PRINT z$
  20 FOR f=23755 TO 23859: LET p=PEEK f
  30 PRINT f;",";p;" > ";: IF p>31 THEN  PRINT CHR$ p;
  40 PRINT : NEXT f: REM 
run above line FIRST and look at the INSIDE off the basic line

now EDIT line 10

move the cursor to the right until you are at the "H"
make "E" and press a key between 1 to 7
make "E" and now press SHIFT 1 to 7
press enter
run

have fun!!
Post Reply