AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

From VB to Delphi

Ein Thema von mohfa · begonnen am 4. Apr 2007 · letzter Beitrag vom 4. Apr 2007
 
Benutzerbild von sirius
sirius

Registriert seit: 3. Jan 2007
Ort: Dresden
3.443 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: From VB to Delphi

  Alt 4. Apr 2007, 08:56
I suppose that MSComm1, Text1 and lblTP are special components. The last one could by a label

I'm not sure. but maybe this could be a translation:
Delphi-Quellcode:
procedure cmdTPButtonClick(...); //whatever the click-event is...
//defining temporal/local variables
var myString:string
    TP_string:string;
    Temp:string;
    TP_float:double;
    B1:string;
    B2:double;
begin
  myString:=''; //This is not neccessary if this variable stays local.
  MSComm1.output:='0111' + vbCR; // vbCR?
  myString:=MSComm1.Input;
  Test1.Text:=myString;
  Temp:=MidStr(myString,12,3);
  if pos('>',myString) > 0 then
  begin
    B1:=MidStr(MyString, 7, 2);
    B2:=strtoint('$'+B1);
    TP_float:=B2/256*100;
    TP_string:=inttostr(round(TP_float));
    lablTP.Caption:=TP_string + ' %';
  end; //Else - part is empty
end;
I don't know if some of those temporal variables are also used global. vbCR is either a global variable too or it is a special constant.
Dieser Beitrag ist für Jugendliche unter 18 Jahren nicht geeignet.
  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 04:19 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-2025 by Thomas Breitkreuz