Se puede guardar un codigo como Subrutina para ser llamado desde toda la aplicacion? - Forum

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

Se puede guardar un codigo como Subrutina para ser llamado desde toda la aplicacion?

Hola, como lo dice el titulo, mi pregunta es si tengo un codigo que uso en varias partes de la aplicacion si lo puedo guardar como una subrutina y luego llamarla desde el lugar que lo necesite.

No veo una funcional GOSUB o similar para hacer el llamado

@gustavo

I do not see a functional GOSUB or similar to make the call

With VisualNEOWeb, you create Subroutines via Project >>> Subroutines ... (or F12 key).

You can code your subroutines using NeoScript commands or Javascript commands ... click on New Subroutine and then pick one.

Then you give it a name, specify input/output parameters (if any), the commands and a Hint (optional but highly recommended as this will show in the command wizard).

Parameters can be of any number of Types ... you will need to learn about the different Types and their behaviour.

Let us say you named your subroutine calculateAreaOfCircle and defined two parameters (radius and area).

Instead of using GOSUB (as in VisualNEOWin), you call this subroutine simply by typing its name (just like it was a VisualNeoWeb command) e.g. ...

calculateAreaOfCircle "7" "[myAnswer]"
or
calculateAreaOfCircle "[thisRadiusVariable]" "[myOtherAnswer]"