Jump to content

TheSaint
 Share

Recommended Posts

Here is the bare bones of a UDF I have started work on.

Mostly just a proof of concept at this stage, and still need to add some functions and dress the UDF up a bit ... to look like a UDF ... though it has my own distinct styling, especially as I have never really developed a UDF before now .... used plenty and modified plenty though. I've even invented my own UDF variable naming convention, which I am sure some of you will be aghast at. I work with what feels best for me, but others are free to adapt if they wish.

The idea is to emulate the simplicity of INI files, but gain the benefits of SQL.

Two scripts are provided.
(1) The UDF, a work in progress - SimpleSQL_UDF.au3
(2) An example or testing script - UDF_Test.au3

Another first for me, is creating a 2D array from scratch, never done that before, that I can recall ... never had a need, and even for 1 dimension arrays, for a long time now, I have just used _StringSplit to create them. So I needed a bit of a refresher course, which my good buddy @TheDcoder assisted me with ... not without some angst I might add. LOL

SimpleSQL_UDF.zip  (12 downloads previously)

(I have now completed all the functions I intended to. My next update will be a big improvement, bringing things more inline with my latest INItoSQL DB program changes.)

Program requires the sqlite3.dll, not included, but easily enough obtained.

Hopefully the usage is self-evident ... just change the Job number variable in the UDF_Test.au3 file to check the existing functions out.

Enjoy!

P.S. This is also related to a new program I have just finished and uploaded - INItoSQL DB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

18 minutes ago, TheSaint said:

which my good buddy @TheDcoder assisted me with ... not without some angst

My pleasure bud... along with the angst part :muttley:

This will definitley be useful, hopefully I will get a chance to use your UDF soon :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Being the completist I am, I decided to finish what I started, even though I have taken a different route now with INItoSQL DB, which this UDF will shortly follow.

So all the following functions are done (some could do with more error checking etc), but essentially mimic all the INI functions plus some.

Quote

_SQLite_Begin()
_SQLite_Delete()
_SQLite_Exit()
_SQLite_Read()
_SQLite_ReadSection()
_SQLite_ReadSectionNames()
_SQLite_RenameKey()
_SQLite_RenameSection()
_SQLite_RenameValue()
_SQLite_Write()
_SQLite_WriteSection()

So in a very real way, you could kind of update your INI based program to an SQL based one, just by replacing those functions, especially with those in my next update, which will also give you a lot more flexibility than the current lot. Perhaps use my INItoSQL DB program first (original version probably), to convert existing INI files ... or I would advise waiting really, for my improvements, which will make a more proper SQL file.

Changes In This Update

Added several functions, plus improved greatly the way the example (test) Job system works ... now with auto advance and dialog prompts & feedback.

_SQLite_Delete() can delete a Key, Section or Table.

_SQLite_WriteSection() could do with some improving to check on existing. Same with the Rename functions. I was going to add them in, but a few SQL quirks wasted a fair amount of my time today, and I am more enthused about developing the improved versions instead.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...