I would like to make a fracture request regarding the user of ( ) when calling an handler/function
I recently had a problem because I was using the revDeleteXMLNode handlers like this:
Code: Select all
revDeleteXMLNode(treeID, treeNode)
So, after pulling out much of my hair, I surprisingly found out that the problem was with the ( ).
if I called the handler without the ( ) it worked just fine.
For me this doesn't make sense, because the ( ) are a matter of organization and code readability.
You can use "If ... then" or you can use "If (...) then"
but with handlers/functions this is not true and its confusing..
For example:
"revXMLText tTreeID, tRoot ,true" doesn't work but "revXMLText(tTreeID, tRoot ,true)" will work
"revDeleteXMLNode(treeID, treeNode)" doesn't work but "revDeleteXMLNode treeID, treeNode" will work
So, my suggestion is:
- When calling or creating an handler/function, make the use of ( ) an optional thing and allow to call/create handlers/functions with and without the ( )
ex:
WHEN CREATING/DEFINING
Code: Select all
function myFunction (var1, var2)
end myFunction
function myFunction var1, var2
end myFunction
on myHandler (var1, var2)
end myHandler
on myHandler var1, var2
end myHandler
WHEN USING
Code: Select all
myFunction (x, y)
myFunction x, y
myHandler(x,y)
myHandler x,y
Many thanks
- Miguel