PureBasic Forum
http://forums.purebasic.com/english/

Keeper GSPOC (simplistic info manager. Source project
http://forums.purebasic.com/english/viewtopic.php?f=12&t=61162
Page 1 of 4

Author:  Fangbeast [ Sat Dec 06, 2014 11:49 pm ]
Post subject:  Keeper GSPOC (simplistic info manager. Source project

Keeper GSPOC (Great Steaming Pile Of Crap) source code project for PB 5.24.

I use this to keep track of serial numbers, logins, passwords, registration data etc using a simple EditorGadget interface that saves it as RTF data and it does what I need. It is the big mother version of SerialMuncher/Password muncher, but without the funny name:(

Still needs polishing, parts updating but it's getting there. Use the hell out of it and provide feedback (if you like) but it's made for my needs.

http://members.westnet.com.au/bangfeast/Files/Keeper.7z

Author:  electrochrisso [ Sun Dec 07, 2014 2:36 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

I have downloaded it Fang, because I want to look at your sqLite coding, I hope that it is not too steamy. :)

Author:  Fangbeast [ Sun Dec 07, 2014 2:53 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

electrochrisso wrote:
I have downloaded it Fang, because I want to look at your sqLite coding, I hope that it is not too steamy. :)


Oh, it's definately steamy ROFL!

Didn't you feel the Murray Darling, the Yarra and all the others lower their banks??? (All the steam production!!)

Author:  Fangbeast [ Sun Dec 07, 2014 11:21 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Just finished cleaning up variables, error messages, procedure names etc. Also added in the Import feature.

Only thing left to do is printing and figuring out a nice looking routine to fire up the buttons without having to have three graphics per action.

Can't think of anything else.

Same link as first message.

Author:  PB [ Sun Dec 07, 2014 11:24 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Fangbeast, I just noticed "not Sydney" in your avatar.
I grew up in Sydney, my boy. What's wrong with it? :twisted:

Author:  Fangbeast [ Sun Dec 07, 2014 7:32 pm ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

PB wrote:
Fangbeast, I just noticed "not Sydney" in your avatar.
I grew up in Sydney, my boy. What's wrong with it? :twisted:


Well, you young whippersnappers who think Sydney is the bee's knees and can call us "my boy" because you wear long pants and call them shorts don't realise that drinking your water all these years has fermented your brains:):):)

Melbourne water rules Oz!! And let's face it, Sydney girls are vain!! Our entertainment and transport is better too:):)

Damn, can't think of anything else to insult Sydneites because I am too tired. MUst stp these 1am coding sessions.

Author:  Shield [ Sun Dec 07, 2014 7:38 pm ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Well guys you might want to stop arguing, Perth tops anything anyways. :lol:

Author:  Fangbeast [ Mon Dec 08, 2014 12:23 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Shield wrote:
Well guys you might want to stop arguing, Perth tops anything anyways. :lol:


Perth?? What's that?? I had a biscuit called Perth once, tasted like Sydney water:):)

HEhehehehehe...

/me falls off the chair laughing

Author:  ozzie [ Mon Dec 08, 2014 3:23 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Looks like a handy utility - but compilation failed. Then I noticed it was written for PB 5.24. Up here in Qld I'm using 5.31. Qld, of course, has far more interesting politicians, past and present, than any other state.

Author:  Fangbeast [ Mon Dec 08, 2014 5:09 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Quote:
but compilation failed. Then I noticed it was written for PB 5.24. Up here in Qld I'm using 5.31.


I'll put 5.31 on and test to see what needs changing. if it's API, i'm more rooted than a constituent's bum at voting time!

Quote:
Qld, of course, has far more interesting politicians, past and present, than any other state.


Interesting????? What's the difference between a politician and a vampire??? One is a blood sucking, feral, pus ridden undead fiend from hell sucking the life out of us. The other is an innocent vampire that can't help its' nature!!

Author:  Fangbeast [ Mon Dec 08, 2014 6:43 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Ozzie, chuck this procedure into this directory, overwriting the old one. It was the

CreateXMLNode(RootXMLNode(*XmlTree)) code that needed an extra parameter to look like this to work under 5.31

CreateXMLNode(RootXMLNode(*XmlTree),"")

XIncludeFile "Modules\Export\_ExportDataItems.pbi" ; Export data data to a standard XML file

Code:
;==========================================================================================================================================================
; Export appointment data to a standard XML file
;==========================================================================================================================================================

Procedure ExportDataItems()

  ;------------------------------------------------------------------------------------------------
  ; Process the current table name and dump the contents to an XML file on disk
  ;------------------------------------------------------------------------------------------------
 
  QueryString.s = "SELECT * FROM Keeper"
 
  If DatabaseQuery(Program\DatabaseHandle,  QueryString.s)
   
    ;----------------------------------------------------------------------------------------------
    ; Process the next returned row
    ;----------------------------------------------------------------------------------------------
   
    While NextDatabaseRow(Program\DatabaseHandle)
     
      ;--------------------------------------------------------------------------------------------
      ; Have we created this XML tree already?
      ;--------------------------------------------------------------------------------------------
     
      If *XmlTree = 0
       
        *XmlTree = CreateXML(#PB_Any)                                                       ; Creates a new empty XML tree identified by the #XML number
       
        *RootXmlNode = CreateXMLNode(RootXMLNode(*XmlTree),"")                                 ; Creates a new XML node and inserts it into the given parent node.
       
        SetXMLNodeName(*RootXmlNode, #Program)                                              ; Changes the tagname of the given XML node (root in this case)
       
      EndIf
     
      ;--------------------------------------------------------------------------------------------
      ; Creates a new XML node and inserts it into main XML node of the tree.
      ;--------------------------------------------------------------------------------------------
     
      *RowNode = CreateXMLNode(MainXMLNode(*XmlTree),"")
     
      ;--------------------------------------------------------------------------------------------
      ; If the main node was created, dump all the columns using the column names as node names
      ;--------------------------------------------------------------------------------------------
     
      If *RowNode
       
        ;------------------------------------------------------------------------------------------
        ; Get the column names and write them first
        ;------------------------------------------------------------------------------------------
       
        NumberOfColumns.i = DatabaseColumns(Program\DatabaseHandle)
       
        ;------------------------------------------------------------------------------------------
        ; Iterate through the columns
        ;------------------------------------------------------------------------------------------
       
        For ColumnNamesLoop.i = 0 To NumberOfColumns.i -1
         
          CurrentColumn.s = DatabaseColumnName(Program\DatabaseHandle, ColumnNamesLoop.i)
         
          *ColumnNode = CreateXMLNode(*RowNode,"")                                             ; Creates a new XML node and inserts it into main XML node of the tree.
         
          SetXMLNodeText(*ColumnNode, TextToXml(GetDatabaseString(Program\DatabaseHandle,  ColumnNamesLoop.i)))
         
        Next                                                                                ; Next column
       
        ;------------------------------------------------------------------------------------------
        ; Main node wasn't created, exit out of this procedure
        ;------------------------------------------------------------------------------------------
       
      Else
       
        SetInfoBarArea("Headings",  "Error",  "Could not create the export data file.")
       
        ProcedureReturn
       
      EndIf
     
      ;--------------------------------------------------------------------------------------------
      ;
      ;--------------------------------------------------------------------------------------------
     
    Wend
   
    ;----------------------------------------------------------------------------------------------
    ;
    ;----------------------------------------------------------------------------------------------
   
    FinishDatabaseQuery(Program\DatabaseHandle)
   
    ;----------------------------------------------------------------------------------------------
    ;
    ;----------------------------------------------------------------------------------------------
   
    If *XmlTree
     
      FormatXML(*XmlTree, #PB_XML_ReFormat)
     
      SaveXML(*XmlTree, Program\TemporaryDirectory + #Program + "_Export.xml")
     
      FreeXML(*XmlTree)
     
      SetInfoBarArea("Headings",  "Info",  "Data exported to " + Program\TemporaryDirectory)
     
    EndIf
   
    ;----------------------------------------------------------------------------------------------
    ; The database query has failed for some reason
    ;----------------------------------------------------------------------------------------------
   
  Else
   
    SetInfoBarArea("Headings",  "Error",  "The database query failed or was empty. " + DatabaseError())
   
  EndIf
 
  ;------------------------------------------------------------------------------------------------
  ;
  ;------------------------------------------------------------------------------------------------
 
  TextFileId.i = CreateFile(#PB_Any, Program\TemporaryDirectory + #Program + "_Export.txt")
 
  ;------------------------------------------------------------------------------------------------
  ;
  ;------------------------------------------------------------------------------------------------
 
  If TextFileId.i <> 0
   
    ;----------------------------------------------------------------------------------------------
    ;
    ;----------------------------------------------------------------------------------------------
   
    If DatabaseQuery(Program\DatabaseHandle,  "SELECT Title, Information FROM Keeper")
     
      While NextDatabaseRow(Program\DatabaseHandle)
       
        TitleString.s       = KillQuote(GetDatabaseString(Program\DatabaseHandle, 0))
       
        InformationString.s = KillQuote(GetDatabaseString(Program\DatabaseHandle, 1))
       
        WriteStringN(TextFileId.i, "Title: " + TitleString.s)
       
        WriteStringN(TextFileId.i, "")
       
        WriteStringN(TextFileId.i, "Info:  " + InformationString.s)
       
        WriteStringN(TextFileId.i, "")
       
        WriteStringN(TextFileId.i, "")
       
        WriteStringN(TextFileId.i, "----------------------------------------------------------------------------------------------------")
       
      Wend
     
      FinishDatabaseQuery(Program\DatabaseHandle)
     
      MessageRequester("Export finished", "Keeper XML data and text files have been saved in this directory:" + Chr(10) + Chr(13) + Chr(10) + Chr(13) + Program\TemporaryDirectory)
    EndIf
   
    ;----------------------------------------------------------------------------------------------
    ;
    ;----------------------------------------------------------------------------------------------
   
    CloseFile(TextFileId) 
   
    ;----------------------------------------------------------------------------------------------
    ;
    ;----------------------------------------------------------------------------------------------
   
  EndIf
 
  ;------------------------------------------------------------------------------------------------
  ;
  ;------------------------------------------------------------------------------------------------

EndProcedure


Author:  electrochrisso [ Mon Dec 08, 2014 11:36 pm ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Fangbeast wrote:
electrochrisso wrote:
I have downloaded it Fang, because I want to look at your sqLite coding, I hope that it is not too steamy. :)


Oh, it's definately steamy ROFL!

Didn't you feel the Murray Darling, the Yarra and all the others lower their banks??? (All the steam production!!)

Now I am too scared to look, the irrigation is already lowering the level too much. :lol:

Author:  ozzie [ Tue Dec 09, 2014 3:29 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Compiles OK now under 5.31. Looks good - you've put a lot of work into this, so well done! Can't get it to save anything yet, but I'll follow the code to see what's going on, when I get some time.

Author:  Fangbeast [ Tue Dec 09, 2014 6:11 am ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Quote:
Can't get it to save anything yet, but I'll follow the code to see what's going on, when I get some time.


Just tested it here under pb 5.23 to see how far back I could go, created a dummy record and it saved fine.

There will be a new build uploaded tonight.

1. Simple web gadget based printing added.
2. Print window has PrintNow and Preview job buttons.
3. The dratted control bar now hides the way it was supposed to, and saves state.

Problems:

1. Can't seem to get the password window to set focus to the password field, haven't figured out why yet.

2. Program is not in unicode mode because I had too much trouble when I converted my old database to a uncode one merely by importing it and I don't feel like sitting there for the next six months trying to figure it out.

That's all I can think of for now.

Author:  Fangbeast [ Tue Dec 09, 2014 12:15 pm ]
Post subject:  Re: Keeper GSPOC (simplistic info manager. Source project

Updated source project (with primitive printing) uploaded. Link in first post.

Page 1 of 4 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/