Click here to Skip to main content
15,889,116 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Right Mouse Click in TextBox brings up strange menu Pin
CHill6015-Jan-15 6:00
mveCHill6015-Jan-15 6:00 
GeneralRe: Right Mouse Click in TextBox brings up strange menu Pin
KKW_acd15-Jan-15 6:48
KKW_acd15-Jan-15 6:48 
GeneralRe: Right Mouse Click in TextBox brings up strange menu Pin
CHill6015-Jan-15 6:57
mveCHill6015-Jan-15 6:57 
QuestionDJB2 Hash algorithm for VB Pin
SepPax13-Jan-15 11:39
SepPax13-Jan-15 11:39 
AnswerRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan13-Jan-15 21:53
mveRichard MacCutchan13-Jan-15 21:53 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax14-Jan-15 6:33
SepPax14-Jan-15 6:33 
GeneralRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan14-Jan-15 6:58
mveRichard MacCutchan14-Jan-15 6:58 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax14-Jan-15 9:54
SepPax14-Jan-15 9:54 
I have tried so many variants that I lost the path Sigh | :sigh:

BTW, the following is one of them

VB
Public Function CRC_calc_crc_bernstein(frame As String, len As Integer)

    Dim crc As UInt16 = 5831
    Dim tmp As UInt16 = 0
    Dim t As UInt16 = 0

    For i = 1 To len

        tmp = Mid(frame, i, 1)

        ' t = (crc << 5) + crc + tmp
        t = (crc * 33) + 1  'this is another variant
        t = t + crc
        t = t + tmp

    Next

    CRC_calc_crc_bernstein = crc

End Function


The main error I get is that usually after few cycles of For I get an Overflow exception
I tried the use of Ctype() and DirectCast() without success, so... I'm almost giving up.

Thanks in advance for your kind help.
GeneralRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan14-Jan-15 23:44
mveRichard MacCutchan14-Jan-15 23:44 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax15-Jan-15 10:37
SepPax15-Jan-15 10:37 
GeneralRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan15-Jan-15 21:38
mveRichard MacCutchan15-Jan-15 21:38 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax18-Jan-15 1:55
SepPax18-Jan-15 1:55 
GeneralRe: DJB2 Hash algorithm for VB Pin
Richard MacCutchan18-Jan-15 2:17
mveRichard MacCutchan18-Jan-15 2:17 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax18-Jan-15 3:32
SepPax18-Jan-15 3:32 
GeneralRe: DJB2 Hash algorithm for VB Pin
SepPax18-Jan-15 9:02
SepPax18-Jan-15 9:02 
QuestionVisual Studio 2010 Express on Windows 8.1 Pin
BobbyStrain12-Jan-15 14:11
BobbyStrain12-Jan-15 14:11 
AnswerRe: Visual Studio 2010 Express on Windows 8.1 Pin
vbmike13-Jan-15 4:15
vbmike13-Jan-15 4:15 
AnswerRe: Visual Studio 2010 Express on Windows 8.1 Pin
RUs12313-Jan-15 4:19
RUs12313-Jan-15 4:19 
GeneralRe: Visual Studio 2010 Express on Windows 8.1 Pin
BobbyStrain13-Jan-15 5:06
BobbyStrain13-Jan-15 5:06 
QuestionWhy this expression produce error Pin
dilkonika12-Jan-15 6:31
dilkonika12-Jan-15 6:31 
AnswerRe: Why this expression produce error Pin
Richard Deeming12-Jan-15 6:56
mveRichard Deeming12-Jan-15 6:56 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 7:12
dilkonika12-Jan-15 7:12 
AnswerRe: Why this expression produce error Pin
ZurdoDev12-Jan-15 7:23
professionalZurdoDev12-Jan-15 7:23 
GeneralRe: Why this expression produce error Pin
dilkonika12-Jan-15 7:32
dilkonika12-Jan-15 7:32 
GeneralRe: Why this expression produce error Pin
ZurdoDev12-Jan-15 7:38
professionalZurdoDev12-Jan-15 7:38 

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.