Search found 197 matches

by bill-lancaster
Tuesday 12th July 2022 9:06am
Forum: General
Topic: Maximum value in an array
Replies: 6
Views: 1635

Re: Maximum value in an array

Thanks Bruce, That's a nice idea but MinVal is always zero! Also, copying the array of values into a temporary array then sorting it strangely sorts the original array. Dim MyArrayOfNumbers As Integer[] = [99, 91, 93, 92, 95, 90, 95, 100, 90, 90, 99] Dim fTemp As Integer[] fTemp = MyArrayOfNumbers f...
by bill-lancaster
Monday 11th July 2022 8:26am
Forum: General
Topic: Maximum value in an array
Replies: 6
Views: 1635

Maximum value in an array

What is the best way to determine the max or min value in array?
At the moment I'm copying the array to a temporary array, sorting it then using array.max
by bill-lancaster
Friday 8th July 2022 7:16am
Forum: General
Topic: gb.scanner
Replies: 2
Views: 1135

Re: gb.scanner

Thanks Vuott, that does the job.
by bill-lancaster
Thursday 7th July 2022 8:46am
Forum: General
Topic: gb.scanner
Replies: 2
Views: 1135

gb.scanner

This seems to be a useful tool bit I can't figure out how to use it.
Haven't been able to find any example code either.
Any ideas?
by bill-lancaster
Sunday 17th April 2022 7:52am
Forum: General
Topic: DateAdd problem with month end
Replies: 11
Views: 3903

DateAdd problem with month end

I want a series of dates where each date is a month end.
DateAdd doesn't do this for me.
If Date1 is 30 April 2022 then

Code: Select all

 DateAdd(Date1, gb.Month, 1)
gives 30 May 2022 not 31 May

Is there an elegant way to achieve this?

Gambas 3.17.2
by bill-lancaster
Sunday 27th February 2022 6:02pm
Forum: General
Topic: drawingarea question
Replies: 1
Views: 1381

drawingarea question

Why is the DrawingArea1_Draw call executed several times?
A simple form with DrawingArea1 on it
and

Code: Select all

Public Sub DrawingArea1_Draw()
Draw.Text("XXXX",10,10,20,20)
End
is executed 5 times
by bill-lancaster
Monday 21st February 2022 5:43pm
Forum: General
Topic: drawingarea problem
Replies: 1
Views: 1317

Re: drawingarea problem

OK, have realised that Point, Rect and Point.InRect(Rect) should do the trick
by bill-lancaster
Monday 21st February 2022 3:00pm
Forum: General
Topic: drawingarea problem
Replies: 1
Views: 1317

drawingarea problem

Having drawn text values at different points in a drawingarea how can I (knowing the coordinates of each text) detect when the mouse is over a text item?
Any ideas would be welcome
by bill-lancaster
Monday 17th January 2022 10:06am
Forum: General
Topic: sql apostrophe problem
Replies: 3
Views: 3243

Re: sql apostrophe problem

Thanks for the ideas. I'd like to keep the string as it is. All the characters in the string are either alphabet, space (32) or apostrophe(39) but the idea of other characters hadn't occurred to me. Tried this:- Replace(sVar, "'", "\\'") And it works fine! Again thanks for your i...
by bill-lancaster
Sunday 16th January 2022 10:36am
Forum: General
Topic: sql apostrophe problem
Replies: 3
Views: 3243

sql apostrophe problem

It's happened again! Thought I'd solved this a long time ago. I am importing data into an sql table ("temp") from a downloaded .csv file. There are a few records containing an apostrophe e.g. PILGRIM'S PRIDE LT NO REF BGC But a search containing that string with the apostrophe escaped fail...