Ada kala nya kita perlu mengecek apakah aplikasi yang sedang kita jalankan berjalan dengan debug atau run exe. Atau mungkin kita ingin "sesuatu" berjalan berbeda saat run exe dibanding saat debug???
Okay then, kita buat design form sebagai berikut:
Code sebagai berikut:
Private Function devmode() As Boolean
Dim ltest As Long
Debug.Assert Not chkmode(ltest)
devmode = ltest = 1
End Function
Private Function chkmode(ltest As Long) As Boolean
ltest = 1
End Function
Private Sub Form_Load()
If devmode() = True Then
Label1.Caption = "Run Debug Mode"
Else
Label1.Caption = "Run Exe Mode"
End If
End Sub
Hasil run debug dari Development Environment.
Hasil run exe.
- Home
- Tutorial Bahasa Indonesia
- _Visual Basic 6 (VB6)
- __VB6 Basic & General
- __VB6 MySQL
- _Visual Basic .NET
- __VB.NET Basic & General
- __VB.NET Ms Access
- __VB.NET MySQL
- __VB.NET Printing
- _ASP.NET
- _C#
- _PHP
- _Flutter
- _MySQL
- _SQL Server
- _SQL Reporting (SSRS)
- English Tutorial
- Youtube Channel
- About Me
- _About Me and This Blog
- _Stories Of Life
- _Portofolio
0 Comments