Search found 19 matches

by alowe
Sat Apr 15, 2023 9:28 am
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

This is a very simple line editor. It does not have a cursor and the only editing keys are RUBOUT and NEWLINE. For it to run quickly, it needs to be at the very start of the BASIC program. So replace line 10 with 10 GOTO 100, add 90 RETURN, then call it using GOSUB 20. And put your program after it...
by alowe
Sat Apr 15, 2023 2:54 am
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

Yes, I already did this but it was so slow even after optimising it as far as possible. I managed to write a really elegant solution but the problem was that printing the output after each keypress took 90% of the execution time. It made the program unusable so I tried it with INPUT instead and tha...
by alowe
Sat Apr 15, 2023 2:53 am
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

Added a couple more changes and ran out of memory with 48k. :oops: So now have to retype the whole program again after enabling RAM in 8k-16k and figuring out how to use that again. If you write your program in Basic, and run out of memory, then enabling RAM in 8-16k won't help. Basic does not use ...
by alowe
Fri Apr 14, 2023 10:49 pm
Forum: Emulators
Topic: Serious issue with EightyOne emulator
Replies: 6
Views: 3002

Serious issue with EightyOne emulator

The issue is, you can set the hardware, like with a printer, enable RAM in 8k to 16k etc, and save a snapshot and reload it. Your basic program is there but there's about a 1 in 20 chance your hardware settings will be reset to defaults. The program is still there, but if you change the settings bac...
by alowe
Wed Apr 12, 2023 2:44 pm
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

3EEDDE32-20D6-42D9-B9EA-CE072553E466.png At the input enter A You can enter variables as value, so also its own value I wish it was that easy. :cry: E.g. 1 LET A$="SUM(A1,A20)" 2 INPUT A$ 3 PRINT A$ upon running the input displays "", not the value of A$, so it cannot be edited, only inputted afres...
by alowe
Wed Apr 12, 2023 2:24 pm
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

Or you can build your input routine using INKEY$. Yes, I already did this but it was so slow even after optimising it as far as possible. I managed to write a really elegant solution but the problem was that printing the output after each keypress took 90% of the execution time. It made the program...
by alowe
Tue Apr 11, 2023 6:25 pm
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

Are you input numeric or string? Both ways it's possible to use a variable as input. For Example input a$ gives "" work cursor between the double quotes. Delete the double Quotes and enter A$, the A$ is used for input a$ and it's not lost It's a string that is then parsed and evaluated as either a ...
by alowe
Tue Apr 11, 2023 6:10 pm
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Re: Is is possible for INPUT to have a default value?

As far as I remember, the INPUT text is stored in BASICs temporary workspace. As this is used for other things and is dynamic, I don’t think you can store text here before calling INPUT. At least, not from BASIC. My workaround would be to hold the existing data in one variable. Then use INPUT with ...
by alowe
Tue Apr 11, 2023 8:19 am
Forum: ZX BASIC
Topic: Is is possible for INPUT to have a default value?
Replies: 19
Views: 6929

Is is possible for INPUT to have a default value?

I have a program in which formulae are stored in a table that are edited using the INPUT statement. I had successfully implemented my own input management to support ZX81 math functions, but it just got too slow. So I have gone back to using the INPUT statement which is much simpler and quicker. Whe...
by alowe
Fri Apr 07, 2023 1:57 am
Forum: ZX BASIC
Topic: Increase screen size to 24 rows
Replies: 2
Views: 1021

Re: Increase screen size to 24 rows

Thankyou. Your answer is simpler than my question. :D And I like how it pokes 2 back into DF_SZ to return to default before the program ends. Nice. I should read the manual but just use it for reference cause my memory is so poor these days, even if I read a page, it's lost before I get to the next ...