« Counter of character variable | Main | Substitution and display »

December 15, 2005

Numeric variable

7thlanguage can use numeric variable.
Numeric values are stored as double precision.
Floating and integer values are also stored as double precision.
Name of numeric variable is started with % character as follows

%age of my friend

Numeric variable can display its value using [] as follows

[%age of my friend]

Calculation can be done like C language but method of calculations is restricted at the moment and can use following formulas only.

values showed below 10 can changed with another value

[%age of my friend++]
[%age of my friend--]
[%age of my friend+=10]
[%age of my friend-=10]

Numeric variable does not have counter of it self like character variable.

sample30.7th

title age_of_my_friend
[%age of my friend=18]
My friend is [%age of my friend] years old.
[%age of my friend++]
My friend well be[%age of my friend] years old next year.
[%age of my friend=20]
My friend is [%age of my friend] years old.
[%age of my friend--]
My friend was [%age of my friend] years old last year.
end

---------------------- 7threader English Version -----------------------

My friend is 18 years old.
My friend well be19 years old next year.
My friend is 20 years old.
My friend was 19 years old last year.

-------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------

sample31.7th
title age_of_my_friend
[%age of my friend=18]
My friend is [%age of my friend] years old.
[%age of my friend+=10]
My friend well be [%age of my friend] years old ten years later.
[%age of my friend=20]
My friend is [%age of my friend] years old.
[%age of my friend-=10]
My friend was [%age of my friend] years old ten yeas ago.
end

---------------------- 7threader English Version -----------------------

My friend is 18 years old.
My friend well be 28 years old ten years later.
My friend is 20 years old.
My friend was 10 years old ten yeas ago.

-------- 7threader English Version Copy Right Yuki Nanotabi 2004/2/28 Ver 1.00 ---------

|

« Counter of character variable | Main | Substitution and display »