PiedSoftware
-
Content Count
49 -
Joined
-
Last visited
Posts posted by PiedSoftware
-
-
I guess I am a bit spoiled playing with Swift. It lets you assign any expression to a constant, compile time or run time.
- 1
-
Yes, David, I agree. I would like them to fill that out: everything that is logically able to be evaluated at compile time should be assignable to a constant.
-
type TCodeStructure = record StartTkn: string; EndTkn: string; SubTkns: array of string; end; type TIfTkns = (itElse, itElsif); const elseTkn = '#else'; elsifTkn = '#elseif'; IfTkns: array[TIfTkns] of string = (elseTkn, elsifTkn); IfStruct: TCodeStructure = (StartTkn: '#if'; EndTkn: '#endif'; SubTkns: [IfTkns[itElse], IfTkns[itElsif]]);
I wrote this code and got the error "E2026 Constant expression expected" on the last line.
I also triedSubTkns: IfTkns);
When I changed it to
SubTkns: [elseTkn, elsifTkn]);
it compiled happily.
and that gave me E2010 Incompatible types: 'Dynamic array' and 'Array'.
To me it seems that Delphi should allow the first thing I tried - referencing a const array via constant indices to specify a constant. There is no reason to disallow that sort of thing. Ideally even the second attempt should be reasonable.
I have Delphi 10.4. -
5 hours ago, Anders Melander said:Okay but it's installed in the IDE by default and it affects the design-time performance of forms and datamodules.
Give a try; It's one of the first things I do when I install Delphi.
I went to Component | Install Packages and unchecked "Embarcadero LiveBindings Components" and saved, but when I closed and reopened Delphi, it was back on again. D'oh!
I'm concerned the maybe a library is using it. How can I work that out? Should I remove it? -
10 hours ago, corneliusdavid said:If it runs fine in debug mode but then you compile in release mode (which I think is what you mean), is there a conditional in your code that sets up the database connection differently for debug mode, like maybe you're using a local database for testing but the release mode one is connecting remotely for the customer?
Thank. What I am comparing are the 2 functions from the Delphi Run menu: Run (f9) and Run without debugging (shift-ctrl-f9)
-
15 hours ago, Anders Melander said:Try disabling the livebinding design time packages (unless of course you're using livebindings).
I don't think we have that package in the app at all. We certainly haven't coded that way.
-
2 hours ago, corneliusdavid said:What version of Delphi? At runtime or design-time in the IDE?
What database? What type of activity--I assume at least connecting? Is it using the same connection in debug and release modes? Are the release and debug configs generating executable in different directories? Perhaps it loading a configuration from an .INI file which is in one location but not the other?
After the form is loaded, does everything run fine (assuming this is at runtime)?
There are so many things this could be--we need a little more information.
Delphi 10.4
MySQL, but I don't think that is the issue. I probably shouldn't have mentioned it. It was my first thought, I put timings in the code. The time is just the form getting created, with no database activity.
It looks fine when it has loadedYes, I know it's pretty diffuse. I haven't started pulling my hair out yet.
-
Hi
I have been trying to work out what is going on with one of my forms. Just opening it, which has only a small amount of DB activity, was taking nearly a minute in the debugger, once it was about 35s. But when I run it without the debugger it is less than 3 seconds. There is no obvious bottlenecks in Task Manager. I have 8 GB of RAM.
Does this sound familiar to anyone? Does anyone have a possible solution?
Regards
Mark -
I think I may have solved the problem.
Somehow the normal run button got replaced with the Run without debugging button. So far the best explanation is that when I had the problem was when I ran the program by hitting the Run button, and when it ran fine it was because I hit F9. I don't remember changing it, and I don't remember whether I hit F9 or the button each time I had breakpoints or not, But, now I am back in happy land. -
Thanks. I would hope I can fix the issue with something less drastic than reinstalling. What advantages do you have with 11.3?
-
On 9/15/2023 at 1:21 PM, Pat Foley said:More checks
The provenance (path) of used units found in hint box showing when mousing over tabs over unit tabs in code window or control tabs on the component bar.
Then the transactions in .proj.local can be looked at. These transactions log when units renamed or who knows.
Try syntax check or build all from time to time can't hurt!
I see the correct file names in the popup hint over the tabs for each unit.
If the syntax was wrong it wouldn't even build and run. I am doing Build fairly frequently. -
It's happening again. There must be some other cause. I tried another smaller project. The breakpoints worked a few times and then stopped.
-
I did clean builds a number of times, and it didn't clear the problem. What made the difference was clearing all the breakpoints, one after the other, the putting back in the one I wanted to use.
-
I had a look at the list of breakpoints (View | Debug windows | Breakpoint) and I had accumulated a couple of dozen, a number from files that have been removed from the project. I deleted all of them, and put back in the one that I wanted. And now it is great to see my program stopping on the line I have asked it to stop on.
-
Thanks for the ideas. I looked and it is in debug mode, and the lines do have the blue dots. It must be something else.
-
Hi
I have a break point, but when I run the procedure it is in the code is going right past it and putting up a message a few lines down.
Also, I had a bug where the code was throwing an exception, the exception dialog would come up, but the debugger didn't stop at the relevant line.
I have been googling and poking around in the settings but nothing has shown up that would make it stop at the line. I have deleted and recreated the break point, rebooted my machine, and it looks as if Delphi is broken, but I hope not!This is Delphi 10.4, building for windows32.
-
Thanks, Der Schoene Guenter. I didn't know that. I was just looking at regedit.
-
On 6/14/2023 at 5:14 PM, Der schöne Günther said:In the Windows registry at
Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\xx.y\History Lists\hlRunParameters
where xx.y is the RAD Studio version(s) you are using
I went looking for hlRunParameters and found
HKEY_USERS\S-1-5-21-1617574381-1279492827-4212147271-1000\SOFTWARE\Embarcadero\BDS\21.0\History Lists\hlRunParametersand one other place with that long number, but none with the nice simple name in your post.
-
Hi
In Delphi, under Run | Parameters, is a drop down list of the history of runtime parameters. I can see the top one, the one that currently applies, in the .dproj file, but I have looked in all the files with the same name as the project but different extension, and I did not see the other command lines. Where are they stored? They seem to be based on the installation of Delphi, not the project.
-
On 4/20/2023 at 6:26 PM, microtronx said:Normally Sessiondata is stored in cookies and yes you can handle them with delphi
Thanks, microtronix. Are you saying that from Delphi you can open a web page with cookies set in the code, and those cookies are not stored on the filesystem of the client?
-
Hi
This is a preliminary question. We have some functionality on the web and want to be able to set log-on to the web page from the Delphi app, without the log-in credentials being stored by the browser app.
Any idea? -
On 4/1/2022 at 8:01 PM, Uwe Raabe said:My approach to these types of problems is to add a record helper for the enumeration that handles the conversion from and to Integer.
Thanks. That would be useful. I have decided to do it differently in this case
-
On 4/1/2022 at 4:56 PM, Fr0sT.Brutal said:Yes. The only solution is to start the enum from 0 (why using 1 as starting value?)
The values correspond with values on a database.
-
Hi
I have been using a generic record to convert combo-boxes to enumerated type. But Delphi spits the dummy if the type has any numbers specified.
For example with this code the compiler throws up the error message "E2134 Type 'TDDArrangementId' has no type info. In the generic type TypeInfo(T) returns nil.type TDDArrangementId = (daOutstanding = 1, daWeeklyGap, daAmount, daGapAmount); ... procedure Test; var ti: PTypeInfo; begin ti := TypeInfo(TDDArrangementId);
But removing the " = 1" makes it all build and run just fine.
Can anyone confirm that Delphi's rtti system simply does not handle enumerated types if they are not zero-based?
I'm using 10.4
---
Mark
Delphi should let me use a const array reference as a constant
in RTL and Delphi Object Pascal
Posted
The way Swift works is that you can declare value with either the keyword let or the keyword var. If you use let the value cannot be changed. But the expression you assign to a let value can be anything available at that point.