Page 1 of 2

freebasic coder

Posted: Tue Nov 08, 2016 5:38 pm
by c-sanchez
Please add freebasic coder settings.
It would be great.

Posted: Tue Nov 08, 2016 11:45 pm
by F. Phoenix
I don't know Basic, but I can suggest you to fork VBScript coder file in case they both are dialects of Basic (just copy vbs.coder into freebasic.coder and edit it).

Same way I made JScript.NET highlighting from build-in JScript for own needs. I can't call it "finished" yet, but it always possible to add new things.

Posted: Tue Feb 14, 2017 3:38 am
by c-sanchez
F. Phoenix wrote:I don't know Basic, but I can suggest you to fork VBScript coder file in case they both are dialects of Basic (just copy vbs.coder into freebasic.coder and edit it).

Same way I made JScript.NET highlighting from build-in JScript for own needs. I can't call it "finished" yet, but it always possible to add new things.
I see, i'm trying but i'm not sure.

These are the FreeBasic keyworks:
keywords, instructions and functions

Code: Select all

abs access acos alias allocate append as asc asin asm atan2 atn base beep bin binary bload bsave byref byval call callocate case cdecl chain chdir chr circle clear close cls color com command common condbroadcast condcreate conddestroy condsignal condwait cons constructor continue cos csrlin curdir cvd cvi cvl cvlongint cvs cvshort data date dateadd datediff datepart dateserial datevalue day deallocate declare delete destructor dim dir do draw dylibfree dylibload dylibsymbol dynamic else elseif encoding end enum environ eof erase erfn erl ermn err error escape exec exepath exit exp explicit export extends extern field fileattr filecopy filedatetime fileexists filelen fix flip for format frac fre freefile function get getjoystick getkey getmouse gosub goto hex hour if iif imageconvertrow imagecreate imagedestroy imageinfo import inkey inp input instr instrrev int is isdate kill lang lbound lcase left len lib line loc local locate lock lof log loop lpos lprint lpt lset ltrim mid minute mkd mkdir mki mkl mklongint mks mkshort month monthname multikey mutexcreate mutexdestroy mutexlock mutexunlock naked name namespace next new nogosub nokeyword now oct on open operator option out output overload paint palette pascal pcopy peek pipe pmap point poke pos preserve preset print private property protected pset public put random randomize read reallocate redim reset restore resume return right rmdir rnd rset rtrim run scope screen screencontrol screencopy screenevent screenglproc screeninfo screenlist screenlock screenptr screenres screenset screensync screenunlock scrn second seek select setdate setenviron setmouse settime sgn shell sin sizeof sleep space spc sqr stdcall step stick str strig sub swap system tab tan then this threadcreate threadwait time timer timeserial timevalue to trim type typeof ubound ucase union unlock until using val valint vallng valuint valulng var view wait wbin wchr weekday weekdayname wend whex while width window windowtitle winput with woct write wspace wstr year
variable type/kind definition

Code: Select all

any byte cast cbyte cdbl cint clng clngint const cptr cshort csign csng cubyte cuint culng culngint cunsg cushort defbyte defdbl defint deflng deflongint defshort defsng defstr defubyte defuint defulongint defushort double integer long longint object pointer procptr ptr sadd shared short single static string strptr ubyte uinteger ulong ulongint unsigned ushort varptr wstring zstring
math operations

Code: Select all

add alpha and andalso custom eqv false imp let mod not null or orelse shl shr trans true xor
processor/built-in macros

Code: Select all

assert assertwarn bit bitset bitreset defined hibyte hiword lobyte loword rgb rgba va_first va_arg va_next pragma debug
i want a syntax highlight like this:
Image

FreeBasic code example: http://pastebin.com/96zPSWHx

can someone do something with that?
Or guide me to know how to do it :)

Posted: Tue Feb 14, 2017 8:01 am
by YuS
c-sanchez wrote: can someone do something with that?
Or guide me to know how to do it :)
Основное описано в документации \AkelFiles\Docs\Coder-Eng.txt ...
Вот Вам измененный файл _vbs.coder, поместите его вместо штатного vbs.coder.
Сравните файлы vbs.coder и _vbs.coder, затем добавляйте по аналогии свои ключевые слова, операторы, переменные и т.п.

PS После обновления, vbs.coder может быть добавлен установщиком - следите за этим в дальнейшем.

Posted: Tue Feb 14, 2017 8:51 am
by Skif_off
Example-sketch freebasic.coder.

Posted: Tue Feb 14, 2017 4:12 pm
by c-sanchez
Skif_off wrote:Example-sketch freebasic.coder.
Many thanks Skif_off! really great :mrgreen:

I have some doubts.
* The autocomple code block is not working with freebasic.coder?
how i can enable that?

by ex. if i write:

Code: Select all

do while x=y then
....print "hello world!"
loop
when "then" is writed and pressed enter, automatically i think this must be inserted the loop, leaving the cursor on line to insert the code, like print "hello world!"
the same for others code blocks of course :P

* How i can add freebasic.coder to Syntax theme menu list?
---Edit: i found add this adding the menu entry from: Options > Plug-ins... > ContextMenu::Main > ContexMenu::Show menu
then add on a line on "SYNTAXTHEME"
{
"FreeBASIC" Call("Coder::Settings", 1, "bas")
}

* Finally, how i can add a own toolbar menu / shortcuts to use freebasic compiler directly from akelpad?

Really akelpad is a wonder editor, too customizable and also "adaptable", i like how all syntax schemes are automatically adapted with any language.coder, imho toooooo better than other (commercial and open source) popular options.

Posted: Wed Feb 15, 2017 2:36 am
by c-sanchez
YuS wrote:
c-sanchez wrote: can someone do something with that?
Or guide me to know how to do it :)
Основное описано в документации \AkelFiles\Docs\Coder-Eng.txt ...
Вот Вам измененный файл _vbs.coder, поместите его вместо штатного vbs.coder.
Сравните файлы vbs.coder и _vbs.coder, затем добавляйте по аналогии свои ключевые слова, операторы, переменные и т.п.
Thanks YuS, i see akelpad is good documented :)
YuS wrote:PS После обновления, vbs.coder может быть добавлен установщиком - следите за этим в дальнейшем.
It would be great if AkelPad officially has FreeBASIC syntax highlight ^^
I think the freebasic.coder sketch from Skif_off is good enough indeed :)

Posted: Wed Feb 15, 2017 10:40 am
by DV
c-sanchez wrote:* The autocomple code block is not working with freebasic.coder?
how i can enable that?
To have this auto-completion, the "Blocks:" section of the "freebasic.coder" file must include the definitions of the possible auto-completion blocks.
And you seem to be the best person to write these definitions :)
Please refer to the "Blocks:" section of the existing "vbs.coder" file to see the examples. This section already contains hints that explain the constructions which can be used. I believe the only unexplained part is the "${AutoComplete_Indent}" - this is an existing variable that controls the number of spaces to be inserted as an indent. Just use it in the same way as it is used in the existing "vbs.coder".

Posted: Thu Feb 16, 2017 12:45 am
by Skif_off
I badly explain :) I'm rewrite coder-file and I think that in two-three days it will be ready.

P.S. About case sensitivity: I have not found information on traditional code writing.

Posted: Thu Feb 16, 2017 8:15 pm
by c-sanchez
Skif_off wrote:I badly explain :) I'm rewrite coder-file and I think that in two-three days it will be ready.
haha is ok, i'm waiting the new one :D thank you very much for the help
Skif_off wrote:P.S. About case sensitivity: I have not found information on traditional code writing.
I'm not sure what do you mean, if it's about how the keyword must be by default, then, while the default way for autocompleted keywords is lower case, i think is ok.
although is different for each person, so a option to change this to "lower case, UPPER case or Title Case" can be nice, i guess AkelPad have a option to setup this, where i can find the option?
FreeBASIC is not case sensitive, but i think all on lower case by default is the proper way.

a bit more about autocomplete
if possible, on autocomplete menu add an option with close code block and other without close code block
but by default only add the rest of word and tabulation on new line without close code block

ie, by ex:
if For

show on menu two options:
For*
For* Next

if choose For* then make

Code: Select all

for
....(tabulation)
if choose For*Next then make

Code: Select all

for
....(tabulation)
next
DV wrote:To have this auto-completion, the "Blocks:" section of the "freebasic.coder" file must include the definitions of the possible auto-completion blocks.
And you seem to be the best person to write these definitions :)
Please refer to the "Blocks:" section of the existing "vbs.coder" file to see the examples. This section already contains hints that explain the constructions which can be used. I believe the only unexplained part is the "${AutoComplete_Indent}" - this is an existing variable that controls the number of spaces to be inserted as an indent. Just use it in the same way as it is used in the existing "vbs.coder".
Yeah, indeed freebasic.coder from skif_off have the autocomplete sections, although this is not working fully. but well, it was an sketch hehe
i tried make it, but really i don't know how make what i want, sorry :P

Posted: Fri Feb 17, 2017 12:36 am
by Skif_off
c-sanchez wrote:ie, by ex:
if For

show on menu two options:
For*
For* Next

if choose For* then make

Code: Select all

for
....(tabulation)
if choose For*Next then make

Code: Select all

for
....(tabulation)
next

Code: Select all

$~for
for
${AutoComplete_Indent}$[]

$~for...next
for
${AutoComplete_Indent}$[]
next
where $[] - caret position after insert. But why? For requires iterator, startvalue and endvalue.

Posted: Sat Feb 25, 2017 2:44 am
by Skif_off
Sorry, I forgot it :( Test-version (but code folding with some problems).

Posted: Sat Feb 25, 2017 11:11 pm
by c-sanchez
heh don't worry and really really many thanks by the freebasic.coder, this looks very nice. :D
By now i view only the small detail on autocomplete, as i said, i prefer use the keywords on lower case, but by now the autocomplete works only on this case, ie if someone is writing with block mayus enable, the autocomplete is not showed.

Btw i have with this the doubt, this is a "fault" from .coder files or maybe from akelpad?
ie can be better a option as "ignore case on .coder file autocompletion blocks" or somethings so.

Posted: Sun Mar 05, 2017 5:16 pm
by Skif_off
c-sanchez
Try Coder settings > last tab > uncheck "Case sensitive completion".

Posted: Mon Mar 06, 2017 3:16 pm
by c-sanchez
Nice, It's the option I was looking for, thanks Skif_off!