C# operators

Info about design forms features
jkrsik
Posts: 30
Joined: 06 Oct 2014, 13:10

C# operators

Postby jkrsik » 06 Jan 2016, 14:53

size=150C# operators/size
Version P - 16.098.25+

New operators based on url=https://msdn.microsoft.com/en-us/library/6a71f45d.aspxC# operators/url are now added to SCIA Design Forms.

bPrimary operators/b
list
*x++ - increment - return value and than update the value of x that is one greater.
Common use in FOR cycle
codeFOR(i = 0; i < 10; i++) {
TEXT(i);
} /code
can be used also in assign. Next example assign value 5 to d and increase r to 6
coder = 5;
d = r++;
TEXT("r = " & r); /code/*:m
*x-- - decrement - return value and than update the value of x that is one lesser.
Common use in FOR cycle
codeFOR(i = 10; i > 5; i--) {
TEXT(i);
} /code
can be used also in assign. Next example assign value 5 to d and decrease r to 4
code
r = 5;
d = r--;
TEXT("r = " & r);/code/*:m/list:u

bUnary operators/b
list
*++x - increment - first increase the value x and than return value.
Next example increase value r to 6 and than assign 6 to d
coder = 5;
d = ++r;
TEXT("r = " & r);/code/*:m
*--x - decrement - first decrease the value x and than return value.
Next example decrease value r to 4 and than assign 4 to d
coder = 5;
d = --r;
TEXT("r = " & r); /code/*:m/list:u

bAssignment operators/b
list
*x+=y - increment assignment. It is equivalent to x = x + y/*:m
*x-=y - decrement assignmebt. It is equivalent to x = x - y/*:m
*x*=y - multiplication assignment. It is equivalent to x = x * y/*:m
*x/=y - division assignment. It is equivalent to x = x / y /*:m/list:u

See example:
attachment=0
Operators.cls
C# operators
(30.58 KiB) Downloaded 479 times
/attachment

Return to “Design forms features”

Who is online

Users browsing this forum: No registered users and 4 guests