Question about Compilers & Programming Tools

1 Answer

Need help in Special Formatting Number

Sir,
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.

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 2 Answers

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
'not multiple
' do this
Else
' is multiple
' do something else
End If


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
Else
GoTo error1
End If
Else
GoTo error1
End If
result = Decimal.divide(n, d)
remainder = Decimal.remainder(n, d)
If remainder = 0 Then
div = result
Else
div = 0
End If

Exit Function
error1:
msgbox("Numbers must be non-zero numerics", , "Multiple check error")
div = 0
End Function

End Function

Posted on Nov 29, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

I need library management source code in vb 6.0


Please Download it from here!!

Don't forget to vote!!!
Regards
Vikas Agrawal
MCA

Dec 27, 2009 | Microsoft Visual Basic 6.0 for PC

2 Answers

CPU Scheduling VB.Net Sample Program


well threading does this for you, look at the thread class and related classess in .net

Jun 02, 2009 | Microsoft Visual Basic .NET Standard 2003...

2 Answers

Free visual basic source code salary database sample


you solution is her



Building Websites with VB.NET and DotNetNuke 4/by Daniel N. Egan (Author), Steve Valenzuela (Author), Michael Washington (Author)
Description
DotNetNuke is an open-source Content Management System and web application framework. DotNetNuke has taken the Microsoft world by storm and now at version 4, its community has grown to over 200,000 users. This book covers virtually everything you need to know to get your DotNetNuke website up and running. Concisely written and with clear explanations, this book is covers installation, administration, deployment, site creation and all of the basic built in DotNetNuke modules. For developers, chapters on the core architecture, skinning and custom modules, including coverage of the DAL+, give you the skills to customize and extend your site. The book starts off by giving you a deep understanding of working with basic DotNetNuke sites, guiding you through the features and giving you the confidence to create and manage your site. After that, you will journey to the heart of DotNetNuke, and learn about its core architecture. Always concise, relevant and practical, you will find out what makes DotNetNuke tick, and from there, you will be ready to customize DotNetNuke. Developers will enjoy the detailed walkthrough of creating a new custom modules. Special emphasis is given to the DAL+, an extended feature set of the DotNetNuke Data Access Layer (DAL). You will see how to create custom modules with the DAL+, and invigorate your module development. Web designers will enjoy the material on skinning, helping them to create a new look for their site. You will learn about creating new skins, and packaging them up for easy deployment. You will master all of this as you leap into the development of a DotNetNuke 4 site. This book will give you the skills to create and manage DotNetNuke websites as quickly as possible. You will:
* Install and configure DotNetNuke
* Master the standard modules
* Understand the core architecture of DotNetNuke
* Explore the inner workings of DotNetNuke modules
* Extend DotNetNuke using the DAL and DAL+ to create powerful custom modules
* Create your own skin using a HTML Editor
* Find out about where and how to host and deploy your site
You can use this book to help you set up and administer a DotNetNuke portal, even if you have a limited knowledge of ASP.NET. You will learn how to setup and administer an example site, stepping through all the tasks to ease your learning. If you are a developer, this book will help you extend the DotNetNuke portal by first helping you understand how the core framework works and then show you how to create custom modules and skins. A rudimentary knowledge of VB.NET programming is assumed, but the emphasis is not on becoming a better VB.NET programmer but on taming DotNetNuke. This book has been written for both the beginner wanting to set up a website and also ASP.NET developers with a grasp of VB.NET who want a deeper understanding of how to work with DotNetNuke. To work with the DotNetNuke code, you will need access to Visual Web Developer Express or Visual Studio .NET 2005. No prior knowledge of DotNetNuke is assumed.

download link:
http://w14.easy-share.com/1701584071.html
or:
http://dep

May 03, 2009 | Microsoft Visual Basic Enterprise Edition...

1 Answer

Looking for the code of "print"


You will be using the "Print # Statement" (see the VB Help file for full details). You may also want to check out the printer dialog control to allow your users to select a printer to print to.

Apr 24, 2009 | BDG Publishing Visual Basic Source Code...

2 Answers

VB 6.0 ROUNDING A NUMBER


Use the Math.Round() function. It takes two arguments, the first is your number or a variable holding your number and the second is the number of decimal places. This will only round to fractions of a whole number though and you need to round to the nearest 10. So divide your number by 10 before you round to shift the decimal place once to the left and multiply by 10 again afterwards to shift it back again.

answer = Math.Round(32.1 / 10, 0) * 10

Apr 02, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

Change password


Take a look to these sources:
www.daniweb.com/forums/thread147578.html
http://www.xtremevbtalk.com/showthread.php?t=66397
www.dreamincode.net/forums/showtopic50989.htm
http://bytes.com/groups/net-vb/370700-login-name-change-password-form-vb-net
www.bigresource.com/VB-Change-password-character-DFHreV6rQq.html

I hope they could help you Good luck

Mar 04, 2009 | Compilers & Programming Tools

1 Answer

Multiple option selection in listbox of VB


Set the 'MultiSelect' property to allow the user to select multiple options by holding down the CTRL or SHIFT keys.

Feb 14, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

Formatting/Rounding number


forget its not your cup of tea

Jul 31, 2008 | Compilers & Programming Tools

1 Answer

Auto-Delete in just one click


You need to use the FileSystemObject of the Scripting Runtime library. See here. This library is not part of the standard VB references by default so remember you will have to find it in the "References" list and check it so that it is added to your project; it is under "References" as "Microsoft Scripting Runtime Library". However bear in mind that calls to delete files from a VB app are high-level requests to the O/S, not direct kernel commands. If you have any kind of file lock contention you won't be able to delete a given file.

The best way to blast an entire drive would be use the DOS 'format' command. You cannot run 'format' though on the system drive, and it will take longer to format a drive than to erase all files, though formatting will really do it. You would use the Shell command in VB to execute the DOS command.

See here and here.

You can also use the Shell command to execute the "del" DOS command recursively against the drive. The FileSystemObject is basically doing that under the covers, so it's not too far away. Finally, you can use API code to do it, though I am guessing you are not quite there yet in your experience. But if so, take a look at these articles:

http://allapi.mentalis.org/vbtutor/iapi2.shtml
http://www.devarticles.com/c/a/Visual-Basic/Accessing-the-Windows-API-in-Visual-Basic/2/

Mar 30, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

Not finding what you are looking for?
Compilers & Programming Tools Logo

Related Topics:

112 people viewed this question

Ask a Question

Usually answered in minutes!

Top Compilers & Programming Tools Experts

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18298 Answers

Florin

Level 3 Expert

733 Answers

Are you a Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...