PlanetSquires Forums

Support Forums => General Board => Topic started by: ron77 on April 02, 2021, 11:47:00 PM

Title: FBR_IDE a freebasic simple editor.
Post by: ron77 on April 02, 2021, 11:47:00 PM
hello...

i would like to try to create with WinFBE a notepad - like program (for windows) - any ideas / tips ? i'm not so new to freebasic itself yet i'm a bit newbie to WinFBE and GUI app development... i coded a GUI chatbot using WinFBE but that's mostly...

i plan to make the program under GNU licensed - i think i'll call it FB_R_WORD...

if any one wishes to join this project send me a private message :)

ron77
Title: Re: a freebasic version of notepad.
Post by: ron77 on April 03, 2021, 12:59:09 AM
hello again... well i started my notepad - like program... and i got a first question - i tried to read the documentations in the help me files about WinFBE - what i miss the most is code examples like in the freebasic help files... i read searched about saving a file with a dialog box... yet no code examples... does anyone can give me an example on how can i open a dialog box?
Title: Re: a freebasic version of notepad.
Post by: José Roca on April 03, 2021, 01:18:15 AM
I don't have examples using WinFormsX. However, I have provided many examples using my WinFBX framework.


DIM wszFile AS WSTRING * 260 = "*.*"
DIM wszInitialDir AS STRING * 260 = CURDIR
DIM wszFilter AS WSTRING * 260 = "BAS files (*.BAS)|*.BAS|" & "All Files (*.*)|*.*|"
DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
DIM cws AS CWSTR = AfxOpenFileDialog(hwnd, "", wszFile, wszInitialDir, wszFilter, "BAS", @dwFlags, NULL)
MessageBoxW(hwnd, cws, "File", MB_OK)

Title: Re: a freebasic version of notepad.
Post by: ron77 on April 03, 2021, 01:43:37 AM
thanks... i looked at winfbx documentation and found some code examples like you gave...

here are a few click events code i wish to implement

Function Form1_Label1_Click( ByRef sender As wfxLabel, ByRef e As EventArgs ) As LRESULT
    dim s as HWND
    DIM wszFile AS WSTRING * 260 = "*.*"
    DIM wszInitialDir AS STRING * 260 = CURDIR
    DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
    DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
    DIM cws AS CWSTR = AfxSaveFileDialog(s, "Save", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags)
    AfxMsg cws
   
   
   
    Function = 0
End Function

''
''
Function Form1_Label2_Click( ByRef sender As wfxLabel, ByRef e As EventArgs ) As LRESULT
    dim s as HWND
    DIM wszFile AS WSTRING * 260 = "*.*"
    DIM wszInitialDir AS STRING * 260 = CURDIR
    DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
    DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
    DIM cws AS CWSTR = AfxOpenFileDialog(s, "", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags, NULL)
    MessageBoxW(s, cws, "Open", MB_OK)
   
    Function = 0
End Function


these code example works however they don't save or open nothing... i would like to use them some code that actually writes and reads text from a file text.

like this for reading a whole text file
'4 print whole text file on screen
SUB txtfile(f AS STRING)
CLS
DIM AS STRING buffer
DIM h AS LONG = FREEFILE()
OPEN f FOR BINARY AS #h
buffer = SPACE(LOF(h))
GET #h ,  , buffer
CLOSE #h
PRINT buffer
End SUB


and another one that writes to a file...
Title: Re: a freebasic version of notepad.
Post by: José Roca on April 03, 2021, 02:34:20 AM
> these code example works however they don't save or open nothing...

Of course not. The open file dialog only lets you to choose the file to open and retuns the path of the selected file. It is up to you what to do with it. In the console example that you have posted, OPEN f FOR BINARY AS #h, you will use the returned path as OPEN <selected file> FOR BINARY AS #h.

Because I always use Unicode, I don't use the FreeBasic intrinsic functions to deal with files, but classes like CTextStreamd and CFileStream:

CTextSTream: https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CTextStream%20Class.md
CFileStream: https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CFileStream%20Class.md

Support for Unicode is weak in FreeBasic. This is why I have provided extensive support for it in my WinFBX framework. If you don't need Unicode, then you will have to look at the FreeBasic examples and manual.
Title: Re: a freebasic version of notepad.
Post by: ron77 on April 03, 2021, 05:55:55 AM
here is a small DEMO of FBR_WORD

https://sendvid.com/l6z8nh93 (https://sendvid.com/l6z8nh93)
Title: Re: a freebasic version of notepad.
Post by: Paul Squires on April 03, 2021, 07:28:30 AM
I am pretty sure that I started to create a small notepad example that ships with WinFBE. Look under \examples\Visual_Designer_Projects\Notepad

I am not at machine with WinFBE installed so I am not 100% sure that I shipped the example with the release code of WinFBE.
Title: Re: a freebasic version of notepad.
Post by: José Roca on April 03, 2021, 07:47:01 AM
Yes. It is in Examples->Visual_Designer_Projects->Notepad.
Title: Re: a freebasic version of notepad. - need some help
Post by: ron77 on April 04, 2021, 07:46:35 AM
hello i need some help with my notepad like program...

it seems when i open a text file and it displays on the textbox of the form i cannot edit it freely that is the curser won't make new lines out of the original text file i can't add to the text new lines it seem to be stuck...

here is the code for the frmMain.bas file where i do all of the open/save from text files - any help will be appreciated :)
SUB txtfile(f AS STRING)

' DIM AS STRING buffer
DIM h AS LONG = FREEFILE()
OPEN f FOR BINARY AS #h
' buffer = SPACE(LOF(h))
put #h ,  , text
CLOSE #h
' PRINT buffer
End SUB


function helpfile(lines as string) as string

    return lines & !"\r\n" '& !"\r\n"
'Dim As Long SelEnd = Len(Form1.Text1.Text)
'    SendMessage(form1.text1.hWindow, EM_SETSEL, SelEnd, SelEnd)
'    SendMessage form1.text1.hWindow, EM_SCROLLCARET, 0, 0
end function



function txtfileopen(f AS string) as string

DIM AS STRING buffer
DIM h AS LONG = FREEFILE()
OPEN f FOR BINARY AS #h
buffer = SPACE(LOF(h))
get #h ,  , buffer
CLOSE #h
    return buffer
End function


Function Form1_MainMenu_Click( ByRef sender As wfxMenuItem, ByRef e As EventArgs ) As LRESULT
    Select Case UCase(sender.Name)
        Case "MNUFILE"
           
        Case "MNUSAVE"
             text =  Form1.Text1.Text
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
            DIM cws AS CWSTR = AfxSaveFileDialog(s, "Save", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags)
            AfxMsg cws
            txtfile(cws)
        Case "MNUOPEN"
            dim text2 as string, result as string
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
            DIM cws AS CWSTR = AfxOpenFileDialog(s, "", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags, NULL)
            MessageBoxW(s, cws, "Open", MB_OK)
            text2 = txtfileopen(cws)
            result = helpfile(text2)
            Form1.Text1.Text = result
        Case "MNUENCRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = encode(text1)
        Case "MNUDECRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = decode(text1)
        Case Else
    End Select
    Function = 0
End Function
Title: Re: a freebasic version of notepad.
Post by: ron77 on April 04, 2021, 09:59:42 AM
okay i changed the sub/functions of the read/write to/from text file with out binary yet the problem still persist

here is the updated code of frmMain.bas
dim shared as string text
'reDIM shared AS STRING buffer(0)
Const string1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Const string2 = "VsciBjedgrzyHalvXZKtUPumGfIwJxqOCFRApnDhQWobLkESYMTN"

SUB sAppend(arr() AS STRING , Item AS STRING)
REDIM PRESERVE arr(LBOUND(arr) TO UBOUND(arr) + 1) AS STRING
arr(UBOUND(arr)) = Item
END SUB

function encode(text AS STRING) as string
   Dim s As String
   Dim p As INTEGER
   Dim As String vector, key2
   
   vector = string1 : key2 = string2
   DIM currentChar AS INTEGER
   FOR i AS INTEGER = 0 TO len(text)
'     
      currentChar = ASC(MID(text, i, 1))

      IF (currentChar >= 65 AND currentChar <= 90) OR (currentChar >= 97 AND currentChar <= 122) THEN
        p = INSTR(vector, MID(text, i, 1))
        MID(text, i, 1) = MID(key2, p, 1)
      END IF
   
'       
     
   NEXT
   return text

   
END function

function decode(text AS STRING) as string
   Dim s As String
   Dim p As INTEGER
   Dim As String vector, key2
   
   vector = string2 : key2 = string1
   DIM currentChar AS INTEGER
   FOR i AS INTEGER = 0 TO len(text)
'     
      currentChar = ASC(MID(text, i, 1))

      IF (currentChar >= 65 AND currentChar <= 90) OR (currentChar >= 97 AND currentChar <= 122) THEN
        p = INSTR(vector, MID(text, i, 1))
        MID(text, i, 1) = MID(key2, p, 1)
      END IF
   
'       
     
   NEXT
   return text

   
END function


SUB txtfile(f AS STRING)

' DIM AS STRING buffer
DIM h AS LONG = FREEFILE()
OPEN f FOR output AS #h
' buffer = SPACE(LOF(h))
'while not eof(h)
' put #h ,  , text
    print #h, text
'    buffer = buffer
CLOSE #h
' PRINT buffer
End SUB


function helpfile(lines as string) as string

    return lines & !"\r\n" '& !"\r\n"
'Dim As Long SelEnd = Len(Form1.Text1.Text)
'    SendMessage(form1.text1.hWindow, EM_SETSEL, SelEnd, SelEnd)
'    SendMessage form1.text1.hWindow, EM_SCROLLCARET, 0, 0
end function



function txtfileopen(f AS string) as string

' reDIM AS STRING buffer(0)
    dim as string buffer, r
DIM h AS LONG = FREEFILE()
OPEN f FOR input AS #h
' buffer = SPACE(LOF(h))
while not eof(h)
input #h, r
    buffer = buffer & r & !"\r\n"
'    sappend(buffer(), r)
    wend
CLOSE #h
    return buffer
End function





''
''  Remove the following Application.Run code if it used elsewhere in your application.
Application.Run(Form1)



''
''
Function Form1_MainMenu_Click( ByRef sender As wfxMenuItem, ByRef e As EventArgs ) As LRESULT
    Select Case UCase(sender.Name)
        Case "MNUFILE"
           
        Case "MNUSAVE"
             text =  Form1.Text1.Text
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
            DIM cws AS CWSTR = AfxSaveFileDialog(s, "Save", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags)
            AfxMsg cws
            txtfile(cws)
        Case "MNUOPEN"
            redim text2(0) as string
            dim as string r
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
            DIM cws AS CWSTR = AfxOpenFileDialog(s, "", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags, NULL)
            MessageBoxW(s, cws, "Open", MB_OK)
            Form1.Text1.Text = txtfileopen(cws)
             
        Case "MNUENCRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = encode(text1)
        Case "MNUDECRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = decode(text1)
        Case Else
    End Select
    Function = 0
End Function

''
''
Function Form1_MainMenu_Popup( ByRef sender As wfxMenuItem, ByRef e As EventArgs ) As LRESULT
    Select Case UCase(sender.Name)
        Case "MNUFILE"
        Case Else
    End Select
    Function = 0
End Function

''
''
'Function Form1_Text1_TextChanged( ByRef sender As wfxTextBox, ByRef e As EventArgs ) As LRESULT
'    dim text4 as string = Form1.Text1.Text
'    if instr(text4, !"\r\n") then
'        Form1.Text1.Text = Form1.Text1.Text & !"\n"' & !"\r\n"
'    end if
   
'    Function = 0
'End Function

Title: Re: a freebasic version of notepad.
Post by: ron77 on April 04, 2021, 12:11:42 PM
new DEMO vid with a demonstration of the bug...

https://sendvid.com/6dl37fgy (https://sendvid.com/6dl37fgy)
Title: Re: a freebasic version of notepad.
Post by: ron77 on April 04, 2021, 01:22:32 PM
hello i managed to solve the issue (bug) by using a shared dynamic array of string to load the text into the text box and now you can add new lines and edit the text :)

p.s. - or actually what solved the bug was a change in the textbox properties to change "acceptReturn" to true did the real trick :)

here is the updated code of frmMain.bas
dim shared as string text
reDIM shared AS STRING buffer(0)
Const string1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Const string2 = "VsciBjedgrzyHalvXZKtUPumGfIwJxqOCFRApnDhQWobLkESYMTN"

SUB sAppend(arr() AS STRING , Item AS STRING)
REDIM PRESERVE arr(LBOUND(arr) TO UBOUND(arr) + 1) AS STRING
arr(UBOUND(arr)) = Item
END SUB

function encode(text AS STRING) as string
   Dim s As String
   Dim p As INTEGER
   Dim As String vector, key2
   
   vector = string1 : key2 = string2
   DIM currentChar AS INTEGER
   FOR i AS INTEGER = 0 TO len(text)
'     
      currentChar = ASC(MID(text, i, 1))

      IF (currentChar >= 65 AND currentChar <= 90) OR (currentChar >= 97 AND currentChar <= 122) THEN
        p = INSTR(vector, MID(text, i, 1))
        MID(text, i, 1) = MID(key2, p, 1)
      END IF
   
'       
     
   NEXT
   return text

   
END function

function decode(text AS STRING) as string
   Dim s As String
   Dim p As INTEGER
   Dim As String vector, key2
   
   vector = string2 : key2 = string1
   DIM currentChar AS INTEGER
   FOR i AS INTEGER = 0 TO len(text)
'     
      currentChar = ASC(MID(text, i, 1))

      IF (currentChar >= 65 AND currentChar <= 90) OR (currentChar >= 97 AND currentChar <= 122) THEN
        p = INSTR(vector, MID(text, i, 1))
        MID(text, i, 1) = MID(key2, p, 1)
      END IF
   
'       
     
   NEXT
   return text

   
END function


SUB txtfile(f AS STRING)

' DIM AS STRING buffer
DIM h AS LONG = FREEFILE()
OPEN f FOR output AS #h
' buffer = SPACE(LOF(h))
'while not eof(h)
' put #h ,  , text
    print #h, text
'    buffer = buffer
CLOSE #h
' PRINT buffer
End SUB


function helpfile(lines as string) as string

    return lines & !"\r\n" '& !"\r\n"
'Dim As Long SelEnd = Len(Form1.Text1.Text)
'    SendMessage(form1.text1.hWindow, EM_SETSEL, SelEnd, SelEnd)
'    SendMessage form1.text1.hWindow, EM_SCROLLCARET, 0, 0
end function



sub txtfileopen(f AS string)

' reDIM AS STRING buffer(0)
    dim as string r
DIM h AS LONG = FREEFILE()
OPEN f FOR input AS #h
' buffer = SPACE(LOF(h))
while not eof(h)
    input #h, r
'    buffer = buffer & r & !"\r\n"
    sappend(buffer(), r)
    wend
CLOSE #h
'    return buffer
End sub





''
''  Remove the following Application.Run code if it used elsewhere in your application.
Application.Run(Form1)



''
''
Function Form1_MainMenu_Click( ByRef sender As wfxMenuItem, ByRef e As EventArgs ) As LRESULT
    Select Case UCase(sender.Name)
        Case "MNUFILE"
           
        Case "MNUSAVE"
             text =  Form1.Text1.Text
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY OR OFN_OVERWRITEPROMPT
            DIM cws AS CWSTR = AfxSaveFileDialog(s, "Save", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags)
            AfxMsg cws
            txtfile(cws)
        Case "MNUOPEN"
            redim text2(0) as string
            dim as string r
            dim s as HWND
            DIM wszFile AS WSTRING * 260 = "*.*"
            DIM wszInitialDir AS STRING * 260 = CURDIR
            DIM wszFilter AS WSTRING * 260 = "TXT files (*.TXT)|*.TXT|" & "All Files (*.*)|*.*|"
            DIM dwFlags AS DWORD = OFN_EXPLORER OR OFN_FILEMUSTEXIST OR OFN_HIDEREADONLY
            DIM cws AS CWSTR = AfxOpenFileDialog(s, "", wszFile, wszInitialDir, wszFilter, "TXT", @dwFlags, NULL)
            MessageBoxW(s, cws, "Open", MB_OK)
            txtfileopen(cws)
            for i as integer = 0 to ubound(buffer)
                Form1.Text1.Text = Form1.Text1.Text & buffer(i) & !"\r\n"
            next
            redim as string buffer(0)
           
        case "MNUCLOSE"
            Form1.Text1.Text = ""
             
        Case "MNUENCRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = encode(text1)
        Case "MNUDECRYPT"
            dim text1 as string = Form1.Text1.Text
            Form1.Text1.Text = ""
           
            Form1.Text1.Text = decode(text1)
        Case Else
    End Select
    Function = 0
End Function

''
''
Function Form1_MainMenu_Popup( ByRef sender As wfxMenuItem, ByRef e As EventArgs ) As LRESULT
    Select Case UCase(sender.Name)
        Case "MNUFILE"
        Case Else
    End Select
    Function = 0
End Function

''
''
'Function Form1_Text1_TextChanged( ByRef sender As wfxTextBox, ByRef e As EventArgs ) As LRESULT
'    dim text4 as string = Form1.Text1.Text
'    if instr(text4, !"\r\n") then
'        Form1.Text1.Text = Form1.Text1.Text & !"\n"' & !"\r\n"
'    end if
   
'    Function = 0
'End Function

''
''
Function Form1_Text1_KeyDown( ByRef sender As wfxTextBox, ByRef e As EventArgs ) As LRESULT
    dim text6 as string = Form1.Text1.Text
    if sender.AcceptsReturn then
       Form1.Text1.Text = text6 & !"\r\n"
    endif   
    Function = 0
End Function

Title: Re: a freebasic version of notepad.
Post by: Paul Squires on April 04, 2021, 03:38:02 PM
Attached is a pretty complete Notepad project that should help you.
Title: Re: a freebasic version of notepad.
Post by: ron77 on April 06, 2021, 01:20:31 PM
hello i'm trying to add code syntax highlights to freebasic code in my text editor... i found a code that prints to the screen console a content of a bas file with syntax highlight but i don't know how to modify it in order to print bas code of freebasic into the text editor textbox...

here is the code i found:
https://pastebin.com/SmyNcLDH (https://pastebin.com/SmyNcLDH)


any help will be appreciated
ron77
Title: Re: a freebasic version of notepad.
Post by: Paul Squires on April 06, 2021, 03:41:01 PM
If you don't want to use a 3rd party control like Scintilla to do your syntax coloring then you should investigate syntax coloring via a RichEdit control.  https://www.freebasic.net/forum/viewtopic.php?f=6&t=28802&p=276311

I do have a custom control about 80% written in FB that does syntax highlighting but it is not in a state that I can release. Maybe I will at some point in case another programmer would like to help enhance it. It is basically a stripped down version of Scintilla.
Title: Re: a freebasic version of notepad.
Post by: jermy on April 08, 2021, 07:33: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
Title: Re: FBR_IDE a freebasic simple editor.
Post by: ron77 on April 11, 2021, 11:05: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 (https://pastebin.com/dbkA0RTX)

ron77
Title: Re: FBR_IDE a freebasic simple editor.
Post by: jermy on April 11, 2021, 11:57: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.

Quote from: ron77 on April 11, 2021, 11:05: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. 
Title: Re: FBR_IDE a freebasic simple editor.
Post by: Jim Dunn on July 23, 2021, 07:53:21 AM
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:38: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