Share your opinion
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
|
RETURN - RETURN command
RETURN COMMAND
As the oriented objct language, gambas return value or not. It depends how to program your function. A function who not return value could be for example : PUBLIC SUB bonjour() dim a AS INTEGER a= 10 END But if you want to return value ,use the command RETURN. Tips : you have to define the value type returned for example : PUBLIC SUB fonction1() AS String de type texte PUBLIC SUB fonction1() AS FLOAT de type décimal PUBLIC SUB fonction1() AS Integer de type entier etc... In the returned function, you have to create a variable in the same type than the function(here valretourne) Well, you can code as this : RETURN valretourne In this example, when you click on a button, we go to the fonction1() , put the characters "ca a marché" in valretourne and we put in the "toto" string and you display in a messagebox. PUBLIC SUB fonction1() AS String DIM valretournee AS String valretournee = "ca a marché!" RETURN valretournee END PUBLIC SUB Button1_Click() toto = fonction1() Message.Info(toto) END regards Creation date : 08/10/2009 @ 08:39 Reactions to this article
| QUICK MENU
SEARCH
LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS
visitors visitors online ARCHIVES GAMBAS 1/2
|