Click here to Skip to main content
15,888,325 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: What do you think visual data computing? Pin
Dave Kreskowiak5-Mar-13 1:19
mveDave Kreskowiak5-Mar-13 1:19 
GeneralRe: What do you think visual data computing? Pin
David venewald5-Mar-13 14:23
David venewald5-Mar-13 14:23 
GeneralRe: What do you think visual data computing? Pin
Dave Kreskowiak5-Mar-13 15:56
mveDave Kreskowiak5-Mar-13 15:56 
QuestionHow to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
J.Mañago4-Mar-13 16:37
J.Mañago4-Mar-13 16:37 
AnswerRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
Dave Kreskowiak5-Mar-13 1:22
mveDave Kreskowiak5-Mar-13 1:22 
GeneralRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
J.Mañago6-Mar-13 22:58
J.Mañago6-Mar-13 22:58 
GeneralRe: How to Save,Retreive and modify .pdf files in Sql SERVER 2005 using VB.net control Adobe Pdf Viewer Pin
Dave Kreskowiak7-Mar-13 1:57
mveDave Kreskowiak7-Mar-13 1:57 
QuestionImplicit conversion operator(s) Pin
maxrock174-Mar-13 10:53
maxrock174-Mar-13 10:53 
I'm trying to create a class which behaves like a Double only allows values within a certain range.

One of the goals is to have it behave as a normal Double, i.e.: being able to assign Double values to it and pass it to functions taking a Double value.

VB
Public Class RDouble
    Public Sub New(ByVal D As Double, Optional ByVal Min As Double = 0, Optional ByVal Max As Double = 100)
        _MinValue = Min
        _MaxValue = Max
        _dValue = D

        If _dValue < _MinValue Then
            _dValue = _MinValue
        ElseIf _dValue > _MaxValue Then
            _dValue = _MaxValue
        End If
    End Sub

    Public _MinValue As Double
    Private _MaxValue As Double
    Private _dValue As Double

    Public Shared Widening Operator CType(ByVal d As RDouble) As Double
        Return d._dValue
    End Operator

    Public Shared Narrowing Operator CType(ByVal d As Double) As RDouble
        Return New RDouble(d)
    End Operator
End Class

Sub Main()
    Dim rd As New RDouble(50.0, 10.0, 100.0)
    rd = 20.54
    Dim D As Double
    D = Math.Round(rd)
End Sub


The problem with this code is of course that any assignment to the RDouble causes its boundaries to be "reset" since a new one is created with the default _MinValue and _MaxValue; and with the conversion operators being shared there is no way to access the Min/Max values of an instance.

Is there any way to fix this?
AnswerRe: Implicit conversion operator(s) Pin
Dave Kreskowiak5-Mar-13 2:24
mveDave Kreskowiak5-Mar-13 2:24 
QuestionVBScript Recordset Caching Pin
Feurich4-Mar-13 5:19
Feurich4-Mar-13 5:19 
AnswerRe: VBScript Recordset Caching Pin
Dave Kreskowiak4-Mar-13 7:38
mveDave Kreskowiak4-Mar-13 7:38 
GeneralRe: VBScript Recordset Caching Pin
Feurich4-Mar-13 7:45
Feurich4-Mar-13 7:45 
GeneralRe: VBScript Recordset Caching Pin
Dave Kreskowiak4-Mar-13 8:19
mveDave Kreskowiak4-Mar-13 8:19 
GeneralRe: VBScript Recordset Caching Pin
Feurich4-Mar-13 9:01
Feurich4-Mar-13 9:01 
GeneralRe: VBScript Recordset Caching Pin
Dave Kreskowiak4-Mar-13 10:16
mveDave Kreskowiak4-Mar-13 10:16 
GeneralRe: VBScript Recordset Caching Pin
Dave Kreskowiak4-Mar-13 12:48
mveDave Kreskowiak4-Mar-13 12:48 
GeneralRe: VBScript Recordset Caching Pin
Feurich4-Mar-13 20:17
Feurich4-Mar-13 20:17 
Questionarduino uno+Visual basic 6.0 Pin
arunsachin3-Mar-13 22:56
arunsachin3-Mar-13 22:56 
AnswerRe: arduino uno+Visual basic 6.0 Pin
Dave Kreskowiak4-Mar-13 1:30
mveDave Kreskowiak4-Mar-13 1:30 
AnswerRe: arduino uno+Visual basic 6.0 Pin
Eddy Vluggen4-Mar-13 8:50
professionalEddy Vluggen4-Mar-13 8:50 
Questioncalling OSK.exe from Vb.6 Pin
lovelushaha2-Mar-13 20:20
lovelushaha2-Mar-13 20:20 
AnswerRe: calling OSK.exe from Vb.6 Pin
Eddy Vluggen3-Mar-13 0:35
professionalEddy Vluggen3-Mar-13 0:35 
QuestionVisual Basic to launch Silverlight OOB with variables Pin
ChrisDuti28-Feb-13 4:30
ChrisDuti28-Feb-13 4:30 
AnswerRe: Visual Basic to launch Silverlight OOB with variables Pin
Eddy Vluggen28-Feb-13 5:03
professionalEddy Vluggen28-Feb-13 5:03 
GeneralRe: Visual Basic to launch Silverlight OOB with variables Pin
ChrisDuti28-Feb-13 5:28
ChrisDuti28-Feb-13 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.