VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Decreases a number by a specified value.

by Todd Wayman (8 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Thu 22nd March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Decreases a number by a specified value.

Rate Decreases a number by a specified value.



'* Start Comment Block  ***********************************
'* Generated using VB 3.0 ToolBar
'* Author: Todd Wayman
'* Date: Mar, 22, 2001
'* Version: 1.00
'* Copyright © 2001 Todd Wayman; All rights reserved.
'* Procedure Title: Dec
' *************************************************************
'*
'* Disclaimer:
'*
'* This software is provided AS IS without warranty of any kind, either
'* express or implied. This includes without limitation the fitness for
'* a particular purpose or application and any warranties of merchantability.
'* The author shall not be liable for any damage, whether direct, indirect,
'* special, or consequential, arising from a failure of this software or
'* accompanying files to operate in a manner desired by the user. The author
'* shall not be liable for any damage to data or property which may be
'* caused directly or indirectly by the use of this program.
'* By using and/or installing this software YOU assume all responsibility.
'*
'* End Disclaimer
'*
'* Comments:
'* Decreases a value by a specified step value.
'*
'* Syntax:
'*
'* Inc Value, Step
'*
'* Value is the number to be increased
'* Step is amount to Decrease Value
'*
'* Example:
'*
'* X = 43
'*
'* Dec X, 3
'*
'* X = 400
'*
'*    OR
'*
'* X = 43
'*
'* Dec X, ""
'*
'* X = 42
'*
'* VB 3.0 or greater
'* End Comment Block  *************************************

On Error GoTo Exit_Dec:
If Val(StepVal) = 0 Then
StepVal = 1
Else
StepVal = Val(StepVal)
End If

Value = Val(Value)

Value = Value - StepVal
Exit Sub
Exit_Dec:
Exit Sub

End Sub

Download this snippet    Add to My Saved Code

Decreases a number by a specified value. Comments

No comments have been posted about Decreases a number by a specified value.. Why not be the first to post a comment about Decreases a number by a specified value..

Post your comment

Subject:
Message:
0/1000 characters