Search found 138 matches

by bill-lancaster
Friday 08th October 2021 8:41am
Forum: General
Topic: advice needed re mysql decimal field type
Replies: 3
Views: 206

Re: advice needed re mysql decimal field type

Thanks Quincunxian that is useful. With accounting and financial projects its important to avoid unwanted fractions of a penny. For this reason I have always used integers to represent money values, dividing by 100 to display the true value. This way there is never a problem with penny fractions. Re...
by bill-lancaster
Tuesday 05th October 2021 8:30am
Forum: General
Topic: advice needed re mysql decimal field type
Replies: 3
Views: 206

Re: advice needed re mysql decimal field type

Create a field of type DECIMAL(6,2) using an sql statement .
This then shows as type 'float' in Gambas but is always has only 2 decimal places.
by bill-lancaster
Monday 04th October 2021 5:09pm
Forum: General
Topic: advice needed re mysql decimal field type
Replies: 3
Views: 206

advice needed re mysql decimal field type

I have always used an integer value for a money type, then simply divide by 100 for display. This avoids fractional penny values occurring.
Although mysql supports a decimal type, I've never found a way of using it in Gambas.
Any ideas?
by bill-lancaster
Monday 26th July 2021 12:49pm
Forum: General
Topic: griview data event, change sort order
Replies: 1
Views: 306

Re: griview data event, change sort order

This seems to do the trick. Public Sub gdvMaster_Sort() Dim sOrder As String If gdvMaster.Columns.Ascending Then sOrder = gdvMaster.Columns[gdvMaster.Columns.Sort].Text Else sOrder = gdvMaster.Columns[gdvMaster.Columns.Sort].Text & " DESC" Endif hResultMaster = hConn.Find("master", "ORDER BY " & sOr...
by bill-lancaster
Monday 26th July 2021 11:59am
Forum: General
Topic: griview data event, change sort order
Replies: 1
Views: 306

griview data event, change sort order

I've been using the data event in gridview, the data source is a mysql database. It all works fine. When changing the sort order of a column in the database result, how is the Data event triggered? Public Sub Button1_Click() hResultMaster = hConn.Find("master", "ORDER BY Narrative") FMain.Activate E...
by bill-lancaster
Saturday 10th July 2021 11:58am
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 1890

Re: How to generate an ordinal number

I like the not so dirty solution, thanks Bruce and Cogier.
by bill-lancaster
Saturday 10th July 2021 11:15am
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 1890

Re: How to generate an ordinal number

Since I'm looking at day values of a date,
Select Case day_number MOD 10
Case 1
st
Case 2
nd
Case 3
rd
Case else
th
End Select

I guess this will do it, a bit messy though
by bill-lancaster
Saturday 10th July 2021 9:25am
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 1890

How to generate an ordinal number

Is there an available method to convert say "5" to "5th" or "23" to "23rd"?
by bill-lancaster
Saturday 01st May 2021 2:30pm
Forum: General
Topic: Drag & drop
Replies: 1
Views: 516

Re: Drag & drop

OK, got it!

Code: Select all

Public Sub PictureBox1_MouseDrag()
  If Mouse.Left Then
    Drag.Icon = Picture["icon:/32/add"] 
    Last.Drag(Drag.Icon.Image)
  Endif
End
by bill-lancaster
Saturday 01st May 2021 12:47pm
Forum: General
Topic: Drag & drop
Replies: 1
Views: 516

Drag & drop

I can't see how to do this, it's probably very simple. I have a picture box with a thumbnail of a photo. I want to place a copy of the file in a particular directory using drag n' drop I don't want the drag.icon to be the picture because they are large images. How best to show just a "+" image as th...