peri hokiperihokiclarustologisticsrimashaop.compola taktis menang gates of olympus x1000 perihokipemain perihoki bongkar trik jepep starlight princess x1000perihoki beri panduan lengkap bermain mahjong ways 2 pgsofttips cara penghasil uang pgsoft mahjong ways 2 perihokimahjong wins 3 perihoki memberikan penggali terbesarfenomena gates of olympus buka peluang besar bagi duta76cara dapat pola emas rahasia di duta7 wild west goldtrik menang pgsoft mahjong ways 2 modal receh maxwin duta76duta76 main pgsoft mahjong ways 2 di sela istirahatscatter hitam mahjong wins 3 spin pasti jepe duta76perihoki spin mahjong ways 2 pgsoft scatter hitam maxwinsimbol mahjong wins 3 yang sering muncul di awal perihokitrik gampang menang mahjong winscuan mahjong wins 3 tanpa hentipola spin taruhan kecil mahjong winsstrategi kunci scatter hitam beruntungacor total mahjong wayskemenangan maksimal mahjong wayskemenangan pria pekanbaru mahjong waysmahjong wins3 fenomena baru sumatera baratmenangkan mahjong dengan lincahmenembus batas keberuntungan mahjong waysmenjajal keberuntungan di mahjong wayspola gratis mahjong ways1scatter hitam senjata rahasia mahjong winsteknik spinning menguntungkan untuk scatter hitamanalisis rtp tertinggi mahjong winsfenomena scatter hitam mahjong winsibu rumah tangga dan keberuntungan mahjongkeseruan main mahjong wins3menang mahjong pengguna baru di sosial mediamenghargai setiap momen di mahjong waysserunya main mahjong di warung internetspin slow motion mancing scatterstrategi jitu maxwin mahjong waysstrategi jitu menang mahjong modal kecil jackpot besaranak kampung papua menggemparkan mahjongkeajaiban scatter hitam mahjong wayskeberhasilan joni mahjong winskejaiban mahjong ways di ujung jalanketua mahjong wins3 kehadiran kemenangan dimulai dari balimahjong kehadiran yang menguntungkanmahjong menggila adat88panduan kilat raih 108 jutatips memenangkan mahjongbarista kopi menang 110 juta spin mahjongdakota76 scatter hitam mahjong wins 3gagal cpns menang mahjong wins 3 rp120 jutakisah karyawan minimarket dapat thr lebih awal mahjong winskisah pelajar sma kuasai mahjong wins 3 inspirasi sekolahkisah penjaga parkir tanah abang motor baru mahjong winskisah sukses ibu rumah tangga bandung mahjong winsmahasiswa kkn beli iphone15 mahjong wins3 dakotamantan anak band influencer mahjong scatter hitampola rtp senin gates of olympus guru matematikaidola scatter hitam gampang meledakidola sensasi jackpotidola pola scatter hitamidola hasilkan jackpot dalam waktu singkatidola mahjong wins 3 bocortukang cuci motor menemukan keberuntungan di mahjong

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: drivers/Session_files_driver.php

Line Number: 108

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Cannot change save handler when headers already sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Cannot start session when headers already sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

Các toán tử trong Visual Basic (Operators) - Freetuts
BẮT ĐẦU
RẺ NHÁNH
VÒNG LẶP
LỆNH NHẢY
KIỂU DỮ LIỆU
NÂNG CAO
CÁC CHỦ ĐỀ
BÀI MỚI NHẤT
MỚI CẬP NHẬT

Các toán tử trong Visual Basic (Operators)

Trong bài này mình sẽ giới thiệu các toán tử trong Visual Basic, đây là những toán tử thường dùng và rất quan trọng trong lập trình mà hầu như ngôn ngữ nào cũng có.

test php

banquyen png
Bài viết này được đăng tại freetuts.net, không được copy dưới mọi hình thức.

Toán tử hay còn gọi là Operators, dùng để tạo ra những biểu thức tính toán, giải quyết nhiều bài toán khác nhau từ đơn giản đến phức tạp.

Mình sẽ liệt kê ra 5 loại toán tử trong VB, đó là toán tử gán, toán tử số học, toán tử logic, toán tử so sánh, và cuối cùng là toán tử ghép nối.

1. Toán tử số học trong Visual Basic

Trong Visual Basic, toán tử số học được dùng để thực hiện các phép tính số học cơ bản như cộng, trừ, chia, v.v. dựa trên yêu cầu của chúng ta.

Bài viết này được đăng tại [free tuts .net]

Bảng sau liệt kê các loại toán tử số học khác nhau có sẵn trong Visual Basic.

Toán tử Mô tả (a = 6, b = 3)
+ Cộng hai vế a + b = 9
- Trừ hai vế a - b = 3
* Nhân hai vế a * b = 18
/ Chia hai vế a / b = 2
\ Chia lấy phần nguyên a \ b = 2
Mod Chia lấy phần dư. a Mod b = 0
^ Lũy thừa. a ^ b = 216

2. Toán tử gán trong Visual Basic

Trong Visual Basic, các toán tử gán được dùng để gán một giá trị cho một biến.

Bảng sau liệt kê các loại toán tử gán khác nhau có sẵn trong Visual Basic.

Toán tử Ví dụ
= a = 10
+= a += 10 <=> a = a + 10
-= a -= 10 <=> a = a - 10
*= a *= 10 <=> a = a * 10
/= a /= 10 <=> a = a / 10
\= a \= 10 <=> a = a \ 10
^= a ^= 10 <=> a = a ^ 10

Kể từ toán tử thứ 2 trở đi thì đó là cách ghi tắt, nó sẽ thực hiện toán tử trước rồi mới đến toán tử gán.

Ví dụ a += b thì thực hiện phép cộng trước, sau đó gán kết quả vào a: a = a + b.

3. Toán tử logic trong Visual Basic

Trong Visual Basic, toán tử logic / Bitwise dùng để thực hiện phép toán logic giữa hai toán hạng như AND, OR, v.v. dựa trên yêu cầu của chúng ta.

Toán tử Logical / Bitwise sẽ luôn làm việc với biểu thức Boolean (đúng hoặc sai) và trả về giá trị Boolean.

  • Đúng => True
  • Sai => False

Bảng sau liệt kê các loại toán tử logic / bitwise khác nhau có sẵn trong Visual Basic

Toán tử Mô tả (a = True, b = False)
And Trả về true nếu cả hai vế trái và phải đều true,
Ngược lại trả về false.
a And b = False
Or Trả về true nếu vế phải hoặc trái true,
Trả về false khi cả hai vế đều false
a Or b = True
Not Phủ định lại giá trị.
Nếu biểu thức true thì trả về false
Nếu biểu thức false thì trả về true
Not(a And b) = True
Xor Trả về true nếu một trong hai vế trái và phải true. a Xor b = True

4. Toán tử so sánh trong Visual Basic

Trong Visual Basic, các toán tử so sánh dùng để xác định xem hai toán hạng được xác định có bằng nhau, lớn hơn hay nhỏ hơn, v.v. hay không ,dựa trên yêu cầu của chúng ta.

Bảng sau liệt kê các loại toán tử so sánh khác nhau có sẵn trong Visual Basic.

Toán tử Mô tả (a = 10, b = 5)
< Bé hơn a < b = False
<= Bé hơn hoặc băng.f a <= b = False
> Lớn hơn a > b = True
>= Lớn hơn hoặc bằng a >= b = True
= So sánh bằng a = b = False
<> So sánh không bằng a <> b = True

5. Toán tử ghép nối trong Visual Basic

Trong Visual Basic, các toán tử nối dùng để nối các toán hạng dựa trên các yêu cầu của chúng ta.

Bảng sau liệt kê các loại toán tử nối khác nhau có sẵn trong Visual Basic.

Toán tử Mô tả (a = Hello, b = World)
& Nó sẽ nối hai biểu thức đã cho. a & b = HelloWorld
+ Nó được sử dụng để thêm hai số hoặc nối hai biểu thức chuỗi a + b = HelloWorld

Trên là danh sách những toán tử thường dùng trong Visual Basic. Vẫn còn một số toán tử khác nhưng mình không đề cập đến trong bài, nếu sau này có dùng tới thì mình sẽ giải thích kỹ hơn ngay lúc đó.

Cùng chuyên mục:

Xử lý chuỗi trong Visual Basic

Xử lý chuỗi trong Visual Basic

Dữ liệu String rất quan trọng, nó có thể lưu trữ hầu hết mọi loại…

Mảng trong Visual Basic (Array)

Mảng trong Visual Basic (Array)

Lệnh continue trong Visual Basic

Lệnh continue trong Visual Basic

Câu lệnh continue giúp vòng lặp ngay lập tức chuyển sang lần lặp tiếp theo…

Lệnh Exit trong Visual Basic

Lệnh Exit trong Visual Basic

Trong bài này ta sẽ tìm hiểu về lệnh Exit trong Visual Basic

Vòng lặp For Each trong Visual Basic (VB)

Vòng lặp For Each trong Visual Basic (VB)

Trong Visual Basic, vòng lặp For Each dùng để lặp qua các phần tử trong…

Vòng lặp Do While trong Visual Basic (VB)

Vòng lặp Do While trong Visual Basic (VB)

Vòng lặp Do While dùng trong trường hợp bạn chưa biết tổng số lần lặp…

Vòng lặp While trong Visual Basic (VB While Loop)

Vòng lặp While trong Visual Basic (VB While Loop)

Nếu vòng lặp For biết trước được tổng số lần lặp thì vòng lặp While…

Vòng lặp for trong Visual Basic (For Loop)

Vòng lặp for trong Visual Basic (For Loop)

Vòng lặp là một hành động được lặp đi lặp lai nhiều lần, và trong…

Lệnh Select Case trong Visual Basic

Lệnh Select Case trong Visual Basic

Lệnh Select Case dùng trong trường hợp điều kiện rẻ nhánh là một giá trị…

Toán tử ba ngôi trong Visual Basic: If ((condition), exp1, exp2)

Toán tử ba ngôi trong Visual Basic: If ((condition), exp1, exp2)

Nếu bạn đã từng học những ngôn ngữ khác rồi thì không còn quá xa…

Lệnh if else trong Visual Basic: Dùng để rẻ nhánh chương trình

Lệnh if else trong Visual Basic: Dùng để rẻ nhánh chương trình

Trong bài này ta sẽ học cách sử dụng lệnh If Else trong Visual Basic

Comment trong Visual Basic: Tạo ghi chú trong quá trình code

Comment trong Visual Basic: Tạo ghi chú trong quá trình code

Hầu như ngôn ngữ nào cũng hỗ trợ tính năng comment, và VB cũng không…

Bảng Keywords trong Visual Basic

Bảng Keywords trong Visual Basic

Không chỉ riêng mỗi Visual Basic là có những keywords này, mà mỗi ngôn ngữ…

Các kiểu dữ liệu trong Visual Basic - VB Data Type

Các kiểu dữ liệu trong Visual Basic - VB Data Type

Trong Visual Basic, kểu dữ liệu data type dùng để khai định dạng dữ liệu…

Chương trình Visual Basic Hello World

Chương trình Visual Basic Hello World

Visual Basic có một cú pháp lập trình rất đơn giản.

Cài đặt Visual Studio

Cài đặt Visual Studio

Để cài đặt Visual Basic bạn chỉ cần tải Visual Studio Editor, sau đó cài…

Top