PDA

View Full Version : My simple editor



Aurel
07-06-2010, 12:05
Hi all...
here is first screenshot of my small editor which i want use with thinBasic.
First of all i made one program which sort thinBasic keywords that my editor can use them for syntax coloring.

Petr Schreiber
07-06-2010, 16:25
Hi Zlatko,

it looks very nice, when I remember my beginnings with Tray Agent for thinBasic ... your program looks much better and quite complex.
On the other side I must admit I fell in love with thinAir currently.

But what got my attention is the first screenshot - what does the text analyzer do?


Thanks,
Petr

Michael Hartlef
07-06-2010, 17:24
Hi zlatko,

It looks nice. Is it made with i/e/iwbasic and scintilla?

Michael

Aurel
07-06-2010, 22:30
Hi Petr...Hi Mike... :D

Yes first program looks mistyrius but infact is really simple.
I made them in CB and he use thinBasic keywords wich are in on column and place them
as you can see in string with 10 keywords each.

Yes Mike you are right it is written in IWB(former EB)- who knowns what will be the
next name... :roll:
However it works very good.
And yes it use scintilla becose i like how scintilla work (very fast).
Scintilla is for me fantastic editor control.
by the way i have few souce codes of editors written with scintilla and study it closely.
When i finish this i will made one in thinBasic.
I just wanna see how thinbasic works with scintilla.
Im amazed how many keywords thinBasic have.
i will inform you what im do...

Zlatko

ErosOlmi
08-06-2010, 07:59
Great job Zlarko.

If you go on on this project and would like to have a specific place in this forum, I can create a new dedicated forum for it.

Ciao
Eros

Aurel
08-06-2010, 12:17
Hi..
Thanks Eros !
I think that there is no need for new forum ,one topic is good enough ;)
I add to left panel that can read keywords Function and Callback.
I also have in plan that if you doubleclick on panel item that carret jump on place where is
function written.
see screenshot:

Petr Schreiber
08-06-2010, 13:20
Its looking good,

maybe I would suggest another format of the listing in the left panel.

Instead of:


FN -> TBMain()


I would recommend


TBMain() -> FN


At least for me - I first seek the procedure name, I usually do not care if it is FUNCTION or SUB.
What is the purpose of the window which has "#minversion 1.7.0.0" inside on the screenshot?


Thanks,
Petr

Aurel
08-06-2010, 13:44
I really dont know what is the purpose of this?
It is just there in the script,i dont change anything.

I see maby is your option better but for someone who are new is better that he know
what is what- i think....

Petr Schreiber
08-06-2010, 15:12
It is up to you of course, it was just an idea :)

zlatkoAB
24-07-2010, 22:26
Hi all...
it is finaly finished first test version of my editor for thinBasic.
i think that work ok even some things are not finished...

zlatkoAB
25-07-2010, 22:10
Is anyone maby try...?
Im not sure how autosave work when user press button 'run'..

Petr Schreiber
26-07-2010, 08:47
Hi Aurel,

editor looks elegant, but it seems to me the following is not working yet:

Run button and Execute/Run script
Find, Build, Info, Help, Website icons
Not all the keywords are highlighted, for example TBGL_UseVSync



Petr

zlatkoAB
26-07-2010, 10:19
Hi Petr...

editor looks elegant, but it seems to me the following is not working yet:

* Run button and Execute/Run script
* Find, Build, Info, Help, Website icons
* Not all the keywords are highlighted, for example TBGL_UseVSync

I dont know why toolbar button 'run'-(blue arrow) not work for you?
I have MagicSmall on disk C:\MagicSmall and on same disk thinBasic
folder C:\thinBasic and when i open file from for example:
C:\thinBasic\SampleScripts\TBGL\Basic\tblg_CustumCoordinates
and then i click on 'run' button program start without any problems.
Same thing works also from Menu - Execute -RunScript .

*Find,Build,Info,website not work yet...
Help work for me from toolbar and menu to.
*Yes you right some keywords are not highlited but will be...

If runing and orther things which i say dont work for you try put
MagicSmall folder inside thinbasic folder then try run...

all best... :)
Aurel

Petr Schreiber
26-07-2010, 10:31
Hi Zlatko,

I have thinBasic.exe in C:\util\thinBasic and your IDE in another directory.

If you are not sure where thinBasic.exe is located, you can use the ShellExecute API:


ShellExecute(0, "open", "C:\PathToScript\Script.tBasic", "", "C:\PathToScript\", %SW_SHOWNORMAL )



Petr

zlatkoAB
26-07-2010, 11:35
Hi Petr...
I know for ShellEcecute api command,thank for info but i use next
I simply delete folder MagicSmall on C disk ,before that i copy this folder to disk D and works oK, im not sure why this dont work on your computer ?
I've also try from my second computer and works fine again,
i really dont understand why dont for you???

Petr Schreiber
26-07-2010, 13:47
Hi Zlatko,

well, then hard to say. The ShellExecute way works 100% here.
Maybe the problem is I have thinBasic in C:\util\thinBasic and not C:\thinBasic?

How do you launch the scripts?


Petr

zlatkoAB
26-07-2010, 15:19
Yes it looks that is problem becose you have thinBasic folder as
subfolder inside utilis.
So for you and all other that just place MagicSmall folder inside
thinBasic folder then open file and click run - must work"!

Petr Schreiber
26-07-2010, 18:26
Hi Aurel,

the state now is that I have:

thinBasic installed in C:\util\thinBasic
Magic_Small moved to C:\util\thinBasic


When I hit the run button ... it still does not work.

Maybe installing both directly to C:\thinBasic would solve the problem, but I do not want thinBasic (and any other programs) installed in root.

If you want to solve the problem, you can send me the part of code which launches the scripts via private message, and I will check it.


Petr

zlatkoAB
26-07-2010, 22:33
Petr i think that i solve problem...
So unzip MagicSmall2.zip,then copy four files from this unpacked folder
right to thinBasic folder where is located.
I do this on this way and work fine.
You can now open help and run scripts.
Screenshot show how look thinBasic folder with magicsmall editor.

I hope that now will work on any computer...

kryton9
26-07-2010, 22:42
Aurel, I am glad you are making your own editor. I think it is nice to have choices for editors.

Aurel
26-07-2010, 23:01
Hi Kent...
Yes it is good when you can use editor which you wish or like.
I like thinAir but is little bit heavy and have slow respond.
But that's just my own opinion.

Petr Schreiber
27-07-2010, 09:03
Good job Aurel,

now it works!
What was the cause of the problem?


Petr

zlatkoAB
27-07-2010, 11:48
This make problem:

System "\\thinBasic\\thinBasic.exe",filename

And i change to :

SYSTEM Getstartpath+"thinBasic.exe",filename

zlatkoAB
08-11-2010, 20:12
Hi all...
i made small update in editor.
remove richedit control on the botom of editor.
Just doubleclick on item and editor will mark line
where function start.
Added autosave each time you run code.
Function panel is also restarted.
Added small info inside toolbar button 'Info'.

download from:
http://aurelbasicsoft.ucoz.com/MagicSmall2.zip

zlatkoAB
18-11-2010, 22:06
Hi...
I was wondering is anyone use my small editor?
I know that is not something excellent but work...

kryton9
19-11-2010, 01:44
Aurel, I like your editor, thanks for another option!

I am getting an error on any thinBasic file I open. I get garbage characters at the end of file. In some cases, if the last line of code is end function... I get end function(garbage here)... and then an error saying no end function.

It is easy to fix, just delete any garbage and press return to create a new line and then the program runs fine.

A feature request would be a font size option. I usually use new courier 12 with my 54 year old eyes :)

Other than that, I like your color scheme and the use of line numbers!
Keep up the good work!

danbaron
19-11-2010, 04:52
I downloaded and tried it, Aurel.

I like the font, the font size, and the background color.

I can't get it to execute a script, nothing happens.

The ReadMe file says, "Unpack content of zip into thinBasic folder.". I did that. I tried putting the 6 files into, c:\thinbasic, c:\thinbasic\magicsmall2, c:\thinbasic\bin, and, c:\thinbasic\thinair.

I think I have version 1.8.0 of thinBasic installed.

:p
Dan

zlatkoAB
19-11-2010, 08:29
Dan as you see work for Kent...
So you probably do something wrong.
You must all files from zip unpack or extract into thinBasic folder
where is thinBasic.exe.
Again - magicsmall2.exe must be in same folder( directory ) where is
thinBasic exe.

@Kent...
Yes weird thing that some examples have garbage on the end,as
you say just remove garbage and all works fine.
Why that heapend im not sure i see something similiar in some
other files.

all best..
Aurel

peter
19-11-2010, 14:21
Hello,

looks good for me ! goes without problems !
it's a super weapon. I saw that you are member to the Oxygen forum.
you might write it for OxygenBasic too! what do you think?

best wishes

zlatkoAB
19-11-2010, 18:16
Hello Peter...

Kent say me same thing but i dont know .
I think that Charles have something different on his mind about
editor.As i see some sort of openGL based editor.
Why openGL im not sure?
I think that i can make something similar for OxyBasic
but first i wanna see Charles work.

danbaron
20-11-2010, 07:35
"File" --> "New", doesn't work.

If I save a file under a different name, the file name at the top of the screen does not always update.

A script will not execute, if it is in a folder which contains a space character in its name. I have a folder on my desktop called, "NEW THIN". Scripts in that folder will not run.

Otherwise, it works fast.

:p
Dan

zlatkoAB
01-01-2011, 15:59
Yes Dan you are right.
I really dont know why that heapend?
Maby someone here can help to solve this problem...

zlatkoAB
10-01-2011, 10:54
Hello...
Im still waiting for answer about file path which my editor send to
thinbasic interpreter?
Is someone here who can explain me what is wrong with filename
which contain blank space like this
C:\My program.tbasic

Why thinBasic dont regognize this file as script?
as i say before i use command line like this:
"thinbasic.exe",filename

filename string in this case is 'C:\My program.tbasic'
So what is wrong ?

Petr Schreiber
10-01-2011, 11:25
Hi Zlatko,

it is common practice, that if path contains spaces, it should be surrounded by double quotes (in the string itself).

So instead of string:


C:\My program.tbasic


you should send:


"C:\My program.tbasic"


The reason to do so is that the part after space could be confused with other program parameter. Having it all in "" makes sure it will be took as single block.


Petr

ErosOlmi
10-01-2011, 12:10
Hi Zlatko,

it is not thinBasic but the operating system shell.
It is always good practice (like Petr said) to enclose file names parameter in double quote in order not to create confusion to the application expecting such data.

When you pass source code to be executed to thinBasic it also checks for additional parameters. Official syntax is the following:

thinBasic.exe <Script file name> [Optional parameters]

where <Script file name> should be enclosed in double quote otherwise part of the file name will be confused with [Optional parameters]

[Optional parameters] are parameters user can pass to the script in order to be used at runtime.

There are other parameters you can pass to thinBasic but till now I've not released them in help file. I will add in future in order for 3rd party programmers be able to better interact with thinBasic. Real command line syntax is something like:

thinBasic.exe [execution flags] <Script file name> [Optional parameters]

I will let you know more about [execution flags] this evening when back at home.

Ciao
Eros

zlatkoAB
10-01-2011, 12:20
Aha i see now...
Same problem i have with YaBasic editor to and i simply dont know
why that heapend.
OK ...
I will add double quotes and try.
Thanks again both of you!

Yes Eros,that would be fine that you tell me how look parametars
or like you say execution flags.

Zlatko

zlatkoAB
10-01-2011, 12:33
YES...
IT works fine now.:D
Code look like this:

filename=LTRIM$(RTRIM$(filename))
'add double quote
filename=chr$(34)+filename+chr$(34)
'execute script
SYSTEM Getstartpath+"thinBasic.exe",filename

Also i will add scintilla markers with SUB/END SUB
and with FUNCTION /ENDFUNCTION...

ErosOlmi
10-01-2011, 12:46
Here the [execution flags] you can use when using

thinBasic.exe [execution flags] <Script file name> [Optional parameters]

where [execution flags] can be one of the following

@D
Debug mode: the script will be executed in debug mode showing thinbasic debug window. Execution is retained by the debug engine until runtime error or user exiting from debugger.
@O
Obfuscation mode. The script will not be executed but an obfuscated version of the original script will be created in the same directory of the original script. Obfuscated scripts have .tbasicx extension. Execution will immediately return to calling program.
@B
Dependency mode. The script will be partially executed in order to analyse dependant module and include files. A file with the same file name of the original script but with extension .sdep will be created in the same directory or the original script. Execution will immediately return to calling program.
Ciao
Eros

zlatkoAB
10-01-2011, 19:51
Thanks Eros...:D