Search found 46 matches

by nigel
Wed Oct 19, 2011 7:20 pm
Forum: Coding Questions
Topic: Should Declare use be avoided as much as possible?
Replies: 21
Views: 2705

Re: Should Declare use be avoided as much as possible?

I always prefer to use subroutines wherever possible instead of functions/procedures. Subroutines are intuitively easier to read and comprehend.

There is nothing wrong with the Goto statement either. When used judiciously, its deployment can improve code legibility and readability, leading to ...
by nigel
Mon Oct 03, 2011 1:58 am
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

Re: How do I confirm success/failure of DatabaseUpdate execu

USCode

I tried the same principle with SQLite and it did work OK

I used the same code as for MySQL except substituting "SELECT ROW_COUNT();" with "SELECT CHANGES();" for SQLite to
reflect the difference in SQL usage between these two different databases. It is unfortunate that SQL is not ...
by nigel
Sun Oct 02, 2011 10:39 pm
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

Re: How do I confirm success/failure of DatabaseUpdate execu

Hi USCode

Interesting that you use the same Database admin tool as I do for SQLite

I do most of my work using MySQL (Although I do use SQLite too)

With MySQL I use a Database admin tool called HeidiSQL. It is very similar to SQLite Expert and incorporates a very good SQL help facility
which I ...
by nigel
Sat Oct 01, 2011 1:33 am
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

Re: How do I confirm success/failure of DatabaseUpdate execu

Thanks a lot USCode.

I did mess around with changes() in SQLite with no luck yet.
Unlike sqlite_changes which always returned 0, changes() seems to always return 1 as the result.

I've tried it using the following syntax in PB using both DatabaseQuery and DatabaseUpdate in case it only
works with ...
by nigel
Fri Sep 30, 2011 3:43 am
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

Re: How do I confirm success/failure of DatabaseUpdate execu

USCode

You are right in that it appears to be a SQL problem as I came across the following in the SQLite documentation under UPDATE :-

"It is not an error if the WHERE clause does not evaluate to true
for any row in the table - this just means that the UPDATE statement
affects zero rows"

No ...
by nigel
Thu Sep 29, 2011 10:02 pm
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

Re: How do I confirm success/failure of DatabaseUpdate execu

Zach

I am familiar with the help file contents on this subject which I do indeed find straightforward.

The issue is that DatabaseQuery returns a non-zero value (It returns 1) which indicates success when the row concerned
does not even exist in the database and therefore cannot possibly have been ...
by nigel
Thu Sep 29, 2011 9:06 pm
Forum: Coding Questions
Topic: How do I confirm success/failure of DatabaseUpdate execution
Replies: 10
Views: 2517

How do I confirm success/failure of DatabaseUpdate execution

I am not sure if this is a general SQL related question or a Purebasic question relating to the DatabaseUpdate statement....

I am unable to determine the success of a SQL database UPDATE or DELETE operation because the result only seems to indicate
if the SQL statement was properly formed using ...
by nigel
Sun Sep 25, 2011 4:16 pm
Forum: Coding Questions
Topic: How many characters can be placed in a ListIconGadget Column
Replies: 3
Views: 1351

Re: How many characters can be placed in a ListIconGadget Co

Thanks for the explanation Shield. I'll just have to live with this one as the alternative of splitting the data over two columns would be somewhat untidy.
by nigel
Sun Sep 25, 2011 1:42 am
Forum: Coding Questions
Topic: How many characters can be placed in a ListIconGadget Column
Replies: 3
Views: 1351

How many characters can be placed in a ListIconGadget Column

I had placed 500 characters in a ListIconGadget column but only the first 259 are displayed.

As no column size limits (width or contents) are mentioned in the documentation (at least I couldn't find any), I am curious to know if this is a bug or if there are undocumented limits involved.
by nigel
Thu Aug 25, 2011 9:13 pm
Forum: Coding Questions
Topic: FinishDatabase()
Replies: 16
Views: 3115

Re: FinishDatabase()

Am I correct in thinking that exiting a purebasic application automatically closes any open database connections ?

Am I correct in thinking that "FinishDatabaseQuery" is not required in relation to the "DatabaseUpdate" statement and applies only to the "DatabaseQuery" statement ?

Although I can ...
by nigel
Wed Aug 24, 2011 1:49 am
Forum: Coding Questions
Topic: INI file in pb
Replies: 2
Views: 2326

Re: INI file in pb

em_uk

I was just taking a look at what I needed to do to create and use an "ini" file and stumbled across your response here to
another user question covering this very topic. Anyway, to cut a long story short, your posted code snippet just saved
me at least two or three hours which I would ...
by nigel
Thu Nov 18, 2010 1:15 pm
Forum: Coding Questions
Topic: How to Round to Decimals Places?
Replies: 6
Views: 2717

Re: How to Round to Decimals Places?

I have worked within business IT systems in the Corporate world for many decades, designing and implementing "Non-Windows" based ERP systems. My employers have included organisations ranging in size from 300 - 40,000 employees and having annual revenues between tens of millions and billions of ...
by nigel
Wed Nov 17, 2010 12:59 am
Forum: Coding Questions
Topic: How to Round to Decimals Places?
Replies: 6
Views: 2717

Re: How to Round to Decimals Places?

Although I am relatively new to PureBasic, I immediately discovered the limitations of
PureBasic error detection, rounding and formatting in connection with monetary values.
I certainly needed a way to format and handle user entered monetary strings properly.
You may find the following subroutine ...
by nigel
Fri Nov 05, 2010 11:54 pm
Forum: Tricks 'n' Tips
Topic: TimeZoneInformation
Replies: 12
Views: 5401

Re: TimeZoneInformation

I did a quick search of the forum on the "Timezones" topic and found this very useful thread.

Thanks to Baldrick for the useful code related to timezones. As a result of your posting, I have been able to put together the routines I need.
Your contributions are much appreciated. Thanks again, you ...
by nigel
Sun Sep 19, 2010 1:46 am
Forum: Coding Questions
Topic: MySQL Connection timeouts - Seek recommended coding tricks
Replies: 9
Views: 2029

Re: MySQL Connection timeouts - Seek recommended coding tric

srod

Thanks for your comments which are always appreciated.

To answer your questions - I do indeed only use this mechanism in cases where the Database function returns zero, as these are the only cases where a remote server disconnect is a possible cause. However, a zero returned result for a ...