Explain a function and the values of its parameters

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
User avatar
gambafeliz
Posts: 141
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Explain a function and the values of its parameters

Post by gambafeliz »

I would like to explain a function and its parameter values in autocomplete. That is, when the programmer calls the function and wants to understand the values of its parameters, he normally displays contextual help.

How can I do it, can someone explain it to me?

Thank you
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
BruceSteers
Posts: 1578
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Explain a function and the values of its parameters

Post by BruceSteers »

gambafeliz wrote: Sunday 19th November 2023 7:24pm I would like to explain a function and its parameter values in autocomplete. That is, when the programmer calls the function and wants to understand the values of its parameters, he normally displays contextual help.

How can I do it, can someone explain it to me?

Thank you
You put the help before the function by starting each line with 2 single comment quotes (not a double-quote) ' then use markdown / html code
Like this...


'' ## This is help that shows
''
'' It has <font color=red>markdwon syntax</font> like **bold** etc
'' * lists
'' * 'code quotes' etc

Public Sub MyFunction()

End

If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1578
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Explain a function and the values of its parameters

Post by BruceSteers »

for properties you put the help at the "Property" line not the Property_Read bit

' Gambas class file


'' Help for a public variable goes here
Public MyPublicBool As Boolean

'' Help for a property goes here
Property Read Prop as String

Private $sProp As String

'' Help for a function goes here
Public Sub MyFunction()

End

Private Sub Prop_Read() As String

  Return$sProp

End



You can also access the wiki in links (or other urls)


'' See help on TreeView.Current  [/comp/gb.qt4/_treeview/current]
Property Current As _TreeView_Item

'' Get a variable from it's settings string, See [/comp/gb.settings/settings/fromstring]
Public Sub GetSetting(SValue As String) As Variant

  Return Settings.FormString(SValue)

End
/gb[
If at first you don't succeed , try doing something differently.
BruceS
User avatar
gambafeliz
Posts: 141
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Explain a function and the values of its parameters

Post by gambafeliz »

Just what you need, thank you.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Post Reply