[Gambas-user] Gambas Doc

Tobias Boege taboege at gmail.com
Sun Jun 3 12:06:03 CEST 2018


On Sun, 03 Jun 2018, CD wrote:
> Thanks you for your replies.
> The second part of my question has been completely zappedabout the method :
> XmlElement.AppendFromText (gb.xml)Sub AppendFromText ( Data As String, Arguments
> As , ... )no comment in the documentation about "Arguments As " and about " ..."

Throughout the Gambas documentation "..." in a function signature stands for
a variable argument list [1][2][3]. A more experienced Gambas programmer
will look at

  AppendFromText(Data As String, Arguments ...)

and immediately realise that it is just using Subst$() [4] from Data and
Arguments and then append the resulting data :-)

  AppendFromText("a &2 c &1", "d", "b")

will first construct the string "a b c d" and then append it to the
XmlElement you call this method on. Of course, as the documentation
already states, this isn't just text which is appended but it is parsed
as XML first.

I added the Subst$() bit and an example to the documentation.

Regards,
Tobi

[1] https://en.wikipedia.org/wiki/Variadic_function
[2] http://gambaswiki.org/wiki/lang/methoddecl
[3] http://gambaswiki.org/wiki/comp/gb/param
[4] http://gambaswiki.org/wiki/lang/subst

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list