best forex rebate a compound operation (section) has one or more statements consrebateinforextradingting of them included by curly brackets ……" />

Current Location: Home» » Full text

Forex EA Programming Tutorial - Operators

2023/2/25 5:27:05  Classification:   Participation: 6  

  1 Compound bestforexrebateex.com">best forex rebate a compound operation (section) has one or more statements cons rebateinforextradingting of them included by curly brackets and parentheses ({}), rebatemeaninginforexe that the parentheses are not followed by a semicolon (;) for cashback forex if(x==0){Print( invalidpositionx=,x);return;}2 expression an expression by a semicolon (;) end, a semicolon (;) is also an operator, representing the end of a statement for example: i=4;i=a=7;// error, an expression can not be two and more than two equal sign (=) function call statement, such as FunctionName(a);// calls a function named FunctionName, the functions parameter value is the string a3break statementbreak statement makes the program jump out of the most recent, while, for, switch statementIf the required work has been done inside a rebatesinforex statement, then you can use the break statement to jump out of the loop for example: for(a=0;a<aref=nofollowref=nofollowref=nofollowrray_size;a++)if((array[a]==0)break;The meaning of this code is, iterate through the array array, if you find a value of 0 in the array when, then jump out of the loop 4continuecontinue used to end the execution of the current loop statement body, directly into the next loop, available in the for and while loop body statements for example: inta=0;for(intj=0;j<10;j++){if(array[j]<=0){continue ;//Continue is encountered, the program enters the next loop, will not execute a+=array[j] statement, note that at this point is not jump out of the loop}a+=array[j];} Note the difference between continue and break, continue is directly into the next loop of this loop body, while break is directly jump out of the loop body 5returnreturn statement ends the execution of the current function and returns a value to the program that calls the function, but also can not return a value for example: intCalcSum(intx,inty){return(x+y);// function execution is broken here, the return value of x+y; the statement will not be executed after the inti=x*y;// change the statement can not be executed} If you want to control the function directly end, directly use the return statement can be 6 conditional statement if-else For example: if (a==0){Print(a);}elseif(a<0){Print(less than 0);}else{Print(greater than 0);}The above code is interpreted as follows: If the value of a 0, then print the string a; if a<0 then print less than 0; otherwise print greater than 07switch statement example is as follows: intx=1switch(x){case1:Print(CASE1);// the value of x is 1break;case2:case3:Print(CASE2or3);// xs value is 2 or 3break;default:Print(NOT1,2,3);//xs value is not 1,2,3break;}switch inside if the program does not encounter break statement, or continue to execute know encounter break; or the end of the program block 8 loop statement while, for the following statement intk=1; intn=10;while(k<n)//judge whether the condition inside the brackets is true, if so, before executing the block belonging to while{Print(k);k++;}//will print from 1 to 10for(intn=0;n<10;n++)Print(n);//will print from 0 to 9

More great recommendations:

Source: Welcome to share this article, please retain the source of reproduction!

Related articles

I want to subscribe| Site Map| Baidu Map| I want to submit an article| Advertising Cooperation|

Copyright © 2014 best forex rebateAll rights reserved