AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

freebasic coder
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Tue Nov 08, 2016 5:38 pm    Post subject: freebasic coder Reply with quote

Please add freebasic coder settings.
It would be great.
Back to top
View user's profile Send private message
F. Phoenix



Joined: 24 Dec 2011
Posts: 175

PostPosted: Tue Nov 08, 2016 11:45 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Tue Feb 14, 2017 3:38 am    Post subject: Reply with quote

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:
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:
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:
add alpha and andalso custom eqv false imp let mod not null or orelse shl shr trans true xor


processor/built-in macros
Code:
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:


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

can someone do something with that?
Or guide me to know how to do it Smile
Back to top
View user's profile Send private message
YuS



Joined: 15 Sep 2013
Posts: 425

PostPosted: Tue Feb 14, 2017 8:01 am    Post subject: Reply with quote

c-sanchez wrote:

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

Основное описано в документации \AkelFiles\Docs\Coder-Eng.txt ...
Вот Вам измененный файл _vbs.coder, поместите его вместо штатного vbs.coder.
Сравните файлы vbs.coder и _vbs.coder, затем добавляйте по аналогии свои ключевые слова, операторы, переменные и т.п.

PS После обновления, vbs.coder может быть добавлен установщиком - следите за этим в дальнейшем.
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1104

PostPosted: Tue Feb 14, 2017 8:51 am    Post subject: Reply with quote

Example-sketch freebasic.coder.
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Tue Feb 14, 2017 4:12 pm    Post subject: Reply with quote

Skif_off wrote:
Example-sketch freebasic.coder.

Many thanks Skif_off! really great Mr. Green

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:
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 Razz

* 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.


Last edited by c-sanchez on Wed Feb 15, 2017 2:49 am; edited 1 time in total
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Wed Feb 15, 2017 2:36 am    Post subject: Reply with quote

YuS wrote:
c-sanchez wrote:

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

Основное описано в документации \AkelFiles\Docs\Coder-Eng.txt ...
Вот Вам измененный файл _vbs.coder, поместите его вместо штатного vbs.coder.
Сравните файлы vbs.coder и _vbs.coder, затем добавляйте по аналогии свои ключевые слова, операторы, переменные и т.п.

Thanks YuS, i see akelpad is good documented Smile

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 Smile
Back to top
View user's profile Send private message
DV



Joined: 16 Nov 2006
Posts: 998
Location: Kyiv, Ukraine

PostPosted: Wed Feb 15, 2017 10:40 am    Post subject: Reply with quote

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 Smile
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".
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1104

PostPosted: Thu Feb 16, 2017 12:45 am    Post subject: Reply with quote

I badly explain Smile 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.
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Thu Feb 16, 2017 8:15 pm    Post subject: Reply with quote

Skif_off wrote:
I badly explain Smile 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 Very Happy 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:
for
....(tabulation)


if choose For*Next then make
Code:
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 Smile
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 Razz
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1104

PostPosted: Fri Feb 17, 2017 12:36 am    Post subject: Reply with quote

c-sanchez wrote:
ie, by ex:
if For

show on menu two options:
For*
For* Next

if choose For* then make
Code:
for
....(tabulation)


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

Code:
$~for
for
${AutoComplete_Indent}$[]

$~for...next
for
${AutoComplete_Indent}$[]
next

where $[] - caret position after insert. But why? For requires iterator, startvalue and endvalue.
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1104

PostPosted: Sat Feb 25, 2017 2:44 am    Post subject: Reply with quote

Sorry, I forgot it Sad Test-version (but code folding with some problems).
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Sat Feb 25, 2017 11:11 pm    Post subject: Reply with quote

heh don't worry and really really many thanks by the freebasic.coder, this looks very nice. Very Happy
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.
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1104

PostPosted: Sun Mar 05, 2017 5:16 pm    Post subject: Reply with quote

c-sanchez
Try Coder settings > last tab > uncheck "Case sensitive completion".
Back to top
View user's profile Send private message
c-sanchez



Joined: 04 Feb 2016
Posts: 49

PostPosted: Mon Mar 06, 2017 3:16 pm    Post subject: Reply with quote

Nice, It's the option I was looking for, thanks Skif_off!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group