Operator
|
Action
|
Code
|
( ) |
Group subexpressions
|
(4-3) * (12/nVar2) |
**, ^ |
Exponentiation
|
? 3 ** 2 ? 3 ^ 2 |
*, / |
Multiplication and
division
|
? 2 * 7 ? 14 / 7 |
% |
Modulus (remainder)
|
? 15 % 4 |
+, - |
Addition and
subtraction
|
? 4 + 15 |
Buat contoh, silahkan diikuti bikin form pake FoxPro seperti gambar di bawah ini.
Pengaturan dari tiap objeknya:
Nama Obyek
|
Properties
|
Nilai
|
Text1
|
value
|
=0
|
Text2
|
value
|
=0
|
Text3
|
value
|
=0
|
Command1
|
caption
|
Tambah
|
Command2
|
caption
|
Kurang
|
Command3
|
caption
|
Kali
|
Command4
|
caption
|
Bagi
|
Command5
|
caption
|
Sisa bagi
|
Command6
|
caption
|
Pangkat
|
Optiongroup1
Option1
Option2
Option3
Option4
Option5
Option6
|
buttoncount
|
6
|
caption
|
Tambah
|
|
caption
|
Kurang
|
|
caption
|
Kali
|
|
caption
|
Bagi
|
|
caption
|
Sisa bagi
|
|
caption
|
Pangkat
|
Buat Codingnya disesuaikan seperti ini ya...
Nama Obyek
|
Procedure
|
Command1
|
Click
|
with
thisform
.text3.value=.text1.value+.text2.value
endwith
|
|
Command2
|
Click
|
with
thisform
.text3.value=.text1.value-.text2.value
Endwith
|
|
Command3
|
Click
|
with
thisform
.text3.value=.text1.value*.text2.value
endwith
|
|
Command4
|
Click
|
with
thisform
.text3.value=.text1.value/.text2.value
endwith
|
|
Command5
|
Click
|
with
thisform
.text3.value=.text1.value %
.text2.value
endwith
|
|
Command6
|
Click
|
with
thisform
.text3.value=.text1.value**.text2.value
endwith
|
|
Option1
|
Click
|
with
thisform
.text3.value=.text1.value+.text2.value
endwith
|
|
Option2
|
Click
|
with
thisform
.text3.value=.text1.value-.text2.value
endwith
|
|
Option3
|
Click
|
with
thisform
.text3.value=.text1.value*.text2.value
endwith
|
|
Option4
|
Click
|
with
thisform
.text3.value=.text1.value/.text2.value
endwith
|
|
Option5
|
Click
|
with
thisform
.text3.value=.text1.value %
.text2.value
endwith
|
|
Option6
|
Click
|
with
thisform
.text3.value=.text1.value**.text2.value
endwit
|
0 Response to "Cara menggunakan Operator Aritmatika Foxpro"
Posting Komentar