Click here to Skip to main content
16,004,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Approximate zero values in an array Pin
David Skelly10-Dec-09 2:02
David Skelly10-Dec-09 2:02 
GeneralRe: Approximate zero values in an array Pin
Richard MacCutchan10-Dec-09 2:41
mveRichard MacCutchan10-Dec-09 2:41 
GeneralRe: Approximate zero values in an array Pin
EliottA10-Dec-09 2:45
EliottA10-Dec-09 2:45 
GeneralRe: Approximate zero values in an array Pin
Johnkokk10-Dec-09 6:08
Johnkokk10-Dec-09 6:08 
GeneralRe: Approximate zero values in an array Pin
nlarson1110-Dec-09 8:46
nlarson1110-Dec-09 8:46 
GeneralRe: Approximate zero values in an array Pin
Johnkokk10-Dec-09 20:52
Johnkokk10-Dec-09 20:52 
GeneralRe: Approximate zero values in an array Pin
nlarson1111-Dec-09 2:05
nlarson1111-Dec-09 2:05 
GeneralRe: Approximate zero values in an array Pin
Gideon Engelberth11-Dec-09 4:56
Gideon Engelberth11-Dec-09 4:56 
Then add some error checking. Assuming you put this code in a method, you can do the check at the right at the top of the method to make sure that the parameter a) is not nothing, b) does not start with a zero, and c) does not end with a zero and throw the appropriate exception. Like so:

VB
Private Sub Interpolate(ByVal values() As Single)
    If values Is Nothing Then Throw New ArgumentNullException("values")
    'nothing to do in this routine and the other error checks would cause errors
    If values.Length = 0 Then Exit Sub
    If values(0) = 0 Then 
        Throw New ArgumentException("Value array cannot start with a 0.", "values")
    End If
    If values(values.Length - 1) = 0 Then 
        Throw New ArgumentException("Value array cannot end with a 0.", "values")
    End If

    'other code to do interpolation here
End Sub

GeneralRe: Approximate zero values in an array Pin
Gideon Engelberth11-Dec-09 4:51
Gideon Engelberth11-Dec-09 4:51 
GeneralRe: Approximate zero values in an array Pin
peterchen11-Dec-09 2:43
peterchen11-Dec-09 2:43 
QuestionHow to get Hexadecimal code Pin
Pasan1489-Dec-09 23:01
Pasan1489-Dec-09 23:01 
AnswerRe: How to get Hexadecimal code Pin
Luc Pattyn9-Dec-09 23:38
sitebuilderLuc Pattyn9-Dec-09 23:38 
AnswerRe: How to get Hexadecimal code Pin
David Skelly10-Dec-09 2:16
David Skelly10-Dec-09 2:16 
Questionmimic HTML frame - Access subforms Pin
john john mackey9-Dec-09 12:47
john john mackey9-Dec-09 12:47 
AnswerRe: mimic HTML frame - Access subforms Pin
_Damian S_9-Dec-09 19:13
professional_Damian S_9-Dec-09 19:13 
GeneralRe: mimic HTML frame - Access subforms Pin
john john mackey10-Dec-09 5:30
john john mackey10-Dec-09 5:30 
QuestionKey press problem Pin
Pasan1489-Dec-09 6:58
Pasan1489-Dec-09 6:58 
AnswerRe: Key press problem Pin
Dave Kreskowiak9-Dec-09 7:25
mveDave Kreskowiak9-Dec-09 7:25 
AnswerRe: Key press problem Pin
Wes Aday9-Dec-09 7:54
professionalWes Aday9-Dec-09 7:54 
AnswerRe: Key press problem Pin
Luc Pattyn9-Dec-09 8:31
sitebuilderLuc Pattyn9-Dec-09 8:31 
QuestionError 53 (HRESULT 0x80070002) calling DLL from DLL Pin
Gennady Oster9-Dec-09 6:13
Gennady Oster9-Dec-09 6:13 
AnswerRe: Error 53 (HRESULT 0x80070002) calling DLL from DLL Pin
Dave Kreskowiak9-Dec-09 7:17
mveDave Kreskowiak9-Dec-09 7:17 
GeneralRe: Error 53 (HRESULT 0x80070002) calling DLL from DLL Pin
Gennady Oster9-Dec-09 7:43
Gennady Oster9-Dec-09 7:43 
AnswerRe: Error 53 (HRESULT 0x80070002) calling DLL from DLL Pin
The Man from U.N.C.L.E.9-Dec-09 7:26
The Man from U.N.C.L.E.9-Dec-09 7:26 
GeneralRe: Error 53 (HRESULT 0x80070002) calling DLL from DLL Pin
Gennady Oster9-Dec-09 7:46
Gennady Oster9-Dec-09 7:46 

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.