PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: FBR_IDE a freebasic simple editor.  (Read 303 times)

jermy

  • Junior Member
  • **
  • Posts: 92
Re: a freebasic version of notepad.
« Reply #15 on: April 08, 2021, 07:03:10 AM »

somewhere i found an old project that never got finished, the code is a mess.
but the syntax color highlight works fine.
Maybe it will help you
Logged

ron77

  • Little Newbie
  • *
  • Posts: 10
Re: FBR_IDE a freebasic simple editor.
« Reply #16 on: April 11, 2021, 10:35:09 AM »

hello jermy and everyone :)

well i made a second version of my text editor (which now i'm trying to make a basic IDE for freebasic from it) instead of "textbox" i use "richtext" component and i downloaded your TLB-IDE and added the parser and you are corrected it works to some extend it colors some freebasic commands like "string text in commas" or "dim" and "function" etc... however the code of the parser is a mess lots of line are commented and it's hard to figure what does what or who is what... i wish to make the parser better that is to color more FB commands and keywords yet it's hard to understand how to do so... i laso don't understand where are the data for the keywords/commands that is uses to color the commands...

i bring you the full code of the parser in the hope that someone can explain to me how to add more keywords to be highlighted - also for some reason i cannot use the tab in the richtext component although i clearly made sure that property "acceptTab" will be set to true... (it worked in the textbox component) - anyway here is the parser full code... any help will be appreciated...

file Parser.inc:

https://pastebin.com/dbkA0RTX

ron77
Logged

jermy

  • Junior Member
  • **
  • Posts: 92
Re: FBR_IDE a freebasic simple editor.
« Reply #17 on: April 11, 2021, 11:27:00 AM »

The code is stripped version of a vb6 program to edit odl files and compile them.
Only the parser and some other small parts of code could be used.
The problem was that vb6 puts everything in a container, completely useless and would have to be completely rewritten.
Now that we no longer use vb6, I no longer need the odl ide.

explain to me how to add more keywords to be highlighted 
Look for
Code: [Select]
' assumes one character long comment
Const COMMENT = "'"

Const DELIMITER = " {}[]()"

Dim shared RESERVED As String: RESERVED = " DIM LONG BOOLEAN IN DECLARE FUNCTION Ron77 "     
Const FUNC_OBJ As String = " ENTRY "
Const KEYWORD_PAD As String = " "     

And for the color's, look for
Code: [Select]
Private Sub Highlight(hEdit As hwnd, SyntaxType As long, StartPos As Long, Length As Long)
    dim cf AS CHARFORMAT2
        cf.cbsize            = sizeof(cf)
        cf.dwMask            = CFM_COLOR
     
    select case SyntaxType
          case 0             ' ColorComment
              cf.crTextColor = colors.Green ' colors.

afther pressing a dot behind 'colors' you get a drop-down list with built-in colors. 
« Last Edit: April 11, 2021, 11:31:10 AM by jermy »
Logged
Pages: 1 [2]