Search found 581 matches

by BruceSteers
Saturday 10th July 2021 11:18am
Forum: General
Topic: How to generate an ordinal number
Replies: 19
Views: 403

Re: How to generate an ordinal number

No, 5 is Integer, 5th is String.
It's a simple function...

Public nth(v as integer, Textonly as Boolean)
Dim s as string =iif(textonly,"",str(v))
Dim n as Integer = v ٪ 10

Select n
Case 1
S &= "st"
Case 2
S &= "nd"
Case 3
S &= "rd"
Case else
S &= "th"
Return s
End
by BruceSteers
Friday 09th July 2021 2:18pm
Forum: General
Topic: [SOLVED] Gambas Style Guide
Replies: 3
Views: 119

Re: Gambas Style Guide

I'd agree, when it comes to style just go with what makes you comfortable. I started helping with gambas development so that involved learning Benoits style. So my style has adapted somewhat. Using iVar for Integer sVar for String etc makes sense and makes for more understandable code (6 months late...
by BruceSteers
Thursday 08th July 2021 5:00pm
Forum: Component
Topic: Any simple DBus examples?
Replies: 8
Views: 213

Re: Any simple DBus examples?

A solution to what? I thought it was about preventing the application from starting multiple times ... sorry if I missed something aah i see , no i've already been there.. https://forum.gambas.one/viewtopic.php?f=13&t=943 using pgrep is better than PID files but Dbus is even better as it handles th...
by BruceSteers
Thursday 08th July 2021 11:55am
Forum: Component
Topic: Any simple DBus examples?
Replies: 8
Views: 213

Re: Any simple DBus examples?

PJBlack wrote:
Thursday 08th July 2021 10:38am
would using a PID file be a possible solution?
A solution to what?

I've previously used pgrep and shell commands and pipes/sockets

I think DBus is a better way
by BruceSteers
Thursday 08th July 2021 9:15am
Forum: Component
Topic: Any simple DBus examples?
Replies: 8
Views: 213

Re: Any simple DBus examples?

So this is what i managed to make.. In the source folder of the attached app is a SingleInstance folder containing the SingleInstance class. (uses gb.dbus) A desktop launcher can be made for this app and then multiple files can be dropped onto it and the app will only launch one instance with the ot...
by BruceSteers
Wednesday 07th July 2021 2:20pm
Forum: Component
Topic: Any simple DBus examples?
Replies: 8
Views: 213

Re: Any simple DBus examples?

Cheers Michael :) I was given this example so i'm on track again, got working communication happening now :) ------------------------fwd------------ I have the following code in a startup module. It could go in a startup form as well. Private hDbusObj As DbusObj Const TEXTEDITOR_DBUS_NAME As String ...
by BruceSteers
Wednesday 07th July 2021 9:35am
Forum: Component
Topic: Any simple DBus examples?
Replies: 8
Views: 213

Any simple DBus examples?

Has anyone done any simple DBus stuff? All I want is to see how to make my program set itself up for reading a command sent though dbus. I'm basically rewriting my SingleIntsance routine that handles an app being launched multiple times. So if the app is launched twice the first instance will regist...
by BruceSteers
Tuesday 06th July 2021 8:14pm
Forum: Project showcase
Topic: AutoTool (WIP)
Replies: 0
Views: 99

AutoTool (WIP)

Presenting AutoTool (WIP) Have been making this simple tool for performing actions on files. It allows you to add file actions via filetypes (mime) or file extension and lets you make a script that tokens can be passed in. It works a lot like Pluma's External Tools. the attached snapshot shows how i...
by BruceSteers
Monday 05th July 2021 8:59am
Forum: General
Topic: [Sloved] Change Listbox list size
Replies: 10
Views: 280

Re: Change Listbox list size

AndyGable wrote:
Sunday 04th July 2021 9:12pm
grayghost4 wrote:
Sunday 04th July 2021 7:08pm
   
sitem#1 = "Amount"    
sitem#2 = "102.65"
 sItem#1 & Space(30 - Len(sItem#1)) &  sItem#2"]
Thanks grayghost4 do I need to change the font to a mono spaced one for that to work?
do you know how quick it would be to try it for yourself and see?

;)
by BruceSteers
Saturday 03rd July 2021 12:08am
Forum: General
Topic: Help Converting From VB.net to Gambas
Replies: 9
Views: 305

Re: Help Converting From VB.net to Gambas

no your error is in passing the credentials. have you tried setting Request.Password and Request.User ? (maybe before setting URL?) also there is simply using HttpClient.Download ( URL As String , Headers As String[] ) As String also .Headers is String[] should be in angle brackets even if only one ...