![]() |
visual basic to delphi
kann jemand delphi und visual basic und mag mir dabei helfen oder tips geben ...diesen quelltext von vb nach delphi zu übersetzen?
Code:
Private Sub Command1_Click()
Dim Start1 As Long, Rounds As Integer, Bids1 As Integer Dim sort As String, Inter As Long, A5 As Boolean Command1.Enabled = False Text1.Text = Replace(Text1.Text, "+", " ") ListView1.Sorted = False ListView1.ListItems.Clear On Error Resume Next Inter = 0 A5 = False sort = "" Rounds = 0 Loop2: Source = Get1.OpenURL("http://search.ebay.com/search/search.dll?GetResult&query=" & Text1.Text & "&from=R8&ht=1&combine=y&itf=1&st=2&SortProperty=MetaEndSort" & sort) Start1 = 1 Start1 = InStr(Start1, Source, ">Item Title</font>", vbTextCompare) Loop1: If Start1 > 0 And InStr(Start1 + 1, Source, "</td><td valign=top width=52%><font size=3><a href=", vbTextCompare) > 0 Then start2 = InStr(Start1, Source, "</td><td valign=top width=52%><font size=3><a href=", vbTextCompare) start2 = start2 + 52 end2 = InStr(start2, Source, ">", vbTextCompare) end2 = end2 - 1 Len1 = end2 - start2 link = Mid(Source, start2, Len1) start3 = end2 + 2 end3 = InStr(start3, Source, "<", vbTextCompare) end3 = end3 len3 = end3 - start3 Title = Mid(Source, start3, len3) start5 = InStr(end3, Source, "$", vbTextCompare) end5 = InStr(start5, Source, "<", vbTextCompare) len5 = end5 - start5 Price = Mid(Source, start5, len5) Start4 = InStr(end3, Source, "width=10%><font size=3>", vbTextCompare) Start4 = Start4 + 23 end4 = InStr(Start4, Source, "<", vbTextCompare) len4 = end4 - Start4 Bids = Mid(Source, Start4, len4) If Bids = "-" Or Bids = "" Then Bids = 0 Bids1 = Bids ListView1.ListItems.Add , , Title ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , Price ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , Bids1 ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , link Start1 = end4 + 1 DoEvents If StopSearch = True Then StopSearch = False GoTo End1: End If Items = Items + 1 Label1.Caption = Items If Not Start1 = 0 Then If InStr(Start1, Source, "</td><td valign=top width=52%><font size=3><a href=", vbTextCompare) > 0 Then GoTo Loop1 End If If A5 = False Then Tstart5 = InStr(1, Source, "[/B] items found for ", vbTextCompare) Tstart5 = Tstart5 - 10 start5 = InStr(Tstart5, Source, "[B]", vbTextCompare) start5 = start5 + 3 end5 = InStr(start5, Source, "<", vbTextCompare) len5 = end5 - start5 SearchR = Mid(Source, start5, len5) LoopTimes = SearchR / 50 LoopTimes = Round(LoopTimes, 0) A5 = True End If Rounds = Rounds + 1 Inter = Inter + 50 sort = "&skip=" & Inter If Rounds = LoopTimes Then SortListView ListView1, 3 Command1.Enabled = True Exit Sub Else GoTo Loop2 End If End If End1: SortListView ListView1, 3 Command1.Enabled = True End Sub |
Also ich habe auch vor 2 oder 3 Wochen den Umstieg von VB nach Delphi gewagt und muss sagen dass ich super Fortschritte gemacht habe. Wenn du also nicht ganz blöd und ein wenig verbissen in die Sache schaffst du das ganz allein. Falls du dann ein Befehl net kannst oder weißt benutze die Hilfe oder das Forum hier. Das hilft.
MfG Jazz :dancer: |
danke für deinen tip...
|
Moin Hagen,
erst einmal herzlich willkommen in der Delphi-PRAXIS. Ich möchte Dir mal ein paar grundsätzliche Unterschiede anhand Deines Beispielcodes vermitteln (soweit sie mir auffallen ;-) )
So, dass war das, was mir so auf Anhieb aufgefallen ist. |
Der Umstieg von VB auf Delphi ist wirklich keine große Sache. Ich würde dir aber empfehlen, ein gutes Grundlagen-Buch (kein "Kochbuch" o.ä.) zu Delphi zu kaufen. Empfehlen könnte ich dir da "Delphi 6" von Elmar Warken (
![]() |
...vielen dank für die tips :love:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz