English Amiga Board


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

 
 
Thread Tools
Old 13 March 2017, 21:04   #21
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Good work mate. A question...Is it possible to autocomplete a keyword even if I write it in lowercase?
I cant see the functions in function list window. I have to recheck the installation.

Thanks!
tolkien is offline  
AdSense AdSense  
Old 13 March 2017, 23:28   #22
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by idrougge View Post
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
Ok, thanks, I'm no Arexx specialist. I tried to make the process of compiling need as little typing as possible. The automation process is not yet optimal. It would be good to be able to just press F5 in Notepad++ to run a batch file that does the necessary work. One problem is the enter presses the plink process needs before a command to remote shell can be sent. Plink can also take a text file with commands so it should be possible to get all of this automated, but I haven't been able to figure out how.

Quote:
Originally Posted by idrougge View Post
ARexx can also be used to remove CR/LF (why is that even needed?) using the Strip() function.
Ok, good to know. Ted doesn't seem to like the CR characters (shows as a square in the editor and compile fails).

Quote:
Originally Posted by tolkien View Post
Good work mate. A question...Is it possible to autocomplete a keyword even if I write it in lowercase?
I cant see the functions in function list window. I have to recheck the installation.

Thanks!
Thanks! I did not manage to get case insensitive autocomplete to work (yet), it might be possible but I couldn't find out how, I found people asking the same but no answers. There is an ignoreCase attribute in the autocomplete xml file but changing the value between yes and no does nothing. Let me know how the function list feature works out for you. EDIT: There is also a functionList.xml in the Notepad++ installation folder, try to add the association and parser there instead to the one in the appdata folder.
witchmaster is offline  
Old 13 March 2017, 23:46   #23
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Ok, edited both functionlist files and now it's ok.
Thanks
tolkien is offline  
Old 14 March 2017, 01:28   #24
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Quote:
Originally Posted by witchmaster View Post
Ok, good to know. Ted doesn't seem to like the CR characters (shows as a square in the editor and compile fails).
Why do you need CR/LF to begin with? Is Notepad++ that unflexible?
idrougge is offline  
Old 14 March 2017, 01:33   #25
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by idrougge View Post
Why do you need CR/LF to begin with? Is Notepad++ that unflexible?
The code folding in Notepad++ does only work with files that have CR/LF EOLs. Seems to be quite an old bug. I made two versions of the UDL for Notepad++, one with code folding and one without.
witchmaster is offline  
Old 14 March 2017, 13:15   #26
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
I have managed to automate the compile process considerably (creating three command line tools in the process). If you follow these steps and it all goes well you should be able to press F5 in Notepad++ to run a batch file that reloads the source file and compiles it in Blitz Basic 2 and the WinUAE window should be brought to the front.


Setting up automation
------------------------------

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 exist)

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 blitzbasic2.rexx in S: with following content (thanks idrougge)

Code:
/* blitz automation */
address TED_REXX1
SHOWSCREEN
WINDOWTOFRONT
ACTIVATE
LOAD ARG(1)
COMPILE
5. Download the command line tools I made specifically for this (but can be used for other purposes) and copy them to the Windows directory. http://gamephase.net/files/linked/npp-bb2-tools-v10.zip. The tools are:

Code:
ConvertEOL - Converts EOL characters in text files between different formats (LF / CR / CRLF)
WinUAEArexx - Runs an Arexx script in WinUAE over Telnet
BringToFront - Brings an application with specific window title to front
6. Create a batch file (.bat) in the same folder as your source file(s) with the content below (change paths and filenames accordingly)

Code:
cd "C:\Dropbox\Projects\Blitz Basic\NPP\blitzproject"
ConvertEOL unix "blitzproject.bb2" "C:\Program Files (x86)\WinUAE\HDD\Blitz2\Projects\Test\test.bb2"
WinUAEArexx blitzbasic2 1000 "WB31:Blitz2/Projects/Test/test.bb2"
BringToFront "[Amiga1200Dev.uae] - WinUAE"
- The cd command should direct to your folder source files folder.
- The ConvertEOL command is needed only if you are working on a source file with CR LF end of lines (Code folding).
- The WinUAEArexx command should be supplied with the path to the source file as seen by the emulated Amiga. 1000 after the script name is how long to wait before closing the telnet connection, if closing instantly it seems that the command won't be transfered properly.
- BringToFront needs the exact window title of the running WinUAE instance.


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

2. Edit and save the Blitz Basic source file(s) in Notepad++.

3. To compile and run, press F5 and select the batch file you created in step 6 above. Blitz Basic 2 should reload and compile the source file and WinUAE should be brought to the front.
witchmaster is offline  
Old 23 May 2017, 21:59   #27
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,192
I must be doing something wrong here...

I followed your instructions and installed the n++ defs for BB2, and when I open a BB2 file, I get this output:



This kind of looks like a binary file, what is going on?
Maybe it is the Ultimate CD copy I have? All filenames are in all caps which seems odd.
Akira is offline  
Old 23 May 2017, 23:50   #28
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
I don't think it's intended to open BB2 files, which are tokenised files. It's for developing new files, where Notepad++ saves the source code as ASCII and lets TED/Blitz parse, tokenise and compile the ASCII file.
idrougge is offline  
Old 24 May 2017, 00:01   #29
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,192
Well notepad assigned itself the bb2 extension, so I don't know what I am doing here.
So how am I supposed to look at all this example "code"? Only in BB2? That kinda fucking sucks, I don't want to use TED as my IDE.
What are tokenized files anyway?

Sorry for all my lame questions.
Akira is offline  
Old 24 May 2017, 00:19   #30
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Tokenised files replace keywords such as Print with two-byte sequences for quicker lookup (it'd be noticable on an A500) when compiling.

While TED is bad, it's workable if you get used to it. All Blitz code I've written has been written using it.
idrougge is offline  
Old 24 May 2017, 00:32   #31
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,192
Well but I understood the point of this n++ user defined language is for being able to load and save BB2 files.
I'm gonna wait for the OP or someone else who uses these extensions to let me know what I am doing wrong. I really really really rather use n++
Akira is offline  
Old 24 May 2017, 01:43   #32
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
In Blitz save the source as an ascii text file, then change the file extension to bb2 and notepad should display it..
BippyM is offline  
Old 24 May 2017, 08:37   #33
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Quote:
Originally Posted by Akira View Post
Well notepad assigned itself the bb2 extension, so I don't know what I am doing here.
So how am I supposed to look at all this example "code"? Only in BB2? That kinda fucking sucks, I don't want to use TED as my IDE.
Quote:
Originally Posted by bippym View Post
In Blitz save the source as an ascii text file, then change the file extension to bb2 and notepad should display it..
For examples etc., save the bb2 file as ascii in TED like bippym suggested. You can also copy code from TED and paste it into N++ if you have clipboard sharing enabled (miscellaneous in WinUAE settings).

Thanks to this extension for N++ I had the patience to start using Blitz Basic 2, otherwise I don't think I would have really tried, I'm too spoiled by modern editors. I didn't want to use Amiblitz because of the FPU issues etc. If I decide to make something with BB2 it would be for the classic hardware, A500 or A1200 vanilla.

I suggest that you use the version without code folding (code folding does not work correctly with only LF for new lines files in N++ and BB2 can't handle files with CR/LF new lines). I have been using that version myself and have a fixed a few issues and added a few keywords since the last uploaded version. I will upload this version when I find the time.

Last edited by witchmaster; 24 May 2017 at 09:06.
witchmaster is offline  
Old 24 May 2017, 09:20   #34
witchmaster
Registered User

witchmaster's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 139
Why wait, here is an updated version (no code folding). This version has added keywords, removed duplicate keywords, and some other corrections.
Attached Files
File Type: zip BB2-NPP-v0.6.zip (25.5 KB, 21 views)
witchmaster is offline  
Old 24 May 2017, 11:07   #35
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
I know it's not quite the same, but I use the AmiBlitz 3 environment and then compile in Blitz 2.1 for compatibility with basic machines. It could certainly do with code folding and some other things, but the inline code completion, help system, struct browser etc. make it worthwhile working in that way.

I'm not familiar with the NPP plugin system - is it possible to run an executable as part of the loading/saving process? If that's the case, it could be possible to write a simple de-tokenizer that lets you load .bb2 files directly.
Daedalus is offline  
Old 24 May 2017, 12:46   #36
mihcael
Zone Friend
mihcael's Avatar
 
Join Date: Jan 2006
Location: Aussie
Posts: 1,088
Quote:
Originally Posted by witchmaster View Post
Why wait, here is an updated version (no code folding). This version has added keywords, removed duplicate keywords, and some other corrections.
Thanks alot for doing this, I was looking for something like this a while back.

I have not tried it yet but I will in a few weeks.
mihcael is offline  
Old 24 May 2017, 18:00   #37
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,192
YEs i am using the No Fold version, I don't want to use copy and paste. I want to edit the files in the shared WInUAE folder HD straight away.
But I thought I could open these BB2 files that I got as examples to start looking at code. I guess I have to resave them al las ASCII when I open BB2.1. Why did they do this, so annoying ;(

Thanks so much for the updated definitions, I really love N++ and wouldn't use anything else.

BTW step 5 on your how to says: "Go to %AppData%\Notepad++". The actual path, at least in my system (Win 7 Pro 64bit) is "%AppData%\Roaming\Notepad++". I am using a 32-bit version of n++ (is there a 64 bit version now?)
Akira is offline  
Old 24 May 2017, 20:13   #38
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
I've been learning python recently so as a project I might have a go at making something to convert the bb2 file to a text file. Obviously the success will depend on the numbering of your Amigalibs and deflibs being correct
BippyM is offline  
Old 24 May 2017, 21:23   #39
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Quote:
Originally Posted by bippym View Post
I've been learning python recently so as a project I might have a go at making something to convert the bb2 file to a text file. Obviously the success will depend on the numbering of your Amigalibs and deflibs being correct
You have all the pieces you need here:
https://github.com/grovdata/pyblitz2
idrougge is offline  
Old 24 May 2017, 21:25   #40
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,050
Quote:
Originally Posted by Akira View Post
But I thought I could open these BB2 files that I got as examples to start looking at code. I guess I have to resave them al las ASCII when I open BB2.1. Why did they do this, so annoying ;(
Because it speeds up compilation.
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 01:15.


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