Search found 1113 matches

by cogier
Saturday 17th July 2021 4:40pm
Forum: General
Topic: $EDITOR?
Replies: 2
Views: 1911

Re: $EDITOR?

Thanks, Bruce. That makes sense. Getting rid of the .git folder stopped the message. I'm using Gambas 3.16.2 Stable.
by cogier
Saturday 17th July 2021 1:45pm
Forum: General
Topic: $EDITOR?
Replies: 2
Views: 1911

$EDITOR?

Does anybody know what this is all about?

Image
by cogier
Thursday 15th July 2021 12:56pm
Forum: General
Topic: Launch and External Application
Replies: 4
Views: 3044

Re: Launch and External Application

Gambas has the tools to do this. You need to add the gb.desktop component for this solution.
''Requires the gb.desktop component

Public Sub cmdExec_Click()
  
  Desktop.Open(User.Home &/ "Desktop/App.py", True)
  
End
See the help HERE.
by cogier
Wednesday 14th July 2021 2:02pm
Forum: General
Topic: TextArea - Selecting text with code
Replies: 6
Views: 3625

Re: TextArea - Selecting text with code

This may not do everything you require, but I hope it points you in the right direction. Public Sub Form_Open() For iLoop As Integer = 0 To 9 TextArea1.Text &= Str(iLoop) & ". This is line " & Str(iLoop) & gb.NewLine Next End Public Sub TextArea1_MouseUp() TextArea1.Copy Te...
by cogier
Tuesday 13th July 2021 5:12pm
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 9392

Re: How to generate an ordinal number

I there anywhere that it is explained, uses and limitation ? what is it called .... string look up ? It's just an array created between the square brackets. Consider this code below, both Print lines do exactly the same thing:- Public Sub Form_Open() Dim iLoop As Integer Dim sText As String[] = [&q...
by cogier
Saturday 10th July 2021 1:00pm
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 9392

Re: How to generate an ordinal number

I like Cogier's solution very well done ;)

I can tell you have been reading " 'Clean Code' by Robert C. Martin "

I think everyone should read that book
Thanks for the kind words, but I have never read that book!
by cogier
Saturday 10th July 2021 11:51am
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 9392

Re: How to generate an ordinal number

Here is my version: - Public Sub Form_Open() Dim dDate As Date = Date(Now) Dim sOrdinal As String = GetOrdinal(Format(dDate, "dd")) Print Format(dDate, "dddd d") & sOrdinal & Format(dDate, " mmmm yyyy") End Public Sub GetOrdinal(sDay As String) As String Dim iDa...
by cogier
Friday 9th July 2021 2:01pm
Forum: General
Topic: Email with smtp a pdf
Replies: 6
Views: 3979

Re: Email with smtp a pdf

That's a very old post of mine
Nice to know you are still around!
by cogier
Friday 9th July 2021 1:59pm
Forum: General
Topic: [SOLVED] Gambas Style Guide
Replies: 3
Views: 2331

Re: Gambas Style Guide

I have seen various opinions on this subject, but there is no law laid down saying you should do it 'this way'. I use small letters in front of variables to donate the type. e.g. iCount for an integer, but I would use this for an array as well. Regrading form components, I can't see the point of cha...
by cogier
Tuesday 6th July 2021 9:34am
Forum: General
Topic: Email with smtp a pdf
Replies: 6
Views: 3979

Re: Email with smtp a pdf

I had a look at this and discovered ( thanks to gbWilly ) that you need to load the PDF file, and then it works as expected. Try the following:- e.Add(File.Load(User.Home &/ StoreName & SlsID & ".pdf"), "application/pdf", StoreName & SlsID & ".pdf") ...