'Ends'

Post your Gambas programming questions here.
Post Reply
Online
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

'Ends'

Post by cogier »

I have discovered a very useful tool in the Gambas toolbox 'Ends' so I thought I would share it with you.

Handle all the controls in the program below in 5 lines of code: -
Example of Ends.png
Example of Ends.png (169.4 KiB) Viewed 4827 times
Example_of_Ends.tar
(97 KiB) Downloaded 472 times
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: 'Ends'

Post by stevedee »

That's great cogier! an interesting example.

I played around with it for a while, and then I sort of 'drifted off', creating this one liner using Last.Name.
HiBye.png
HiBye.png (14.98 KiB) Viewed 4824 times
Attachments
LastNameControlExample.zip
(73.56 KiB) Downloaded 431 times
Online
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: 'Ends'

Post by cogier »

Excellent! Well using that method you could shorten: -
TextBox1.Text = Mid((Last.name), InStr(Last.name, "Button") + Len("Button"))
To
TextBox1.Text = Mid(Last.name, InStr(Last.name, "Button") + 6)
It just goes to show that there is always another way to do things. :D
Post Reply