|   FORUM      |     Tutoriales    |     KIO4 |      
   Start B4A (Basic4Android) App inventor 2 Arduino
   Elastix - VoIP Things of Windows Interesting Webs  Telecomunications

 


Nuevo concurso para España, Argentina, Brasil, Chile, Colombia, Ecuador, México, Perú y Portugal.

App Inventor 2
Programming mobile phones with Android 
by App Inventor 2 - Juan Antonio Villalpando

- Initiation Tutorial App Inventor 2 -

Return to tutorial index

____________________________

46.- Procedures.

p46_procedimientos

- Presentation

A Procedure is a piece of code that can perform an action, this Procedure we can call it from another part of the program.

The usefulness of a Procedure is that sometimes we must make pieces of repetitive codes; with the Procedures we can create a code and call it when it suits us.

They are also commonly used Procedures to improve the presentation of the code.

The Procedure we can supply input values ​​and it will return a result.

Let's see a code using the Pythagorean Theorem Procedure, although in this case is not very useful to use as the code is small to others is not repetitive.

_________________
Design

_________________
Blocks

________________________________________________________________________

In this drawing animated look at how variables are added.
Source: AppInventor

____________________________________

Procedure run

This type of procedure is used to change properties, it does not return a result.

______________________

Although it can also be used to change global variables in the example below we have declared one global variable called sum,

each time you call the Add it up procedure, the variable sum will increase its value by 5 and

perform various operations with the Properties.

The variable sumalo, changes when called to the process and we can utilarla elsewhere window.

___________________________

 

- My e-mail:
juana1991@yahoo.com
- Who I am. - Cookies. Texts and images propierty autor:
© Juan A. Villalpando
Not copy texts neither images.
We use our own cookies and third-party cookies on our websites to maintain the session and your preferences, customize your user experience and obtain website use statistics.
Si continúa navegando consideramos que acepta su uso. OK    Más información