Callback Function - Forum

Forum Navigation
You need to log in to create posts and topics.

Callback Function

Hi @luisp  When I create a neoscript subroutine, can I call inside another subroutine sent in a parameter type Function. If yes how to call it ?

In general, can you add a chapter to the help on how to use the different types of parameters in a subroutine?

 

smartmedia has reacted to this post.
smartmedia

Hi @phil78

Yes you can, i have used encapsulated sub inside into one other one.

thanks @smartmedia but how do you call it ?

Lets say that you have a subroutine called CheckStatus

inside your subroutine you want to call one other subroutine called CheckResult and also pass a parameter.

So in your CheckResult subroutine you will add a parameter with Alias the variable you want to pass and choose type STRING.

Now, inside you CheckStatus subroutine call your CheckResult like this

CheckResult "[Variable]"

Normally the [Variable] you have entered as parameter in CheckResult will be passed.

You can pass multiple parameters in your suboutine if you want to.

I hope i help you.

@smartmedia This is not what I am asking

In my routine I call CheckStatus "CheckResult".

Subroutine CheckStatus as a parameter [fonction] (type = Function I suppose]

Inside my subroutine if I write [fonction] nothing happens. So How to call [fonction] ?

@phil78 I didn't know this, but what you are trying to do is in fact possible.
Until now, I have only used FUNCTION type parameters when creating plugins and I was unsure why Dave included this possibility in neoScript.
After doing some attempts this seems to work (see attached image):

SetVar [mysub2] [mysub]
BeginJS
   $App.mysub2();
EndJS

Calling the parameter directly won't work. You need to assign it to a variable first.
I hope it helps

Uploaded files:
  • You need to login to have access to uploads.
farhad2008, Darbdenral and susan have reacted to this post.
farhad2008Darbdenralsusan