Dear visitor, welcome to Forum64. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
Private Sub ShowOneLine(ByVal myGraphic As System.Drawing.Graphics, ByVal Zeile As String, ByVal y As Integer, ByVal ShowSpace As Boolean)
Dim lInQuote As Boolean
Dim lRem As Boolean
Dim lData As Boolean
Dim fNrX As Integer
Dim Keyword As String
Dim lLineNo As Boolean
Dim x As Integer
Dim cNr As Integer
Dim fNr As Integer
Dim fNr2 As Integer
Dim lCur As Boolean
Dim Token As Integer
Dim p1 As Integer
Dim p2 As Integer
Dim sProof As String
If EditInfo.FontSize = 8 Then
fNr = 1
Else
fNr = 0
End If
lInQuote = False
lRem = False
lData = False
fNrX = -1
sProof = ""
If EditInfo.IsLabel Then
If Zeile.Trim().Length() > 0 Then
lLineNo = Zeile.Trim().Substring(Zeile.Trim().Length() - 1, 1) = ":"
Else
lLineNo = False
End If
Else
lLineNo = True
If ProofEnabled Then
sProof = EditCalcProof(Zeile, ProofFunction)
End If
End If
fNr2 = 0
lCur = False
For x = EditInfo.OffX To Zeile.Length() - 1
If (x - EditInfo.OffX) < EditInfo.MaxX Then
cNr = Asc(Zeile.Substring(x, 1))
cNr = AsciiToCBM(cNr)
If EditInfo.Inv Then
If x = EditInfo.X + EditInfo.OffX And y = EditInfo.Y + EditInfo.OffY Then
If EditInfo.Insert Then
lCur = True
Else
If cNr > 127 Then
cNr = cNr - 128
Else
cNr = cNr + 128
End If
End If
End If
End If
If EditIsInBlock(x, y) Then
fNr2 = 5
Else
If x <= fNrX Then
fNr2 = 1
Else
fNrX = -1
If lRem Then
fNr2 = 4
Else
If lInQuote Or ((cNr And 127) = 34) Then
fNr2 = 2
Else
' (normal, keyword, string, number, comment, blockmode)
If lData Then
Keyword = ""
If (cNr And 127) = 58 Then
lData = False
End If
Else
Keyword = GetToken(Zeile.Substring(x))
Token = CheckToken(Keyword)
End If
If Keyword = "rem" Then
lRem = True
lLineNo = False
ElseIf Keyword = "data" Then
lLineNo = False
lData = True
ElseIf Keyword <> "" Then
If GetLineType(Token) <> 0 Then
lLineNo = True
p1 = Zeile.Substring(x).IndexOf("=")
If p1 > -1 Then
p2 = Zeile.Substring(x).IndexOf(":")
If p2 = -1 Then
p2 = Zeile.Substring(x).Length()
End If
If p1 < p2 Then
lLineNo = False
End If
End If
Else
lLineNo = False
End If
Else
' If cNr = Asc("'") And EditInfo.IsLabel Then
If cNr = Asc("'") Then
lRem = True
lLineNo = False
End If
End If
If Keyword <> "" Then
fNrX = x + Keyword.Length() - 1
fNr2 = 1
Else
If EditInfo.IsLabel Then
If lLineNo Then
If cNr = Asc(":") Then
lLineNo = False
fNr2 = 0
Else
fNr2 = 3
End If
Else
fNr2 = 0
End If
Else
If (cNr >= 48 And cNr < 58) And lLineNo Then
fNr2 = 3
Else
If lLineNo And (cNr And 127) <> 44 And (cNr And 127) <> 32 Then
lLineNo = False
End If
fNr2 = 0
End If
End If
End If
End If
If (cNr And 127) = 34 Then
lInQuote = Not lInQuote
End If
End If
End If
End If
If (cNr <> 32) Or ShowSpace Then
myGraphic.DrawImageUnscaled(imgChars(cNr, EditInfo.FontNr, fNr, fNr2), (x - EditInfo.OffX) * EditInfo.FontSize, (y - EditInfo.OffY) * EditInfo.FontSize + MinY)
End If
If lCur Then
If cNr > 127 Then
myGraphic.DrawRectangle(Pens.White, (x - EditInfo.OffX) * EditInfo.FontSize, (y - EditInfo.OffY) * EditInfo.FontSize + MinY, 1, EditInfo.FontSize - 1)
Else
myGraphic.DrawRectangle(Pens.Black, (x - EditInfo.OffX) * EditInfo.FontSize, (y - EditInfo.OffY) * EditInfo.FontSize + MinY, 1, EditInfo.FontSize - 1)
End If
lCur = False
End If
End If
Next
If sProof <> "" Then
fNr2 = 3
For x = 0 To sProof.Length() - 1
cNr = Asc(sProof.Substring(x, 1))
cNr = cNr + 128
myGraphic.DrawImageUnscaled(imgChars(cNr, EditInfo.FontNr, fNr, fNr2), (EditInfo.MaxX + x) * EditInfo.FontSize, (y - EditInfo.OffY) * EditInfo.FontSize + MinY)
Next
End If
End Sub
|
|
|
Source code |
1 |
- Unterstützung für D71 und D81 Diskimages |
|
|
Source code |
1 2 3 4 |
Dateilänge Disktype 174848 D64 349696 D71 819200 D81 |
Wobei ich es etwas merkwürdig finde, dass das nicht automatisch vom System umgesetzt wird zwischen "\" und "/", je nach System. Muss mal schauen, ob man irgendwie den Directory-Separator abfragen kann, den das aktuelle System benutzt.
|
|
Quellcode |
1 2 3 |
10 x=rnd(-1963):fori=1to81:y=rnd(1):next 20 forj=1to5:printchr$(rnd(1)*16+70);:next 30 printint(rnd(1)*328)-217 |
Noch ein Nachsatz zu Mono: Hab das gerade mal auf meinem Mac probiert und bin dabei auf folgende Probleme gestoßen:
1. Pfadprobleme - lassen sich durch Vermeiden von .\ und Beachtung von Groß-/Kleinschreibung lösen
2. &H80 kann nicht ausgewertet werden - ließe sich durch eine andere Hex-Dez-Routine lösen
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Module Module1
Public Function Hex2Dec(HexNum As String) As Long
On Error Resume Next
Hex2Dec = Val("&h" & HexNum$)
End Function
Sub Main()
Console.WriteLine("Hello, world!")
Console.WriteLine(Hex2Dec("ff"))
Console.WriteLine(Hex2Dec("7e"))
End Sub
End Module
|
4. Absturz nach Eingabe einiger Tastenkombinationen mit Shift/Ctrl/Alt
5. Die Tastaturauswertung funktioniert nicht wirklich, nur ungeshiftete Zeichen werden erkannt, nicht einmal shift-2 für Anführungszeichen gehen
Und das ist erst der Anfang. So leid es mir für alle Nicht-Windows-User tut, ich lege das erstmal beiseite, um mich weiter um die Funktionalität von BasEdit zu kümmern.
Für abraXxl hier der Source für die ShowOneLine-Routine, an der Stelle mit dem "cNr = Asc(Zeile.Substring(x, 1))" scheint's ihn unter Mono ja zu zerbröseln
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Module Module1
Sub Main()
dim str as String
dim i as Integer
dim c as String
str$ = "Hello World!"
for i = 1 to Len(str$)
c$ = mid$(str$, i, 1)
Console.WriteLine("mid str["& i &"] = "& c & " " & asc( c$ ) )
next i
Console.WriteLine("---")
for i = 1 to str.length()
c$ = Str.SubString(i ,1)
Console.WriteLine("SubString str["& i &"] = "& c & " " & asc( c$ ) )
next i
End Sub
End Module
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
abra@yggdrasil:~/tmp> vbnc foo.bas Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r) Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved. Assembly 'foo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' saved successfully to '/home/abra/tmp/foo.exe'. Compilation successful Compilation took 00:00:00.7944330 abra@yggdrasil:~/tmp> mono foo.exe mid str[1] = H 72 mid str[2] = e 101 mid str[3] = l 108 mid str[4] = l 108 mid str[5] = o 111 mid str[6] = 32 mid str[7] = W 87 mid str[8] = o 111 mid str[9] = r 114 mid str[10] = l 108 mid str[11] = d 100 mid str[12] = ! 33 --- SubString str[1] = e 101 SubString str[2] = l 108 SubString str[3] = l 108 SubString str[4] = o 111 SubString str[5] = 32 SubString str[6] = W 87 SubString str[7] = o 111 SubString str[8] = r 114 SubString str[9] = l 108 SubString str[10] = d 100 SubString str[11] = ! 33 Unhandled Exception: System.ArgumentOutOfRangeException: startIndex + length > this.length Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] at Module1.Main () [0x00000] abra@yggdrasil:~/tmp> |

Quoted
Das ist sehr schade. Aus meiner Erfahrung hat man nachher mehr Schmerz damit, etwas rückzuportieren.
Dann kommen all die kleinen Tücken und Kinken zum Tragen und die Anpassungen daran dauern nochmal so lange wie die ursprüngliche Programmierzeit... Oder man muss vorher schon wissen, was geht und was nicht und kann das dann gleich berücksichtigen. Aber dazu fehlt mir die Zeit und die Lust, mich erstmal in Mono einzuarbeiten.
Quoted
Meine rudimentären Mono/VB.Net Kenntnisse lassen mich auf ein Of-by-One Problem scliessen. Doch waurm passiert dies unter Windows nicht?
|
|
Source code |
1 |
For x = EditInfo.OffX To Zeile.Length() - 1 |
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
... Parameter name: bytes at System.Text.UTF8Encoding.InternalGetBytes (System.Char* chars, Int32 count, System.Byte* bytes, Int32 bcount, System.Char& leftOver, Boolean flush) [0x00000] at System.Text.UTF8Encoding.InternalGetBytes (System.Char[] chars, Int32 charIndex, Int32 charCount, System.Byte[] bytes, Int32 byteIndex, System.Char& leftOver, Boolean flush) [0x00000] at System.Text.UTF8Encoding.GetBytes (System.Char[] chars, Int32 charIndex, Int32 charCount, System.Byte[] bytes, Int32 byteIndex) [0x00000] at Microsoft.VisualBasic.Strings.Asc (Char String) [0x00000] at Microsoft.VisualBasic.Strings.Asc (System.String String) [0x00000] at BasEdit.frmMain.ShowOneLine (System.Drawing.Graphics myGraphic, System.String Zeile, Int32 y, Boolean ... |
Also: Vielen Dank an alle, die sich die Zeit genommen haben, das zu testen - zumindest wissen wir jetzt, das es nicht geht.
|
|
Source code |
1 |
- kleine "Projektverwaltung" eingebaut |

|
|
Source code |
1 2 3 4 |
- ' als Kommentar im Label-Modus wird nicht in den Zeilennummern-Modus übernommen - neuer Switch in Tokenfiles: HasSimpleRem=0/1 - Syntax Highlighting bleibt jetzt auch korrekt erhalten, wenn man nach rechts scrollt - Projektfile um neue Option erweitert: shorten variables |
|
|
Source code |
1 |
A=5 ' IRGENDEIN KOMMENTAR |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
ab=1 ac=2 aber=3 achtung=4 ab$="b" ae$="e" aber$="r" abermals$="m" print ab,ac,aber,achtung print ab$,ae$,aber$,abermals$ |
|
|
Source code |
1 2 3 4 |
10 ab=1:ac=2:ae=3:ah=4 20 ab$="b":ae$="e":a0$="r":ar$="m" 30 printab,ac,ae,ah 40 printab$,ae$,a0$,ar$ |
Quoted
Das Projekt-Öffnen geht bei mir immer schief, wenn das Projekt nicht im gleichen Ordner wie BasEdit liegt.
Quoted
Wäre eigentlich denkbar, eine Art Zeilennummerstart für die generierten Zeilen einzusetzen?
|
|
Source code |
1 2 3 4 5 6 |
'#100,10 (irgendwelche Codezeilen) '#1000,5 (irgendeine Unterroutine) '#2000,5 (noch eine Unterroutine) |
|
|
Source code |
1 2 3 |
- Der mittige waagerechte Strich wird jetzt korekterweise als CHR(96) und nicht mehr als CHR(192) eingefügt über das F2 Character Fenster - Zahlen in wissenschaftlicher Notation werden jetzt erkannt (1E+09) - Erweiterungen an der Erkennung von logischen Ausdrücken in Zusammenhang mit Zuweisungen an numerische Variablen |
|
|
Source code |
1 |
10 A=-(LEFT$(A$,1)="N") |
|
|
Source code |
1 |
- Pfadbehandlung beim Laden/Speichern überarbeitet |
|
|
Source code |
1 2 3 4 5 6 7 |
' base dir for pathes is application directory! ' relativ pathes no longer supported! ' ' Character ROM files will be searched in AppDir\Fonts\ ' Basic Token Files will be searched in AppDir\Basic-Tokens\ ' ASCII tokenizer files will be searched in AppDir\ASCII-Tokenizer\ ' BasEdit.Ini will be searched in AppDir\ |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
Purpose:
Edit Commodore Basic files on the PC with syntax highlighting and support of the full PETSCII character set
Features:
- full featured editor
- unlimited lines
- syntax highlighting
- cut&paste
- search&replace
- insert and overwrite mode
- switch font size small / big
- switch font upper/graphics - lower/upper
- supports special characters for cursor movement and colors in strings
- character window with all 256 PETSCII characters, double-click to insert characters at actual poition
- right-click on a line number to jump to that line
- load and save tokenized BASIC (PRG) files
- load and save PETSCII (untokenized) files
- load and save ASCII files
- with support of different translations for {up}, {down}, {clr} etc.
- BasText
- PetCat
- Tok64
- support for
- host filesystem (= directories on PC)
- diskimages (read & write)
- D64
- D71
- D81 (no partitions)
- attach existing or create empty diskimages
- diskmanager tool integrated
- copy files from / to diskimage
- delete files
- rename files
- change order of files in directory
- copy and paste ASCII blocks via clipboard using the above translations
- supports different Basic dialects
- Basic V2
- Basic V3.5
- Basic V4
- Basic V4/C64
- Basic V7
- Basic V10
- @Basic
- Exbasic Level II
- Wimbasic
- Speech Basic
- Turtle Basic
- Waterloo Structured Basic
- Super Expander
- supports different fonts (VIC-20, C64)
- change load adress of PRG file
- Save&Run file in editor with emulator via F5
- file will be automatically converted from label to line# mode if necessary
- prg file will bes saved (host filesystem or diskimage, wherever it was loaded from)
- depending on the start address of the PRG file special emulators will be automatically selected
--> VIC +3K, PET/CBM series
--> C64
--> VIC unexp, VIC +SuperExpander, Plus/4, C16
--> VIC +8K and more
--> C128
--> CBM II series
- and a setting for a standard emulator if none of the above will be selected
- two different edit modes:
a) line# mode: the classic editing mode with line#
- Renumber feature for the whole program or blocks of line#s
- Auto mode with intelligent numbering when inserting lines between existing lines
- Compact source to squeeze as much commands in one line as possible
- Cross refernce to show all jumps and all usages of variables
- Syntax Check
- Proofreader support for Compute '83 and '86 versions
- import binary data with conversion to data lines and an optional POKE-loop
b) label mode: enhanced editing mode without line# like in modern Basics
- one command per line
- indentation of loops
- special comments with ' (single apostroph) will be ignored when converting to line#
- programs can be converted from/to both modes at any time, substituiton of line#/labels will be done automatically
- project mode
- keeps both edit modes in sync, providing a line# PRG file and a label mode PETSCII file for editing
- when using label mode, variables can be of any length and will be shortened automatically when transforming into line# mode
- shortening of variables keeps track of used variables to avoid double usage (CHECK and CHECK1 will be transformed to CH and CE, for example)
- drag and drop files onto BasEdit icon or onto edit area in running BasEdit will load that file
- free definable keyboard layout
- Basic tokens, ASCII tokenizer, different emulators, colors, fonts etc. can be changed via BasEdit.Ini or special files
|
Forum Software: Burning Board® 3.1.7, developed by WoltLab® GmbH