Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 75

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 80

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 104

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 115

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 120

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 149

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 161

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 166

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 196

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 208

Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 214

Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 115

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:75) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Stefan Thoolen .nl | VB6 Function Database

Visual Basic 6 function "decbin"

Go back

Below you'll find the source for the Visual Basic 6 function decbin.

Attribute VB_Name = "modDecbin"
' This function is downloaded from:
' http://www.stefanthoolen.nl/archive/vb6-functions/
' 
' You may freely distribute this file but please leave all comments, including this one, in it.
' 
' @Author Stefan Thoolen <mail@stefanthoolen.nl>

Option Explicit

''
' Makes a binary string from an integer number
' Same syntax as the PHP function 'decbin'
' See also: http://www.php.net/manual/en/function.decbin.php
' @param    Integer number          The decimal value
' @return   String                  A binary presentation of the number (ex.: 00100111)
' @author   Stefan Thoolen <mail@stefanthoolen.nl>
Public Function decbin(ByVal number As Integer) As String
    Dim retval As String
    Do Until number = 0
        If (number Mod 2) Then retval = "1" & retval Else retval = "0" & retval
        number = number \ 2
    Loop
    decbin = retval
End Function