Page 1 of 1

Explain a function and the values of its parameters

Posted: Sunday 19th November 2023 7:24pm
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

Re: Explain a function and the values of its parameters

Posted: Sunday 19th November 2023 8:23pm
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


Re: Explain a function and the values of its parameters

Posted: Sunday 19th November 2023 8:46pm
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[

Re: Explain a function and the values of its parameters

Posted: Monday 20th November 2023 7:16am
by gambafeliz
Just what you need, thank you.