English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 09 March 2017, 12:10   #1
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
BB2 User Defined Language for Notepad++

Hello! Since it's possible to share the clipboard between WinUAE and Windows I decided to start making a user defined language for Blitz Basic 2 in Notepad++. So far I have just done the basics and only a few keywords are there yet. Having to copy-paste code to Ted in WinUAE is of course an extra step but coding in Notepad++ is otherwise so much smoother (line numbers, code folding, region support, better colours, proper mouse wheel and a lot more)

What do you think? Is this a stupid idea?
------------------
EDIT: I have worked out a good way to use Notepad++ with BB2. Here are the most up to date files and instructions:

Instructions

http://gamephase.net/files/linked/BB...HowTo-v1.1.pdf

User defined language
http://www.gamephase.net/files/linked/BB2-NPP-v1.0.zip

Automation tools
http://www.gamephase.net/files/linke...-tools-v10.zip


Last edited by witchmaster; 02 October 2017 at 10:19.
witchmaster is offline  
AdSense AdSense  
Old 09 March 2017, 13:53   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,269
I think it's a great idea Good stuff!
Daedalus is offline  
Old 09 March 2017, 17:14   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,045
Feel free to use these scripts for a smoother experience: http://eab.abime.net/showthread.php?t=77610
idrougge is offline  
Old 09 March 2017, 17:14   #4
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Ok! Now I have added all the commands and functions from the reference manual of Blitz Basic 2 (newer commands from extensions are currently missing). I also started making an auto-completion file, it has all the commands. A few functions also have descriptions etc. but only functions that user parentheses can have descriptions + parameter lists.

I have attached the files here so you can try it out. Please report any problems or suggestions to me in this thread! In the zip file there is a text file describing how to install, it's a very simple procedure.



Attached Files
File Type: zip BB2-NPP-v0.1.zip (5.8 KB, 32 views)
witchmaster is offline  
Old 09 March 2017, 17:52   #5
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by idrougge View Post
Feel free to use these scripts for a smoother experience: http://eab.abime.net/showthread.php?t=77610
This looks good, thanks for the tip!
witchmaster is offline  
Old 09 March 2017, 17:59   #6
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,180
Excellent idea, I love Notepad++!
Akira is offline  
Old 09 March 2017, 18:49   #7
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Seems that it is more convenient to save the source file directly to the virtual harddrive used by WinUAE and then re-loading the source manually in SuperTed and compiling. I looked at the thread idrougge suggested and made an arexx script like this:

Code:
/* blitz.rexx */
address TED_REXX1
SHOWSCREEN
WINDOWTOFRONT
ACTIVATE
LOADNEW 'WB31:Blitz2/Projects/Test/test.bb2'
COMPILE
So with SuperTed open it's possible to run the rx script from the shell to reload the source and compile. Is there a better way to run an arexx script, like a keyboard shortcut directly in SuperTed or something similar?

By the way, the source files need to have only the LF character for new lines, you can verify / change to this in Notepad++: Edit / EOL Conversions -> UNIX/OSX Format . It also seems that there needs to be a new line at the end of the source file.
witchmaster is offline  
Old 10 March 2017, 08:16   #8
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,045
There are UAE utilities to run Amiga commands from the PC environment so you can integrate it with your editor.
idrougge is offline  
Old 10 March 2017, 10:22   #9
attle
Registered User
 
Join Date: Aug 2012
Location: RAM:
Posts: 63
witchmaster: Here's a list of blitz2 keywords, may be useful to you: https://github.com/grovdata/pyblitz2...er/test/kw.txt
attle is offline  
Old 10 March 2017, 10:37   #10
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by idrougge View Post
There are UAE utilities to run Amiga commands from the PC environment so you can integrate it with your editor.
Thanks for the tip! I'm looking into this now. I asked about this in the WinUAE support forum since I couldn't find any good info about how to do this.

Quote:
Originally Posted by attle View Post
witchmaster: Here's a list of blitz2 keywords, may be useful to you: https://github.com/grovdata/pyblitz2...er/test/kw.txt
Thanks, they will indeed!
witchmaster is offline  
Old 10 March 2017, 16:16   #11
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,743
Whens the Amos version
Retro1234 is offline  
Old 10 March 2017, 18:12   #12
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by Retro1234 View Post
Whens the Amos version
If you can give me a list of the keywords for Amos I can make an Amos version also, no problem.
witchmaster is offline  
Old 10 March 2017, 22:44   #13
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 450
What a good idea. I was thinking in doing the same with CubicIDE but dont know how to start.
Will try this. Thanks!
tolkien is offline  
Old 11 March 2017, 15:32   #14
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,045
You can also use your deflibs file (or something like that) to read out a list of all your available commands, complete with tokens and help text.
idrougge is offline  
Old 11 March 2017, 16:03   #15
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 450
Interesting idrougge. Will try later if I can use it.
Thanks mate!
tolkien is offline  
Old 11 March 2017, 22:05   #16
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Now there is also a working function list, wohoo!



P.S. Don't mind the parameters...
witchmaster is offline  
Old 12 March 2017, 03:28   #17
Cylon
Banned

 
Join Date: Oct 2014
Location: Europe
Posts: 466
Here are some outputs of viewcmds tool. Maybe useful.
Attached Files
File Type: txt viewcmds-amigalibs.txt (52.5 KB, 34 views)
File Type: txt viewcmds-nlibs.txt (15.8 KB, 25 views)
File Type: txt viewcmds-otherlibs.txt (14.9 KB, 23 views)
File Type: txt viewcmds-rilibs.txt (15.4 KB, 24 views)
File Type: txt viewcmds-userlibs.txt (8.6 KB, 23 views)
File Type: txt viewcmds-syslibs.txt (85 Bytes, 20 views)
File Type: txt viewcmds-userlibsb.txt (7.2 KB, 27 views)
Cylon is offline  
Old 13 March 2017, 18:57   #18
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by Cylon View Post
Here are some outputs of viewcmds tool. Maybe useful.
Thanks! These are included as keywords now.

I have now finished a version that seems to work quite well. Keywords from the sources above are included (about 2800 in total). Code folding is working (if you save files with CR LF end of line characters, read about this in the howto text file).

Features
- A majority of keywords (about 2800) should be highlighted and suggested (auto complete)
- Function list shows statements, functions and labels.
- Folding of statements, functions, loops, multi-line comments.
- Foldable regions can be defined. example:
Code:
; region @init
[code goes here]
; }

I will include info about automating things later. I have managed to get the building process semi-automated.
Attached Files
File Type: zip BB2-NPP-v0.5.zip (36.8 KB, 28 views)
witchmaster is offline  
Old 13 March 2017, 20:06   #19
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
EDIT: Don't set up automation according to this post, there is an easier and smoother way, I will soon write a post how to do this.

Setting up semi-automation of the build process
------------------------------

Blitz basic 2 has an AREXX port so it's possible to automate it using AREXX. You can take the following steps to set things up.

1. In WinUae set serial port to TCP://0.0.0.0:1234 and select "Direct" below the drop down box. Save the WinUAE configuration and quit WinUAE, add the following to the configuration file manually (inder the other lines concerning serial): serial_translate=crlf_cr

2. Create the file DEVS:MountList on the virtual harddrive with following content (if it does not already exists)

Code:
AUX:
Handler = L:Aux-Handler
Stacksize = 1000
Priority = 5
3. Add the following commands to the end of S:user-startup

Code:
mount aux:
newshell aux:
4. Create a file named blitzproject.rexx in S: with following content (change blitzproject to the name of your project and change the LOAD command to point to your source file). You will need to create a separate script for every project (just copy an existing one and change the source file path).

Code:
/* blitz automation */
address TED_REXX1
SHOWSCREEN
WINDOWTOFRONT
ACTIVATE
LOAD 'WB31:Blitz2/Projects/Test/test.bb2'
COMPILE
5. Download and install Putty and the NppConsole plugin for Notepad++. Choose to add the Putty installation directory to the PATH variable so you can start it from anywhere.

6. Start Putty, create a Telnet connection to 127.0.0.1 at port 1234. Uncheck Connection / Telnet / Return key sends Telnet New Line instead of ^M . Save the connection with the name WinUAE.

7a. If you are using the Code Fold version of the BB2 UDL for Notepad++ you might want to download my command line tool that can convert EOL (end of line) characters from CR LF to LF that is required by Blitz Basic 2. Get it below (save the exe file to your Windows directory): http://www.gamephase.net/download/831/

7b. Create a .bat file in the same folder as your BB2 source file, with the content (destination is your project file path in the virtual harddrive):

Code:
ConvertEOL unix "source_file_path" "destination_file_path"
7c. Just a note when using this setup: You will edit separate versions of the BB2 source files on your Windows harddrive, the ConvertEOL tool will be set up to copy the source file to the virtual harddrive set up in WinUAE.


Using the semi-automation
------------------------------

1. Start WinUAE, load your configuration and start the emulation, then run Blitz Basic 2.

2. Show the NppConsole in Notepad++ and run the command: plink WinUAE
(You may need to press enter a few times for the shell prompt to show)

3. Edit and save the Blitz Basic source file in Notepad++. If you are saving your source file with CR LF end of line (with code folding) then press F5 and choose the .bat file you created in step 7b previously. This will convert the CR LF to LF and save the source in the BB2 project folder.

4. In NppConsole (remote shell) write "rx blitzproject" (without quotes) and press enter. Blitz Basic 2 should now reload the source file, compile and run. (blitzproject is the name of the AREXX script created earlier).

Last edited by witchmaster; 14 March 2017 at 12:11.
witchmaster is offline  
Old 13 March 2017, 20:38   #20
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,045
You can make do with just one script if you just specify the sourcefile on the command line:
Code:
/* blitz automation */
address TED_REXX1
SHOWSCREEN
WINDOWTOFRONT
ACTIVATE
LOAD ARG(1)
COMPILE
ARexx can also be used to remove CR/LF (why is that even needed?) using the Strip() function.
idrougge is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple question regarding notepad and ram.. Dharma support.Apps 5 31 May 2015 23:03
Notepad++ BippyM Coders. Asm / Hardware 14 28 August 2014 04:42
does VASM support a pre-defined symbol identifying itself Apollo Coders. Asm / Hardware 2 09 December 2013 17:07
Faces which defined the Amiga Tolls Nostalgia & memories 25 02 June 2011 23:02
BB2 development LaundroMat Coders. General 10 01 October 2002 18:58

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:29.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.21365 seconds with 13 queries