-
Content Count
1977 -
Joined
-
Last visited
-
Days Won
26
Everything posted by Attila Kovacs
-
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
that won't help much as out parameter also taking inputs without any warnings, which is more screwed as the original problem -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
A variable has to be initialized before being passed to a ref param, yes you have to decorate with "ref" or "out" -or whatever- the parameters at call: myproc(ref param1, out param2); <- this is the call, not the definition! you _have_ to set an "out" parameter before using it or before returning from the routine, even if you won't use that value (see my example) who knows what else... And I'm afraid this is because you can't just show hints for coding guidance as they will first disappear when you do what the compiler wants you to do. So it would be basically an error, like in c#. Am I right? Do we need that? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
but c# does not only giving hints, it is enforcing a lot of things. or is it possible to turn them off? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
Why is it relevant how c# works? It's completely different. won't compile: bool a(out int i) { if (1 != 2) return false; i = 43; return true; } -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
This is more interesting to me, no hint, but I could pass values from b() to a(): procedure a(out sl: TStringList); begin showmessage(sl.text); end; procedure b; var sl: TStringList; begin //sl := TStringList.Create; //sl.Add('hi'); a(sl); end; I'd stick with "var" parameters and no superfluous hints... -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
Why are you using "var" then? Why do you need the hint? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
OK, but it's not wrong passing uninitialized variable to a var parameter. Why the hint then? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
Really? And what if the var in the sub-roc is passed further? How deep do you want the compiler work for you? What if the decision is based on a variant? Should the compiler evaluate every outcomes? How slow should be the compiler just for your entertainment? Buy TMS FixInsight, write unit tests and first of all, develop a coding pattern which doesn't even uses such pitfalls. -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
It's not the compilers job to do code analysis for you? -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
As a comment? 😉 -
Using uninitialized object works on Win32, throws AV on Win64
Attila Kovacs replied to aehimself's topic in General Help
I'll downvote it. -
Class properties: Wins prettyness over functionality ?
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
these are just your own patterns, no guarantee, it's just made up, also, calcX can be a one liner or a power-plant burner 🙂 -
Class properties: Wins prettyness over functionality ?
Attila Kovacs replied to Rollo62's topic in Algorithms, Data Structures and Class Design
they have index you can inherit the accessors they have nice RTTI support, can be decorated the h*ll are you talking about, how should be a GetThis() more verbose about its implementation as a property? -
Class methods Polyformism
Attila Kovacs replied to Sam Witse's topic in Algorithms, Data Structures and Class Design
this is it: class function TMaster.GetMasterId: integer; begin writeln(classname); // Result := GetChildID; { <= at this point I get an abstract error } end;- 8 replies
-
- class method
- polyformism
-
(and 1 more)
Tagged with:
-
Class methods Polyformism
Attila Kovacs replied to Sam Witse's topic in Algorithms, Data Structures and Class Design
The compiler should read the docs and give some hint, if it's not already the case. At least at the "override".- 8 replies
-
- class method
- polyformism
-
(and 1 more)
Tagged with:
-
ISO8901: Week numbers and year
Attila Kovacs replied to Keesver's topic in RTL and Delphi Object Pascal
There is no such thing in Delphi. You have to roll your own. Should not be that hard. -
Which option to use for a large batch of REST queries?
Attila Kovacs replied to David Schwartz's topic in OmniThreadLibrary
I'm using "pipeline" for a multi downloader, with my "download" and "import" stages. It's really cool. -
Are the column indexes still the same? The tlte seems different. I'm not using icons so I never encountered such thing.
-
in the Vcl.SvcMgr.pas / procedure TServiceApplication.Run; there are these two lines: if StartThread.ReturnValue <> 0 then FEventLogger.LogMessage(SysErrorMessage(StartThread.ReturnValue)); where LogMessage (windows ReportEvent()) gets a string parameter containing an error message and having 3 other parameters filled with default values: EventType=1, Category=0, ID=0. Now, every time this LogMessage is called, in the Event Logs I see an entry with ID=0 and the message is not the one passed to this method but the translated error message (to the windows' current language) of the ID=0. (Or some similar mechanism which I'm not aware of.) Like I'm having always: "Der Vorgang wurde erfolgreich beendet." ID = 0. But if I'm also passing the error code to LogMessage, like: FEventLogger.LogMessage(SysErrorMessage(StartThread.ReturnValue), 1, 0, StartThread.ReturnValue); then in the event viewer are the right messages. Also, the message parameter (the first parameter) will be inserted in those messages if there is a placeholder for that. Did something change since Windows NT or ist it a longstanding bug or do I miss something?
-
btw. is there any default table provided by delphi?
-
I believe you but I'm not dreaming.
-
toAutoSpanColumns
-
Yes
-
@Anders Melander I've installed the VTune Profiler 2022.1.0/621966 and loaded an exe with a 31MB pdb and the hotspot analysis took about a minute. I think this was way slower back in the days you wrote the converter. Give it a try on an other machine.
-
I've downloaded the "latest" VTune Profiler, 2022.1 but it doesn't even touches the pdb file. Luckily I'm not using this app at all. edit: forgot to bind... stay tuned