• Welcome to PlanetSquires Forums.
 

FBR_IDE a freebasic simple editor.

Started by ron77, April 02, 2021, 11:17:00 PM

Previous topic - Next topic

jermy

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

ron77

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

jermy

#17
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.

Quote from: ron77 on April 11, 2021, 10:35:09 AM
explain to me how to add more keywords to be highlighted 
Look for

' 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

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. 

Jim Dunn

#18
NEVERMIND -- figured it out, I'm using CRYPTOMATOR as my X: and it is all CASE SENSITIVE... so I just have to do my FreeBasic compiling down on the C drive.

: )
Jim

Quote from: Paul Squires on April 04, 2021, 03:08:02 PM
Attached is a pretty complete Notepad project that should help you.

Hey Paul, when I tried to compile that NOTEPAD... I got this:

Failed Compile (Errors 1  Warnings 0)

Command Line:
D:\Programs\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\fbc32.exe -m "X:\Programming\FreeBasic\Notepad\WinFBE_VD_MAIN.bas" "X:\Programming\FreeBasic\Notepad\TMP9A19.rc" -v -s gui  -x "X:\Programming\FreeBasic\Notepad\Notepad.exe"

FreeBASIC Compiler - Version 1.07.2 (2020-12-25), built for win32 (32bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
standalone
target:       win32, 486, 32bit
compiling:    X:\Programming\FreeBasic\Notepad\WinFBE_VD_MAIN.bas -o X:\Programming\FreeBasic\Notepad\WinFBE_VD_MAIN.asm (main module)
assembling:   D:\Programs\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\as.exe --32 --strip-local-absolute "X:\Programming\FreeBasic\Notepad\WinFBE_VD_MAIN.asm" -o "X:\Programming\FreeBasic\Notepad\WinFBE_VD_MAIN.o"
compiling rc:               D:\Programs\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\GoRC.exe /ni /nw /o /fo "X:\Programming\FreeBasic\Notepad\TMP9A19.obj" "X:\Programming\FreeBasic\Notepad\TMP9A19.rc"

Error!
Could not open source file (X:\Programming\FreeBasic\Notepad\TMP9A19.RC)
OBJ file not made
compiling rc failed: 'D:\Programs\WinFBE_Suite\FreeBASIC-1.07.2-gcc-5.2\bin\win32\GoRC.exe' terminated with exit code 1
3.14159265358979323846264338327950
"Ok, yes... I like pie... um, I meant, pi."