English Amiga Board


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

 
 
Thread Tools
Old 09 March 2017, 11:10   #1
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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 (also attached, look at the end of post):

Instructions

http://gamephase.net/files/linked/BB...HowTo-v1.4.pdf (updated: 2019-02-09)

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

Attached Files
File Type: zip BB2-NPP-v1.0.zip (149.9 KB, 357 views)
File Type: zip npp-bb2-tools-v10.zip (21.2 KB, 347 views)
File Type: pdf BB2-NPP-HowTo-v1.4.pdf (145.5 KB, 426 views)

Last edited by MickGyver; 09 February 2019 at 11:30. Reason: Attaching files
MickGyver is offline  
Old 09 March 2017, 12:53   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
I think it's a great idea Good stuff!
Daedalus is offline  
Old 09 March 2017, 16:14   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
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, 16:14   #4
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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.




Last edited by MickGyver; 15 January 2018 at 13:59. Reason: Removed attachment (old version)
MickGyver is offline  
Old 09 March 2017, 16:52   #5
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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!
MickGyver is offline  
Old 09 March 2017, 16:59   #6
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Excellent idea, I love Notepad++!
Amiga1992 is online now  
Old 09 March 2017, 17:49   #7
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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.
MickGyver is offline  
Old 10 March 2017, 07:16   #8
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
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, 09:22   #9
attle
Registered User
 
Join Date: Aug 2012
Location: RAM:
Posts: 83
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, 09:37   #10
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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!
MickGyver is offline  
Old 10 March 2017, 15:16   #11
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Whens the Amos version
Retro1234 is offline  
Old 10 March 2017, 17:12   #12
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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.
MickGyver is offline  
Old 10 March 2017, 21:44   #13
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
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, 14:32   #14
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
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, 15:03   #15
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Interesting idrougge. Will try later if I can use it.
Thanks mate!
tolkien is offline  
Old 11 March 2017, 21:05   #16
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Now there is also a working function list, wohoo!



P.S. Don't mind the parameters...
MickGyver is offline  
Old 12 March 2017, 02:28   #17
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
Here are some outputs of viewcmds tool. Maybe useful.
Attached Files
File Type: txt viewcmds-amigalibs.txt (52.5 KB, 353 views)
File Type: txt viewcmds-nlibs.txt (15.8 KB, 334 views)
File Type: txt viewcmds-otherlibs.txt (14.9 KB, 346 views)
File Type: txt viewcmds-rilibs.txt (15.4 KB, 332 views)
File Type: txt viewcmds-userlibs.txt (8.6 KB, 322 views)
File Type: txt viewcmds-syslibs.txt (85 Bytes, 317 views)
File Type: txt viewcmds-userlibsb.txt (7.2 KB, 400 views)
Cylon is offline  
Old 13 March 2017, 17:57   #18
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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.

Last edited by MickGyver; 15 January 2018 at 14:00. Reason: Removed attachment (old version)
MickGyver is offline  
Old 13 March 2017, 19:06   #19
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
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 MickGyver; 14 March 2017 at 11:11.
MickGyver is offline  
Old 13 March 2017, 19:38   #20
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
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  
 


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 22:03
Notepad++ BippyM Coders. Asm / Hardware 14 28 August 2014 03:42
does VASM support a pre-defined symbol identifying itself Apollo Coders. Asm / Hardware 2 09 December 2013 16:07
Faces which defined the Amiga Tolls Nostalgia & memories 25 02 June 2011 22:02
BB2 development LaundroMat Coders. General 10 01 October 2002 17: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 15:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10129 seconds with 14 queries