FreeQ IDEa another IDE supporting FreeBasic

General discussion for topics related to the FreeBASIC project or its community.
JohnK
Posts: 279
Joined: Sep 01, 2005 5:20
Location: Earth, usually
Contact:

Re: FreeQ IDEa another IDE supporting FreeBasic

Post by JohnK »

For Rapidq users... if you previously downloaded version 1.15, then download it again (1.15b). I had a really bad bug that didn't read a compile error in DUMP.$$$ (reported the output exe was not generated...)

As usual,
http://rapidq.phatcode.net/FreeQ/
aloberoger
Posts: 507
Joined: Jan 13, 2009 19:23

Re: FreeQ IDEa another IDE supporting FreeBasic

Post by aloberoger »

Here is my Contribution to RQInclude
Add one constructor and one operator let to QSTRINGLIST

Code: Select all


   DECLARE Constructor(ByRef value As QSTRINGLIST)
   Declare Operator Let(ByRef value As QSTRINGLIST)


 Constructor QSTRINGLIST(ByRef value As QSTRINGLIST)
      Clear()
      xStringList=value.xStringList
      Print Len(xStringList)
 End Constructor

Operator QSTRINGLIST.Let([color=#4000FF]ByRef[/color] value As QSTRINGLIST)
      Clear()
      xStringList=value.xStringList
End Operator


smeall test: Autodeclare.bas

Code: Select all


   #Include Once [color=#4000FF]"RQInclude.bi"[/color]
   ' Only for math functions - NO replace  TABs  with space in parsed line
FUNCTION StripTabs(srcLine AS string) AS string
DIM AS string tstr, resStr
    tstr=rqREPLACESUBSTR(srcLine,CHR(9),Chr(32))
    RETURN tStr
END FUNCTION



'generate declare sub / functions from a StringList

SUB IDE_GenDeclares(ListIn AS QSTRINGLIST, SortIt AS INTEGER)
    DIM TheLine         AS STRING
    DIM APIname         AS STRING        'actual name of api function/sub name
    DIM UpLine          AS STRING        'upper case of the line
    DIM ListOut         AS QSTRINGLIST

    IF ListIn.ItemCount < 1 THEN EXIT SUB           'what happened?

    Dim As Integer  i = 0, ApiN = 0, ConstN = 0, LimitEnder = 0, JmpLoop

    WHILE (i < ListIn.ItemCount)
        TheLine = TRIM$(ListIn.Item(i))                                     'get whole line w/o spaces
       
        LimitEnder = INSTR(TheLine, Chr(34))                                  'find comment start
        IF LimitEnder THEN TheLine = RTRIM$(LEFT$(TheLine, LimitEnder-1))   'remove comment
          
        TheLine = TRIM$(StripTabs(TheLine))                                 'remove tabs, replace with space
        UpLine = UCASE$(TheLine)  
                                         'upper case for matches
        DO                                                                  'combine multilines into one line
            JmpLoop = False
            IF RIGHT$(TheLine, 1) = CHR$(95) THEN                           'the _ char messes up parse!
                 LimitEnder = LEN(TheLine) - 1
            ELSE
                LimitEnder = INSTR(TheLine, (CHR$(32)+CHR$(95)))            'continuation delimiter
            END IF
            
            IF LimitEnder THEN                 
                TheLine = RTRIM$(LEFT$(TheLine, LimitEnder))                'get good part
                IF i <ListIn.ItemCount THEN i+=1 :TheLine = TheLine + " " + StripTabs(TRIM$(ListIn.Item(i)))        'append it
                UpLine = UCASE$(TheLine)
            ELSE
                JmpLoop = True                                             'single line
            END IF
        LOOP UNTIL JmpLoop

        IF (LEFT$(UpLine, 5) = "TYPE " AND INSTR(7, UpLine," EXTENDS ")) THEN   'skip class/object declarations
            JmpLoop = 0
            DO
                IF i <ListIn.ItemCount THEN                                     'check EOF
                    i+=1 
                    TheLine = TRIM$(StripTabs(ListIn.Item(i)))                  'read next line
                    IF  UCASE$(LEFT$(TheLine, 9)) = "END TYPE" THEN JmpLoop = 1 'found the end of type declare
                ELSE
                    JmpLoop = True
                END IF
            LOOP UNTIL JmpLoop
        END IF

        IF LEFT$(UpLine, 4) = "SUB "        THEN ListOut.AddItems "DECLARE " + TheLine
        IF LEFT$(UpLine, 9) = "FUNCTION "   THEN ListOut.AddItems  "DECLARE " + TheLine
        i+=1
    WEND
    IF SortIt THEN ListOut.Sort
     ListIn  = ListOut 
     ListOut.Clear
END SUB





Dim Fillist As QSTRINGLIST
Fillist.LoadFromFile("toto.bas")
 
 IDE_GenDeclares(Fillist,0)
 
   Fillist.SaveToFile("toto.bi")
 
 Print "NORMAL END"
 Sleep

suggestions:

- why not remove the pointers in the evenementielles procedures.
for example Onclick as Sub (sender as QBUTTON PTR) would become Onclick as Sub (byref sender as QBUTTON)

- the introduction of Items into QLISTVIEW should take account of the relative of Item

- Each control can implemente Create()

sub Qxxxx.Create()
PresetConfig()
Handle=CreatewindowEx(...............)
PostConfig()
end sub

- One can also add Create() in the Visible property

property Qxxxx.visible()
......................
if Handle=0 then Create()
..............
end property
JohnK
Posts: 279
Joined: Sep 01, 2005 5:20
Location: Earth, usually
Contact:

Re: FreeQ IDEa another IDE supporting FreeBasic

Post by JohnK »

Thanks for the input. I will look at the code carefully and place in the next release. BTW it is easy (I think) for you to recompile FreeQ within FreeQ. Make sure you extract all the source code in original folders.

When in FreeQ, File Menu ->Open Project -> open the 'FreeQ.Qproj' file
Make sure all paths are correct. If So, then press F5 and you will get FreeQ115.exe. Now I delete the prior FreeQ.exe and rename the new one...

It should be that simple, just like FreeBasic :)
JohnK
Posts: 279
Joined: Sep 01, 2005 5:20
Location: Earth, usually
Contact:

Re: FreeQ IDEa another IDE supporting FreeBasic

Post by JohnK »

A new update of FreeQ is posted at
http://rapidq.phatcode.net/FreeQ/

Think I finally fixed that annoying Access violation error at startup. I did not change the version number since the fix was very minor. Let me know if any issues come up.

JohnK out.
Post Reply