AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi VB Code zu Delphi - Probleme mit Bytearray
Thema durchsuchen
Ansicht
Themen-Optionen

VB Code zu Delphi - Probleme mit Bytearray

Ein Thema von mrhyde · begonnen am 1. Feb 2008 · letzter Beitrag vom 3. Feb 2008
 
mrhyde

Registriert seit: 3. Jan 2008
4 Beiträge
 
Delphi 2006 Professional
 
#1

VB Code zu Delphi - Probleme mit Bytearray

  Alt 1. Feb 2008, 19:29
Hi Zusammen,

kann mir jemand folgendes in Delphi umcoden?
Unter VB läuft das Problemlos.
Hab schon alles mögliche unter Delphi probiert komm aber nicht richtig klar mit dem Bytearray in Delphi.


Delphi-Quellcode:
Public Sub crc()
    Dim mask, j, n, crc As Integer
    Dim bt(24) As Byte
    Dim crct As String
    
    z = 0
    crc = -1 ' crc mit $ffff initalisieren
For n = 1 To Len(TextBox1.Text) Step 2
j = Mid(TextBox1.Text, n, 2)
'je 2 Zeichen filtern
        z = z + 1 'Zaehler für Bytearray
bt(z) = CByte("&H" & j)

crc = crc Xor bt(z)
For j = 1 To 8
mask = 0
If crc / 2 <> Int(crc / 2) Then mask = &HA001
crc = Int(crc / 2) And &H7FFF: crc = crc Xor mask
Next j
Next n

TextBox2.Text = crc
' crc anzeigen
End Sub
Wär echt cool wenn das jemand übernehmen könnte - damit ich mal ein Beispiel habe.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:56 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz