Hướng dẫn cách dùng
Return Statement
NetTradeX PC
NetTradeX Android
NetTradeX iOS
NetTradeX Mobile
NetTradeX Advisors
-
User Guide for NTTX Advisors
- NetTradeX Advisors Terminal
-
Articles
-
NetTradeX Language: Introduction
- Language Basics
- Language Functions
-
Language System Objects
- Deal Management
- Order Management
- Indicators
- Object-Oriented Programming
-
DLL files
-
Object Account
-
Object Bars
-
Object Chart
-
Object datetime
-
Object History
-
Object file
-
Object Globals
-
Object Math
-
Object Symbols
-
Object System
Return Statement
The return statement terminates the current function and returns the control into the calling function
to the point immediately following the function call.
The expression value, if specified, is returned to the calling function.
If there is no return statement in a function, the execution finishes after the last operator of the
function and the control transfers into the calling function.
If the function does not return any value, the return type void should be used.
Example. Using return statement.
int Run()
{
System.Print("Max = "+findmax(55, 52));
return 0;
}
int findmax(int a, int b)
{
if(a>b)return a;
else return b;
}
Example. Using return to exit the function.
void DealInfo(int i)
{
if(i<0)
{
System.Print("i<0, exit");
return;
}
// processing the value i;
}