SQLite Database Viewer

Share your advanced PureBasic knowledge/code with the community.
User avatar
doctorized
Addict
Addict
Posts: 854
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: SQLite Database Viewer

Post by doctorized »

collectordave wrote:3) Thinking of adding this I posted a module some time ago here viewtopic.php?f=12&t=64656&hilit=query+builder which I am thinking of updateing and adding.
Hi,
Nice code too. I wrote a simple code for an app of mine where the only thing that I want is to run the command as is. I only added a small chech for DROP and DELETE where the user confirms that he wants to run DROP/DELETE command.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: SQLite Database Viewer

Post by collectordave »

I have now added the sql query builder and tester module, fixed the lack of row title changes when scrolling and a couple of other little bugs.

I have provided a zip file for the code now as it is getting a bit big to post.

The zip file includes the GridEX module used as well.

The zip is here:- https://www.dropbox.com/s/u81u7uzzo9wiq ... t.zip?dl=0

Regards

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
mchael
User
User
Posts: 15
Joined: Mon Oct 14, 2019 7:31 am

Re: SQLite Database Viewer

Post by mchael »

Trying to compile on a MAC and get an error with the GridExModule. Any assistance or direction on fixing this most appreciated, thanks

[17:53:18] Waiting for executable to start...
[17:53:19] Executable type: MacOSX - x64 (64bit, Unicode)
[17:53:19] Executable started.
[17:53:19] [ERROR] GridExModule.pbi (Line: 3512)
[17:53:19] [ERROR] LoadFont(): invalid value specified for parameter 'Flags'.

Line

Code: Select all

309:     FontID = LoadFont(#PB_Any, Name, Size, Flags)
Procedure:

Code: Select all

Procedure   AddFont(GID.i, Font$)
    Define.i FontID, Size, Flags
    Define.s Name
    
    If FindMapElement(Grid(), Str(GID))
      
      ;If FindMapElement(LoadedFonts(), Font$)
      ;  ProcedureReturn LoadedFonts()
      ;Else
        
        Name   = StringField(Font$, 1, "|")
        Size   = Val(StringField(Font$, 2, "|"))
        Flags  = Val(StringField(Font$, 3, "|"))
        
        FontID = LoadFont(#PB_Any, Name, Size, Flags)
        If FontID
          ;LoadedFonts(Font$) = FontID
          Grid()\Font(Font$) = FontID
          ProcedureReturn FontID
        EndIf
        
      ;EndIf
      
    EndIf
    
    ProcedureReturn #False
  EndProcedure
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: SQLite Database Viewer

Post by Marc56us »

Trying to compile on a MAC and get an error with the GridExModule. Any assistance or direction on fixing this most appreciated, thanks...

[17:53:19] [ERROR] LoadFont(): invalid value specified for parameter 'Flags'.

Code: Select all

 FontID = LoadFont(#PB_Any, Name, Size, Flags)
Flags (optional) A combination of the following constants:
#PB_Font_Bold : The font will be bold
#PB_Font_Italic : The font will be italic
#PB_Font_Underline : The font will be underlined (Windows only)
#PB_Font_StrikeOut : The font will be strikeout (Windows only)
#PB_Font_HighQuality: The font will be in high-quality mode (slower) (Windows only)

https://www.purebasic.com/documentation ... dfont.html

I don't know how to underline text on Mac ?

For the rest, Flag is optional, so something like that could be fine.

Code: Select all

    If Flags = #PB_Font_Bold Or Flags = #PB_Font_Italic
        FontID = LoadFont(#PB_Any, Name, Size, Flags)
    Else
        FontID = LoadFont(#PB_Any, Name, Size)
    EndIf
:wink:
mchael
User
User
Posts: 15
Joined: Mon Oct 14, 2019 7:31 am

Re: SQLite Database Viewer

Post by mchael »

thanks for the instruction - it helped and I understand PB's constants better. I simply deleted flags and got it working after trying #PB_Font_Bold. It compiled and ran no problems.
Post Reply