AGB  ·  Datenschutz  ·  Impressum  







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

Comparing functions

Ein Thema von Razor · begonnen am 28. Aug 2007 · letzter Beitrag vom 8. Nov 2007
 
devidespe

Registriert seit: 7. Sep 2006
Ort: Berlin
434 Beiträge
 
Delphi 10.4 Sydney
 
#11

Re: Comparing functions

  Alt 5. Nov 2007, 08:10
Zitat von Razor:
As you can see here i was experimenting something and the below looked like is it gonna happen but should i worry about warning?

Delphi-Quellcode:
procedure tmainfrm.amd64x2start;
var
C0:string;
GetInstance:tomcdrv;
pdata: DWord;
begin

       GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata);
       GetInstance.IPCIIORef.SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2));
       GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata);
       C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]);
       RzLabel99.caption:=C0;

//But then i get [Warning] Temperatures.inc(117): Variable 'GetInstance' might not have been initialized
Thats because TOMCDrv is a class with an initialization routine, which has to be run first. Begin this procedure with GetInstance.Create()

Zitat von Razor:
Delphi-Quellcode:
procedure tmainfrm.amd64x2start;
var
C0:string;

pdata: DWord;
begin

       OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata);
       OMCDRV.tSetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2));
       OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata);
       C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]);
       RzLabel99.caption:=C0;

//But then i get [Fatal Error]Internal error: BA1993 or [Fatal Error] Internal error: L1333
I've never had that kind of error and the documentation doesn't provide any info.

But why don't you create a large class and add there all functions for port reading, msr reading and so on ? Your unit contains a lot of double functions, e.g. 4 or 5 times the readportbyte function. That could be combined into one class to avoid those kind of error messages.
Devid
  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 12:43 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