Question about Computers & Internet
Is there any way to write Code using VB so as to be able to check the given numbe is in multiple of a given number.
Here is one solution. You might consider adding more robust error handling.
if the decimal numbers passed to the div function are multiples i will be a non-zero number of that multiple otherwise i will be zero.
Dim i As Integer
i = div(12, 0)
If i = 0 Then
' do this
' is multiple
' do something else
Function div(ByVal numerator As Object, ByVal denominator As Object) As Integer
dim n , d decimal
Dim result As Decimal
Dim remainder As Decimal
If IsNumber(numerator) Is True _
And IsNumber(denominator) Is True Then
If numerator <> 0 Then
n = numerator
d = denominator
result = Decimal.divide(n, d)
remainder = Decimal.remainder(n, d)
If remainder = 0 Then
div = result
div = 0
msgbox("Numbers must be non-zero numerics", , "Multiple check error")
div = 0
Posted on Nov 29, 2008
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
Dec 27, 2009 | Microsoft Visual Basic 6.0 for PC
May 03, 2009 | Microsoft Visual Basic Enterprise Edition...
Apr 02, 2009 | Microsoft Visual Basic 6.0 for PC
Mar 04, 2009 | Computers & Internet
Feb 14, 2009 | Microsoft Visual Basic 6.0 for PC
Feb 04, 2008 | Computers & Internet
Jan 24, 2017 | VIA Computers & Internet
112 people viewed this question
Usually answered in minutes!