-
Content Count
2838 -
Joined
-
Last visited
-
Days Won
168
Everything posted by Uwe Raabe
-
Can you explain a bit more, please?
-
Seems legit. If you have a horizontal scroll bar there is no need for wrapping anything.
-
You are not alone: Parented controls with free notifications aren't scaled Frame with Assigned PopupMenu is wrong Displayed on high DPI A scaled form gets resized to design time ClientWidth/ClientHeight when embeded in a parent form
-
Records, Generics and RTTI meets FireDAC
Uwe Raabe replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
That's an important point. There are situations where your program is not the only one accessing the data. This doesn't mean that it could not be done different, but sometimes these other systems are out of your reach. -
Records, Generics and RTTI meets FireDAC
Uwe Raabe replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Not sure if it fits your needs, but nevertheless this might be an interesting read for you (unless you have already done so): Dataset Enumerator Reloaded And here ist the corresponding rep: DataSetEnumerator -
Remove non-utf8 characters from a utf8 string
Uwe Raabe replied to borni69's topic in Algorithms, Data Structures and Class Design
Yes, there are. One can use this fact to distinguish between UTF8 and ANSI encoding. An ANSI encoded text file can throw an exception when read as UTF8 if it contains certain characters. UTF8 character sequences start with a specific byte range followed by one to three bytes from a different range. Simply exchanging the first two bytes of a UTF8 sequence invalidates the file. -
@timfrost It doesn't matter if what you do with Project Magician is intended usage or not - it should not crash - period. In case this depends on the project file: Can you send me a copy, please?
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
Can you send me that dproj file? The version info is handled directly when you save the project options from the dialog - or you change the Project Magician options.
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
Actually, I like this and make heavy use of it. begin if Value.StartsWith(Prefix, IgnoreCase) then Result := Value.Substring(Prefix.Length) else Result := Value; end; is just easier to read than var isPrefixed: Boolean; begin if IgnoreCase then isPrefixed := StartsText(Prefix, Value) else isPrefixed := StartsStr(Prefix, Value); if isPrefixed then Result := Copy(Value, Length(Prefix) + 1, Length(Value)) else Result := Value; end;
-
Which platforms are in your project? There is indeed a different behavior for Windows-only projects and others. If there are other platforms than Win32 and Win64, the base configuration stays as is (usually it then is empty anyway). But perhaps something is just going wrong there.
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
I agree about Contains missing a case-insensitive option. On the other hand, the requested LowerCase functionality is already there under the name ToLower. Alas, there are more functions missing from the string helper where you need to fall back to the global ones.
-
But that applies to the Community Edition as well. The only way to get around it is to buy a commercial license then (which is what I do btw.)
-
Yes, read-only files are out of bounds. The latest version also recovers from any write errors caused by insufficient access rights.
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
AFAIK, Embarcadero offered a free one-year license (similar to what MVPs and Tech Partners get) to Andreas - probably more than once. Seems there is not much interest.
-
Actually I am thinking about some mechanisms for a DO NOT TOUCH! feature in Project Magician. While this is supposed to handle more cases than some Delphi library files only, I am still unsure how to implement it in a flexible as well as easy to handle way. I guess, this qualifies for a QP report anyway. Some sort of Clean Linefeeds action before commit/check-in should be mandatory - even for Embarcadero. Not to mention a Format Sources.
- 13 replies
-
- project magician
- line breaks
-
(and 1 more)
Tagged with:
-
Best way to prevent multiple instances? Mutex not working
Uwe Raabe replied to bilbo221's topic in VCL
If a mutex is not working you are probably doing something wrong. -
proper way to check server up or down in rest application
Uwe Raabe replied to toufik's topic in FMX
TRestRequest has also a method ExecuteAsync with handlers for successful completion and error handling (in addition to the event handlers OnAfterExecute and OnHTTPProtocolError). Depending on your specific needs it may boil down to just a simple call like this: RequestLogin.ExecuteAsync( procedure begin ShowMessage('server up'); end, True, True, procedure begin ShowMessage('server down'); end);- 6 replies
-
- server
- firemonkey
-
(and 2 more)
Tagged with:
-
Blocking the Windows Screen Saver in Delphi
Uwe Raabe replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
As all fields in that record are either 32 or 64 bit (depending on the target platform) it doesn't matter if the record were declared as packed or not. -
New feature request: Open dfm as Text if malformed (vote if care)
Uwe Raabe replied to Tommi Prami's topic in Delphi IDE and APIs
Perhaps a simple "Open as text" in the context menu of a DFM in the project manager may be sufficient. -
Key Combination to enter Edit or Insert mode??
Uwe Raabe replied to Ian Branch's topic in General Help
Which control is supposed to handle that key stroke? TDBGrid reacts on <F2> and <Insert>. -
I have to find out...
-
Generics: Classes vs Records - Differences in use
Uwe Raabe replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
If I got that right, Stefan is referring to the case where the array is relocated, which invalidates the record pointers. This is not the case for a class list, where only pointers to the class instances are stored inside the array. Relocating such an array will keep the instance pointers intact. -
Generics: Classes vs Records - Differences in use
Uwe Raabe replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Isn't that just the same with classes? Of course one has to know what can be done and what should be avoided. That is no difference to the standard generic record list, where you need to know that you are changing content of copies of records and not that of the records itself. My approach (which may be more a proof of concept than a solution for production) allows to work with a generic record list just like with the standard one, with the feature to change the record contents in the list, just like it was a simple array of records. I am pretty sure that it will work for the majority of use cases. Whenever the language gets a new feature that makes this obsolete - so then. It is near to impossible (and probably not even desirable) to make everything fool proof. IMHO fools shouldn't be allowed to write programs in the first place. -
Unable to rename pas file to versioned ~1~ file - strange issue
Uwe Raabe replied to Jacek Laskowski's topic in Delphi IDE and APIs
I think that would be too much of a hassle, especially when you are working with relative paths and/or want to configure that on a per project/-group level. One could even throw wildcards in there to complicate things further. You can either switch off that feature or make the offending files read-only. BTW, I also get these LF problems with Spring4D all over the place, but I usually don't debug it. Interestingly, up to now it seems to be the only library with this hickup. -
Generics: Classes vs Records - Differences in use
Uwe Raabe replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
It is not very difficult to make a generic list for records that allows manipulating the record content directly: type TChangeableRecordList<T: record> = class(TList<T>) type PT = ^T; private function GetItem(Index: Integer): PT; procedure SetItem(Index: Integer; const Value: PT); public property Items[Index: Integer]: PT read GetItem write SetItem; default; end; implementation function TChangeableRecordList<T>.GetItem(Index: Integer): PT; begin Result := Addr(PList^[Index]); end; procedure TChangeableRecordList<T>.SetItem(Index: Integer; const Value: PT); begin inherited Items[Index] := Value^; end; A suitable test case could look like this: type TMyRec = record IntValue: Integer; end; var list: TChangeableRecordList<TMyRec>; myRec: TMyRec; begin list := TChangeableRecordList<TMyRec>.Create; try myRec.IntValue := 1; list.Add(myRec); Assert(list[0].IntValue = 1); list[0].IntValue := 3; Assert(list[0].IntValue = 3); finally list.Free; end; end;