PBOSL - A OpenSource Library-Collection for PureBasic

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Hmm, I dont use unicode, and dont use the broken threadsafe subsystem either. What did you do to get it to work?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

I think you haven't use the examples. In the help is missing some functions, sorry
You have to init the lib, here a example:

Code: Select all

Debug SQLite3_GetLibVersion()
Debug ""
  
If SQLite3_InitLib("sqlite3.dll") = #False
  MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
  End
EndIf

sDB.s = "sample.db"

dbHandler = SQLite3_CreateDatabase(sDB, 1)

If dbHandler = 0
  MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
  End
EndIf

; Create test-table to fill with data
sSQL.s = "Create Table TestTable (fld0, fld1, fld2)"
SQLite3_Execute(sSQL, dbHandler)

zeit1= ElapsedMilliseconds()

; Use transactions to speed up insert-statements!
sSQL = "BEGIN TRANSACTION"
SQLite3_Execute(sSQL, dbHandler)

; fill 1000 Records into the test-table
For intI = 0 To 999
  sSQL.s = "Insert Into TestTable (fld0, fld1, fld2) Values ('value_0_" + Str(intI) + "', 'value_1_" + Str(intI) + "', 'value_2_" + Str(intI) + "')"
  SQLite3_Execute(sSQL, dbHandler)
Next intI

; commit the transaction
sSQL = "COMMIT"
SQLite3_Execute(sSQL, dbHandler)

zeit2= ElapsedMilliseconds()

Define.SQLite3_Recordset RS ; declare Recordset-'Object'

; determine count of records
If SQLite3_GetRecordset("Select Count(*) As CountOfRecords From TestTable", dbHandler, @RS )
  
  If RS\Handle
    If SQLite3_GetRecordsetValueByName("CountOfRecords", @RS)
      Debug RS\sValue + " Records in " + Str(zeit2-zeit1) + " milliseconds inserted"
    Else
      MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
    EndIf
  EndIf
  
Else
  MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf

If SQLite3_GetRecordset("Select * From TestTable Limit 5", dbHandler, @RS)
   
  If RS\Handle 
    
    Debug ""
    Debug "Amount of columns: " + Str(RS\Cols)
    Debug "Amount of rows: " + Str(RS\Rows)
    Debug ""
    
    Debug "Index of then field named 'fld2': " + Str( SQLite3_GetFieldIndexByName("fld2", @RS) )
    
    Debug ""
    Debug "SQLite3_RecordsetMoveNext():"
    Debug "----------------------------"
    
    ; Browse through the records forward
    While RS\EOF = 0
      If SQLite3_GetRecordsetValueByName("fld0", @RS)
        Debug RS\sValue
      Else
        MessageRequester("", SQLite3_GetLastMessage())
      EndIf
      SQLite3_RecordsetMoveNext(@RS)
    Wend
    
    Debug ""
    Debug "SQLite3_RecordsetMovePrevious():"
    Debug "--------------------------------"
    
    ; Browse through the records backwards
    While RS\BOF = 0
      If SQLite3_GetRecordsetValueByName("fld0", @RS)
        Debug RS\sValue
      Else
        MessageRequester("", SQLite3_GetLastMessage())
      EndIf
      SQLite3_RecordsetMovePrevious(@RS)
    Wend
    
    Debug ""
    Debug "SQLite3_RecordsetMoveFirst():"
    Debug "-----------------------------"
    
    ; Jump to the first recordset
    SQLite3_RecordsetMoveFirst(@RS)
    If SQLite3_GetRecordsetValueByName("fld0", @RS)
      Debug "Content of field 'fld0' of the first recordset (ByName):"
      Debug RS\sValue
    Else
      MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
    EndIf
    
    If SQLite3_GetRecordsetValueByIndex(0, @RS)
      Debug "Content of field 'fld0' of the first recordset (ByIndex):"
      Debug RS\sValue
    Else
      MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
    EndIf
    
    Debug ""
    Debug "SQLite3_RecordsetMoveLast():"
    Debug "----------------------------"
    
    ; Jump to the last recordset
    SQLite3_RecordsetMoveLast(@RS)
    If SQLite3_GetRecordsetValueByName("fld0", @RS)
      Debug "Content of field 'fld0' of the last recordset (ByName):"
      Debug RS\sValue
    Else
      MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
    EndIf
    If SQLite3_GetRecordsetValueByIndex(0, @RS)
      Debug "Content of field 'fld0' of the last recordset (ByIndex):"
      Debug RS\sValue
    Else
      MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
    EndIf
    
    ; Release Recordset after use
    SQLite3_ReleaseRecordset(@RS)

  Else
    MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
  EndIf
   
Else
  MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf

SQLite3_CloseDatabase(dbHandler)
  
SQLite3_End()

End
Please show the examples from the examplepackage.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Ah, thats what it was. Thanks for the example.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

PBOSL-Binaries PB4 Linux Online

PBOSL_AnimSprite
PBOSL_RFile (new)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Will the help for this library collection be updated to work with Vista?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

SFSxOI wrote:Will the help for this library collection be updated to work with Vista?
I have no vista and will never install :twisted:
What is the problem with the help?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I think Vista has yet another new type of help file.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

DoubleDutch wrote:I think Vista has yet another new type of help file.
I have read, only helpfiles (*.hlp) not supported, but you can download, that
this works. CHM should work on vista. If not, so give me someone informations, what is to change.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Sorry I couldn't get back to this before now. I can use the help fine on my remaining XP machine. However, when I try to use it on the Vista machine nothing ever shows. The topics show on the left and you can select stuff but trying to select any subject I get one of two things in the right pane, it either says "Navigation to the webpage was canceled" or it says "The address is not valid".

The same PBOSL.chm work fine in XP, just not Vista.

The purebasic help works and the Droopy Lib help works in Vista, Just not the PBOSL help. I tried a fresh download of the library again to make sure something wasn't corrupted, same thing happens.


EDIT: Arghhhhhh! Just got it figured out. Vista has marked the file as coming from another computer. What you have to do is right click on the .chm, choose properties, then click the 'Unblock" button, after that it works fine. I had not even thought about that because the other .chm files just worked, I wonder what was different about this one? Anyway...sorry for the confusion, and thanks for the help. :)
ts-soft wrote:
DoubleDutch wrote:I think Vista has yet another new type of help file.
I have read, only helpfiles (*.hlp) not supported, but you can download, that
this works. CHM should work on vista. If not, so give me someone informations, what is to change.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

I can't test this. The source is available on: http://cvs.pureforge.net/pbosl/
or pm me, i will send the source, to anybody that will help, make changes for
vista.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Actually the .chm file finally worked OK. It was my fault, I forgot about Vista's zeal for security. What you have to do is right click on the .chm, choose properties, then click the 'Unblock" button, after that it works fine. Its not a problem on your end, and Vista will always think the file came from somewhere else and do that for the most part. Vista is sensitive concerning permissions, so the way a person has their system setup for permissions has part of a responsibility in this, for example I had to go in and give my user full permissions over the PureBasic install folder to get it to run correctly and after that PureBasic runs perfectly in Vista.

I've spent the better part of the day running thru some of the PBOSL libraries, and all that i've checked so far seem to work in Vista
ts-soft wrote:I can't test this. The source is available on: http://cvs.pureforge.net/pbosl/
or pm me, i will send the source, to anybody that will help, make changes for
vista.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

SFSxOI wrote: I've spent the better part of the day running thru some of the PBOSL libraries, and all that i've checked so far seem to work in Vista
To hear delightedly, this
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

OK, found one that doesn't seem to exist in the PBOSL library even though its listed in the help. I get this:

Code: Select all

IsPIDAlive() is not a function, array, macro, or linked list
Thats as far as i've gotten so far for checking these in Vista, will do some more if you'd like.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

thanks for information, i will change this.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Update:
PBOSL_Cryption New Version by dige (ascii only)
PBOSL_ScreenGadgets Version 1.2

PBOSL-Updatechecker for windows by kiffi (helpers: edel, ts-soft)
(linux version in progress)

Image
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply