BasEdit.NET

You need an actual VIC.

Moderator: Moderators

User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Re: BasEdit.NET

Post by Gurce »

Thanks for the tips on paypal donate buttons, your enthusiasm is getting infectious, I'll try have a fiddle with the sourceforge site soon :)

As for how to build/run, I had a few suggestions in this blog post:

http://sourceforge.net/p/baseditnet/blo ... -the-code/

The path I chose was the free-version of Visual Basic 2010 (Express version = free).

The download-size wasn't too prohibitive (maybe a few hundred megs ;)).

After it installs, just open up the project within the IDE and press F5 key, which will automatically do any re-builds (if you edited any files), and will run the program.

The IDE is fairly nice and friendly, able to add breakpoints and step through code, code-completion suggestions as you type keywords/function-names.

But if you're more of a keyboard junkie that shuns pretty IDEs (;)), perhaps there is a path in that direction too. I'm thinking it would require an install of just the .NET 3.5 SDK, which comes with the "MSBUILD.EXE" compiler/builder.

So then you could build it with something like this:

c:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe BasEdit.sln /p:Configuration=Release

or:

c:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe BasEdit.sln /p:Configuration=Debug
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

Have a look tomorrow, I think I've had some Visual Basic downloaded once for some USB project involving PIC-processor...
Should maybe sleep a little...
My other interest: http://channelf.se
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

Downloaded M$ VB 2010 Express, installed, made the changes to TAB and Indent... Also got TortoiseHg... But I currently don't know how to fetch the code from sourceforge.
My other interest: http://channelf.se
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Re: BasEdit.NET

Post by Gurce »

Can you make an account on sourceforge, after that, let me know and I'll add you to the list of developers that can clone and push to the repo.

info on how to clone was in one of my blog posts too.

http://sourceforge.net/p/baseditnet/blo ... g-a-start/

you will just replace 'gurce' with your username in the steps mentioned there
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

I have an account, it uses the same alias as here.

Great description... downloading chunks.
My other interest: http://channelf.se
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Re: BasEdit.NET

Post by Gurce »

Ok done, hopefully you can clone + push to the repo now :-)
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

So, modUtility.vb, Public Structure TokenType, makes me think I should add another "Public TokenName As String", maybe Public TokenAbbName As String

To be able to add a second set of Tokens... - if that even has to do with that, maybe it's the other way, getting data from a tokenized text file.

Even so, I have no idea what to write in the "TokenList_BasicV2.txt" to match the ascii with what is input in the editor...
As a start I could just double up the normal commands - and then pretend this won't cause any other issues. :-)


No... it's probably BasTokenName that needs clones...

As Denial doesn't have box-type of Code/Quote for long text I just post a piece, this is the idea:

Code: Select all

left$,left$,     $C8, syntax="f$(<str>,<num>)"    
right$,right$,   $C9, syntax="f$(<str>,<num>)"     
mid$,mid$,       $CA, syntax="f$(<str>,<num>[,<num>])"     
go,go,           $CB, syntax="c<num_lit>"     
PI,PI,           $FF
When that seems to work, PRINT and ? can be used as a test marker. The idea is to edit the second column to the abbreviated version as per Appendix D page 141, Commodore 64 MicroComputer User Manual (1984):

Code: Select all

...
print,?,     $99, syntax="c<print>" 
...
left$,leF,   $C8, syntax="f$(<str>,<num>)"    
right$,rI,   $C9, syntax="f$(<str>,<num>)"     
mid$,mI,     $CA, syntax="f$(<str>,<num>[,<num>])"     
go,go,       $CB, syntax="c<num_lit>"     
PI,PI,       $FF
But... as mentioned, what translates to the proper shifted characters?


Seems adding comments was not popular at the time of coding... I found some, in German, which is OK with me, not very "global" though.

So, this is where I need it to get both options (modUtility.vb)

Code: Select all

Public Sub LoadToken(ByVal TokenFile As String)

...

                  Else
                     Extra = 0
                     Indent = 0
                     Linet = 0
                     Syntax = ""
                     TokenName = ""
                     i = Zeile.IndexOf(",")
                     If i >= 0 Then
                        TokenName = Zeile.Substring(0, i).Trim()
                        Zeile = Zeile.Substring(i + 1).Trim()
                        i = Zeile.IndexOf(",")
                        If i >= 0 Then
                           sValue = Zeile.Substring(0, i).Trim()
                           Zeile = Zeile.Substring(i + 1).Trim()
                        Else
                           sValue = Zeile
                           Zeile = ""
                        End If
                        Try
                           Value = BasVal(sValue)
My other interest: http://channelf.se
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

I have gotten syntax check to accept the second column of commands, I "just" copied the normal commands and put an x in front. 10?"HELLO":XEND was OK by syntax check and after saving to PRG the program loaded properly in WinVICE as 10PRINT"HELLO":END - nothing odd in the prg either.

So two problems left to solve with this particular wish, need to figure out what characters in the Token.txt file results in shifted characters in BasEdit.Net....
Also the syntax highlight that isn't working currently.

I noticed there's no highlight on STATUS, ST, TIME, TI, TIME$ - there aren't any hex-token for these, in a PRG file they are saved as text - but they should be highlighted as they are valid commands. Also the # of GET# isn't highlighted, there should be some exception there to grab that as well. IIRC the GET# doesn't have a hex-token of its own either which is probably the explanation.

I have added some comments in English, to explain things to myself, hope that's not a problem. I recall reading somewhere that the files are uploaded per user so I'm guessing I won't destroy anything if I commit the changes.

So..., now for the syntax highlight and then those shifted characters.

BTW, the proper parsing of ? wasn't my doing, it was already in the code, I had forgotten I had changed the second token to x? and not just ?. So the ? instead of print already worked - but it's not syntax highlighted as that seems to be handled only from the Token txt file - which is why those commands I mentioned aren't handled - I guess.


Work committed, still no highlight, still no luck with PC ascii -> editor shifted characters translation/interpretation.
My other interest: http://channelf.se
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Re: BasEdit.NET

Post by Gurce »

Congrats on your perseverance, sounds like you're getting close to what you're after :)

PS. I couldn't see your change online in the repo yet, so I'm thinking you've only commited to your local repo so far.

That's fine for now too, it's just eventually when you want to push your commits to the online repo too, you can either do "hg push" from the console, or TortoiseHg has a "push" button that does the equivalent (haven't used it in a while).

I see the push button demonstrated in this vid:

https://www.youtube.com/watch?v=_lntrGIWsUM
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Re: BasEdit.NET

Post by Schlowski »

Hi,

very interesting to see other people work in my sources :)
Seems adding comments was not popular at the time of coding... I found some, in German, which is OK with me, not very "global" though.

Yep, I only added comments for me in parts where I thought I would have troubles to understand the particulary section or some flow of data in certain pieces of code. Originally I never intended to give my sources away :oops: Anyways, seems that it's not too bad concerning your success :D

Seeing the source snippet for token file parsing made me smile, very oldschool from me. There are better solutions to parse a line/string, particularly nowadays I would use String.Split

Code: Select all

Dim Parts() As String
Parts=Zeile.Split(",")
TokenName = Parts(0)
...
I'm sure there are lots of oldfashioned habbits in the source which could be solved much cleaner with proper use of the .NET features - now it's more like Basic V2 on steroids- but it does it's work so I'm fine with that, too :lol:

A big thumbs up for the work you guys invest in BasEdit.Net, I had much fun making this piece of software, I hope you have also fun extending it beyond my original vision!
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

It's a joy being able to take the software a step closer to what you would have wanted when you last worked with it.
The rare times I code I write a lot of comments to myself as I might look at it a few years after and have no idea what I have been doing.

Still wonder which part of the code that does the actual syntax highlight.

And there's the problem with choosing a good character in the Tokenlist.txt-file to work with the shifted characters that are supposed to the there when abbreviating commands.
When that works I want a toggle button so you can shift between real mode and abbreviated mode, flip of a button will change all tokens to the other version.


CBM prg Studio has word/line wrap, would be handy to set that to 40 chars and see the listing as if it was listed on a C64 - so you could tidy it up if there are some interesting elements to it.
My other interest: http://channelf.se
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

I made HgCommit on the file I edited and also the edited BasicV2 token list with double columns as well as the Swedish Keymap in WinVICE style.

They're gone from the commit window... Rev17 and 18 are from me.

Need to adapt the code so the old tokenlist-files with just one token will work as well, I'm not 100% sure that works properly at this time.
My other interest: http://channelf.se
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Re: BasEdit.NET

Post by Schlowski »

Syntax Highlighting is done in frmMain:

Code: Select all

   Private Sub ShowOneLine(ByVal myGraphic As System.Drawing.Graphics, ByVal Zeile As String, ByVal y As Integer, ByVal ShowSpace As Boolean)
It's called by frmMain Timer1 Tick Event:

Code: Select all

   Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Just had a short peek in ShowOneLine - be prepared for one hell of a procedure without comments :oops:
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: BasEdit.NET

Post by e5frog »

I saw that, and directly decided I won't touch that right now... then. ;-)
My other interest: http://channelf.se
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Re: BasEdit.NET

Post by Gurce »

Still don't see your Rev 17 + 18 in the online repo yet:

https://sourceforge.net/p/baseditnet/co ... log/?path=

I'm suspecting it's still due to committing locally, but not pushing yet. Again, it's not a big deal for now, you can push it whenever you like.

Just thought I'd better highlight it though, as it's a common mistake people make (including me) when transitioning to these distributed version-control systems like Git/Mercurial.

In systems such as CVS, Subversion, it's just one action, "commit", and then it's shared with everybody.

In Git, Mercurial, it's two actions, "commit" (to your local pc's repo), and "push" (to the online repo).

This feels really wierd initially (two actions instead of one?!), but it has its advantages too.

Eg, you can just commit locally/privately, and only push when you feel ready to share with the universe :)
Post Reply