Hi Greg, it’s possible to call an anonymous function that calls your function with parameters. Although it maybe be a bit troublesome it’s just barely if it even is slower than calling it directly so it won’t be noticeable at all. Please see the example below.
ObserveField(“MyField”, “AnonymousFunction”)
Sub AnonymousFunction
MyFunction(MyField) ←
End Sub
Notice that I use MyField as just an example parameter. In this case MyField would be changed to the parameter that I want to set off the Observer. If you need more than one parameter passed these can be achieved through things like using the global variable, registry (not recommended), etc.
i don’t think you understood the question, your answer does not relate to passing parameters to observer callback functions.
Of course inside a function one can call another function with arguments, that’s not the point.
@NicholasStokes , I can’t help you run the task from Main(), but there isn’t any need to run a task from Main(). Just put the code from task.xml right in Main(). You can use roUrlTransfer in Main(). Also, please use code tags when posting code. It makes it much, much, much easier to read. To find it, you have to expand the toolbar above the edit box for your post and it looks like </>.
sub Main()
print “in showChannelSGScreen”
port = CreateObject(“roMessagePort”)
request = CreateObject(“roUrlTransfer”)
url = "http://www.sdktestinglab.com/Tutorial/content/xmlcontent.xml"
request.setURL(url)
jsonString = request.GetToString()
jsonParsed = ParseJson(jsonString)
end sub