Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 414 online users. » 0 Member(s) | 412 Guest(s) Bing, Google
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 184
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 258
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,520
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 512
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 414
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 286
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,012
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,849
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 394
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,422
|
|
|
Color control codes |
Posted by: LCD - 05-21-2009, 01:37 PM - Forum: ZX Basic Compiler
- Replies (7)
|
 |
Hallo boriel, you wrote, the control codes can be used like in BasIn, I tested it:
Code: print at 0,0;"\{i7}\{p2}\{b1}Test"
works fine, but BasIn allows this too:
Code: print at 0,0;"\{i7p2b1}Test"
which does not work. Is this a bug?
Quote:The escape sequences for control characters are as follows:
\{in}
Ink colour n, where n is in the range 0 to 7.
\{pn}
Paper colour n, where n is in the range 0 to 7.
\{bn}
Bright n, where n is 0 or 1.
\{fn}
Flash n, where n is 0 or 1.
Note: Control character escape sequences can be combined, so that for instance \{i6p1f1} is equivalent to \{i6}\{p1}\{f1} - flashing yellow ink on blue paper.
Btw: Release 1.2.1 is excellent. My latest test Program needed 8 Kb before, now it is only 4 Kb...
|
|
|
Bug: String Slicing (*solved*) |
Posted by: britlion - 05-19-2009, 07:42 PM - Forum: Bug Reports
- Replies (7)
|
 |
I think string slicing still has bugs in it. Not quite sure why this fails, but it produces code that runs briefly and crashes, running in Spectaculator:
(fails with or without the DIM statements, but crashes differently in each case)
Code: DIM A$,p$ as string
DIM start,fin as integer
10 LET a$="This is a very long scrolly string that I am going to print"
20 LET start=1
30 LET fin=32
40 LET p$=a$(start TO fin)
50 LET start=start+1
60 LET fin=fin+1
70 IF fin>LEN a$ THEN LET fin=1 : END IF
80 IF start>LEN a$ THEN LET start=1 : END IF
90 PRINT AT 0,0;p$
100 IF start<fin THEN GO TO 40 : END IF
110 LET p$=a$(start TO )+a$( TO fin)
120 GO TO 50
Correcting the 1 to Zero (Since in compiled code the strings begin slicing at zero) has no effect other than change the way it crashes:
Code: DIM A$,p$ as string
DIM start,fin as integer
10 LET a$="This is a very long scrolly string that I am going to print"
20 LET start=0
30 LET fin=31
40 LET p$=a$(start TO fin)
50 LET start=start+1
60 LET fin=fin+1
70 IF fin>LEN a$ THEN LET fin=0 : END IF
80 IF start>LEN a$ THEN LET start=0 : END IF
90 PRINT AT 0,0;p$
100 IF start<fin THEN GO TO 40 : END IF
110 LET p$=a$(start TO )+a$( TO fin)
120 GO TO 50
|
|
|
STR problem (*solved*) |
Posted by: LCD - 05-11-2009, 01:19 PM - Forum: Bug Reports
- Replies (12)
|
 |
Code: SUB MeineRoutine(x as uinteger,y as uinteger,a$ as string)
IF a$="Test" THEN erg$="Es wurde nur getestet"
ELSE erg$=a$+str(x)+" "+str(y)
end if
PRINT erg$
END SUB
MeineRoutine(30,11,"Hallo")
Compiler claims "temp.bas:48: Error: Undefined label '_MeineRoutine_erg' Errors occured, compilation failed" (No line 48 defined)
I guess, this is a Problem with STR because this:
Code: dim a as ubyte
a=20
print str(a)
Produces a code that crashes the Emulator
BTW: should POKE STRING adr,string$ work? I mean, if POKE UINTEGER works...
|
|
|
Memory Map |
Posted by: LCD - 05-11-2009, 12:22 PM - Forum: Wishlist
- Replies (9)
|
 |
As mentioned on WOS:
A idea for the future version: How about the compiler generating a text file with memory map (not very complex... or with selectable level of detail) I think, something like:
25000-45678 : Main Program
45679-52111 : ASM: Label GRAPHICSDATA
52112-59876 : ASM: Label LevelData
59877-60521 : Variables
or:
25000 : Main Program
45679 : ASM: Label GRAPHICSDATA
52112 : ASM: Label LevelData
59877 : Variables
Level of Detail:
0=Only Program and Variables
1=like 0, but additionaly ASM Labels
2=like 1, but additionaly Basic Labels
3=like 2, but adresses of every used variable added (HiSoft Basic Compiler does this too, this will make it easier to alter or read variables of compiled programs from BASIC Loader for example)
Using a switch like -m level, -M "Filename.txt" or similar (I do not know how the parser works, maybe this can be joined into a single switch)
Memory map can then be parsed by the editor, or the user can check the details.
|
|
|
Found another bug (*solved*) |
Posted by: LCD - 05-11-2009, 11:58 AM - Forum: Bug Reports
- Replies (1)
|
 |
Hi Boriel,
Code: dim a$ as string
a$="This is a test"
print a$
print a$( to 4)
print a$(5 to)
This works, but
Code: dim a$ as string
a$="This is a test"
print a$( to 4)
print a$(5 to)
This claims "Variable a never used" and compiler stops (version 1.1.9)
Edit: Btw: should POKE STRING adr,string$ and string$=PEEK STRING adr work?
|
|
|
|