BasEdit.NET

You need an actual VIC.

Moderator: Moderators

Post Reply
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Good work, I find it useful for debug btw Syntax check doesn't work yet, right ?

May I suggest a proofreader function ?
Mega-Cart: the cartridge you plug in once and for all.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

1.01? I thought your plan was to stop on V1.0 :)
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Syntax check will be removed, I think. It simply tokenizes the program and checks if linenumbers exist. It would only report an error if you try to check a source without linenumber or if anything really obscure happens. Something like 10 PRINTFORPRINTI=1OPRINTTO10 would be happily tokenized... Doing a real syntax check would require much more than simply converting PETSCII to tokens...

Proofreader could be done, but is there really any demand. And if so, which proofreader(s) should be implemented?

@Boray: Even the best plans can be busted by circumstances :-)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

New version 1.02 uploaded
- added context menu item "Set start address..." which enables changing of load address of the prg file at any time. Load prg file for unexpanded VIC, set start address to 4609 and save as prg file for VIC with 8k or more memory expansion.
- even better: enhanced the EMU-section in the INI file to support different emulator settings for different start addresses:

Code: Select all

' Emulator settings
' standard emulator, path/exe and commandline (%F=full path to prg file)
Emu=c:\vice\xvic.exe
EmuParams=%F


' special emulator for load address -1 = 1025 --> VIC +3K, PET/CBM series
Emu-1=c:\vice\xvic.exe
EmuParams-1=-config c:\vice\vice_vic3k.ini %F

' special emulator for load address -2 = 2049 --> C64
Emu-2=c:\vice\x64.exe
EmuParams-2=%F

' special emulator for load address -3 = 4097 --> VIC unexp, VIC +SuperExpander, Plus/4, C16
Emu-3=c:\vice\xvic.exe
EmuParams-3=-config c:\vice\vice_vicunexp.ini %F

' special emulator for load address -4 = 4609 --> VIC +8K and more       
Emu-4=c:\vice\xvic.exe
EmuParams-4=-config c:\vice\vice_vicfull.ini %F

' special emulator for load address -5 = 7169 --> C128                   
Emu-5=c:\vice\x128.exe
EmuParams-5=%F

' special emulator for load address -6 =    3 --> CBM II series
Emu-6=c:\vice\xcbm2.exe
EmuParams-6=%F
Place your favourite emulator for your needs her, use Vice for VIC, Emu64 for C64 and Yape for Plus/4 for example!

The emulator to be started with F5 - Save&Run... will be automatically selected upon start address. If start address does not match any predefined address, standard Emu setting (Emu=, EmuParam=") will be used.
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Schlowski wrote:Syntax check will be removed, I think.
... Doing a real syntax check would require much more than simply converting PETSCII to tokens...
I think that a Basic Syntax Check is a real killer application tool... :cry:

Proofreader could be done, but is there really any demand. And if so, which proofreader(s) should be implemented?
The most common was the first 1983 COMPUTE's version for Vic-20 and C64.
Mega-Cart: the cartridge you plug in once and for all.
User avatar
robinsonmason
Vic 20 Enthusiast
Posts: 195
Joined: Sun Mar 14, 2010 9:17 pm

Post by robinsonmason »

Wow, this is impressive. I know nothing of .NET and haven't messed around with programming with CBM Basic for over a decade, but right clicking on the window pulls up a wealth of easy to understand commands.

Nice! I hope the ease of this tool means more people will make more VIC-20 games.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

So the cmb2 has the load address of 3? I have never found any cbm2 programs to test with so there actually is no support for them in PRG Starter (except for the global overrides)...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

So the cmb2 has the load address of 3?
I really don't know for sure, that's what you get if you save with xcbm2 :-) I think it's strange but it doesn't hurt anyway.
I think that a Basic Syntax Check is a real killer application tool...
Problem is this would require a real parser and, to make it worse, this parser must be able to react like different Basic extensions. For example Exbasic/Wimbasic allows to omit THEN in most cases, making 10 IFA=1B=2 a valid command whereas this would cause an error in Basic V2. And I do not have the slightest idea what specialities Waterloo Structured Basic or Simons Basic or other Basic dialects have.
The most common was the first 1983 COMPUTE's version for Vic-20 and C64.
I will take a look at it, thanks for the info.

@robinsonmason: I started BasEdit as a simple to use Basic Editor for the PC as I always find it a little bit uncomfortable to edit bigger Basic programs on the VIC. Even if this means I loose some nostalgic feeling during coding. But the better overview over the source due to the bigger editing area and the ease of running through the source up and down makes up for that loss. At least for me.
User avatar
robinsonmason
Vic 20 Enthusiast
Posts: 195
Joined: Sun Mar 14, 2010 9:17 pm

Post by robinsonmason »

Schlowski wrote: @robinsonmason: I started BasEdit as a simple to use Basic Editor for the PC as I always find it a little bit uncomfortable to edit bigger Basic programs on the VIC. Even if this means I loose some nostalgic feeling during coding. But the better overview over the source due to the bigger editing area and the ease of running through the source up and down makes up for that loss. At least for me.
Thanks for the info Schlowski, I'll blog about it soon. Too good not to share.
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

I'll blog about it soon
:oops: This makes me blush...

One thing I forgot to mention in my update infos: Beside starting BasEdit with a prg file as command line parameter you can simply drag and drop a prg file on the open edit window, this file will then be loaded. Both methods try to recognize tokenized files with .prg extension and detect if PETSCII files include line numbers or not to select the adequate editing mode (line# mode / label mode).
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Schlowski wrote:Problem is this would require a real parser and, to make it worse, this parser must be able to react like different Basic extensions.
I think that a Syntax check for the standard C64/Vic20 Basic V2 version is enough :wink:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

I'm sure Wimoos has a different thinking :wink:
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

nbla000 wrote:I think that a Basic Syntax Check is a real killer application tool...
I think that a Syntax check for the standard C64/Vic20 Basic V2 version is enough :wink:
Ok, I took your word and sacrificed my precious sleeping time for a syntax check.

Some remarks:
1. only works in line# mode
2. requires enhanced tokenfiles, for a first test I enhanced TokenList_BasicV2.txt

Code: Select all

;    syntax = "..." description for syntax-check
;                   t$xx      = token with value $xx
;                   c         = command
;                   f         = function - numeric 
;                   f$        = function - string
;                   <var_any> = any numeric or string variable incl. arrays
;                   <var_num> = any numeric variable (int/float) incl. arrays
;                   <var_str> = any string variable incl. arrays
;                   <var>     = any real variable incl. arrays
;                   <var_any_simple> = any numeric or string variable NO arrays
;                   <var_simple> = any float variable NO arrays
;                   <num>     = any numeric expression (examples: 1, 2+3, 1+b+c(5), LEN(a$))
;                   <num_lit> = numeric literal / constant value (examples: 1, 10) 
;                   <str>     = any string expression (examples "A", LEFT$(A$,1), MID$(A$,LEN(B$)))
;                   <str_lit> = string literal / constant (example: "HELLO")
;                   <log>     = logical expression (examples: I=10, X$<>"")
;                   <skip>    = anything until : or line end
;                   <cmd>     = any command (examples: END, A=5)
;                   <print>   = commandlist for print
;
; sample for if-token
if,       $8B, syntax="c<log>{t$A7<num_lit>|<cmd>}|{t$89<num_lit>}"                                         
3. tested against Videopoker.prg
4. I'm sure there are valid constructs my parser will not recognize -> feedback welcome :-) The Basic interpreter on the VIC has some interesting features I tried to rebuild, but I'm sure I did not find all specialities
5. due to complex structure and urgent need of sleep the following "quirks" have to be solved later:

Code: Select all

; incomplete commands
; print  : everything until : or end of line is valid, no check!
; print# : everything until : or end of line is valid, no check!
; cmd    : everything until : or end of line is valid, no check!
; tab(   : missing check for usage only with print!
; spc(   : missing check for usage only with print!
6. Behaviour by design:

Code: Select all

; special:
; sys    : ignore everything until : or end of line
7. Basic extensions with two-byte tokens should work too - as soon as the tokenfiles are updated
8. Waterloo Structured basic won't work because of special 3-byte tokens, will be implemented later

New version 1.03 uploaded...
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

New version 1.04 uploaded
- Auto number feature added, makes entering programs in line# easier
- Syntax check can be started with shift-F5
- F9 = Save PRG, if filename exists overwrite without question! Good to save every now and then while entering long programs
- fixed bug which prevented start of the specific emulator directly after loading a PRG
- fixed some bugs regarding detection of string expressions for syntax check
- Syntax check: implemented <print> syntax checking, now PRINT "X"A$C+1B$=C$ will be accepted, PRINT"H"NEXT will not

Entered "Tank versus Ufo" from VIC-20 manual with this version and did a successful syntax check :-)

New version 1.05 uploaded
- enhanced string detection for syntax check
- enhanced <log> handling in syntax check
- bug fix: eliminated endless loop in <print> syntax check when encounting unexpected tokens
- if syntax check reports an error, cursor will be placed at offending spot in source

Btw, just made a little tool which scans my *.vb files and counts lines, comments and empty lines resulting in the following values for BasEdit.NET:

Code: Select all

7.204 lines total including
  310 comment lines
  560 empty lines
-----------------------------
6.334 lines of code
As always I'm a little bit short of comments :roll:

The old BasEdit had the following values:

Code: Select all

3.774 lines total including
  210 comment lines
  520 empty lines
-----------------------------
3.044 lines of code
(Both lists only take my handwritten code into account, no automatically generated sources by VB6 or VB.NET for the forms etc.)

Ups, ratio comments / code got worse over the years... Who needs comments? :twisted:

@nbla000: Syntax check occupies round about 1.400 lines of code...
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Schlowski wrote: Btw, just made a little tool which scans my *.vb files and counts lines, comments and empty lines resulting in the following values for BasEdit.NET
Cool! Does it work for any VB.NET project? Can I download it somewhere?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Post Reply