Rollo62
Members-
Content Count
1812 -
Joined
-
Last visited
-
Days Won
23
Everything posted by Rollo62
-
Right, I know this doesn't solve your issue directly. I thought of virtualizing your own Delphi app on the remote system, that maybe remotes Word locally somehow, but only you know what you need exaclty.
-
Maybe Cybele Software is also interesting, if you look for a solution with Delphi.
-
What is the best (fast) way of checking if a string is number?
Rollo62 replied to wuwuxin's topic in Algorithms, Data Structures and Class Design
I would not say that, in regards of Var(). For me personally, I knew Var(), but never worked with that really. So its fair to find where its benefits and disadvantages are, also its do's and don'ts. I expected a hidden pearl, 10 min ago, but it seems that I only found an empty oyster -
What is the best (fast) way of checking if a string is number?
Rollo62 replied to wuwuxin's topic in Algorithms, Data Structures and Class Design
I have created some small Var() tests (for positive numbers), to check the behaviour under Rx11, probably it behaves different in older versions. It has so many corner cases, better know exactly how and when to use it. See yourself, and maybe find the right story for the use-case. procedure Test_Val; var LTest : String; LResD : Double; LResI : Integer; LPos : Integer; begin LTest := '123'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 0 OK Val( LTest, LResD, LPos ); // LRes 123.0 LPos 0 OK LTest := '123.4'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 4 MAYBE acceptable as TRUNC, if LPos < length ? Val( LTest, LResD, LPos ); // LRes 123.4 LPos 0 OK LTest := '123,4'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 4 MAYBE acceptable as TRUNC, if LPos < length ? Val( LTest, LResD, LPos ); // LRes 123.0 LPos 4 MAYBE acceptable as TRUNC, if LPos < length ? LTest := '123a'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 4 ERR, acceptable as split before char, if LPos = length ? Val( LTest, LResD, LPos ); // LRes 123.0 LPos 4 ERR, acceptable as split before char, if LPos = length ? LTest := '123.4a'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 4 ERR Val( LTest, LResD, LPos ); // LRes 1234.0 LPos 6 ERR ???, MAYBE useful to "digitize" a float ? LTest := '123,4a'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 123 LPos 4 ERR Val( LTest, LResD, LPos ); // LRes 123.0 LPos 4 ERR LTest := '.5'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 0 LPos 1 ERR Val( LTest, LResD, LPos ); // LRes 0.5 LPos 0 OK LTest := ',5'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 0 LPos 1 ERR Val( LTest, LResD, LPos ); // LRes 0 LPos 1 ERR LTest := '.5a'; LResD := 0.0; LResI := -1; LPos := -1; Val( LTest, LResI, LPos ); // LRes 0 LPos 1 ERR Val( LTest, LResD, LPos ); // LRes 5 LPos 3 ERR end; -
What is the best (fast) way of checking if a string is number?
Rollo62 replied to wuwuxin's topic in Algorithms, Data Structures and Class Design
Interesting, I had overlooked and forgotten this little, ancient piece for years. I thought this was only Integer, but it seems to work with Real = Double as well. The only problem is that it ignores the decimal separator, so the result of '123.4' will be an integer 1234; Which doesn't make sense only in a few corner cases, for handling with Real. But good to know that it exists anyway, and to point into that direction again. -
What is the best (fast) way of checking if a string is number?
Rollo62 replied to wuwuxin's topic in Algorithms, Data Structures and Class Design
Yes, I was think of something like this, with pointer math. But not sure if this might be faster than System functions, which should include similar stuff. -
What is the best (fast) way of checking if a string is number?
Rollo62 replied to wuwuxin's topic in Algorithms, Data Structures and Class Design
Possibly loop a pointer through the string, until and non-digit or non-comma is found, and no more than 1 comma's, maybe that could be faster. If the string ends without any break, it should be convertible string ( if the length is also somewhat limited to what maximum digits could be there ). But I haven't checked yet (too late) what TryStrToFloat is doing, maybe its already there. If I assume that most digits are in normal range (not above min/max limits), then this precheck to find non-digits could be faster, as a kind of pre-selection. But when you finally convert, you will have to consider the min/max again, to make it complete. -
CanIUse: Monterey Nope I had a similar Problem (under BigSur), with DocumentManager. A complete clearing of the SDK's in SdkManager and folders in Delphi, and a new addition to the SDK-Manager with Update local cache helped with that. But I don't know if that is also true for Monterey.
-
PAServer for remote Debugging on Windows
Rollo62 replied to Lars Fosdal's topic in Delphi IDE and APIs
What happend there ? I think I last time used it 6-7 years ago, was still working well. Should be usable still, remote debugging is something to use for testing and bugfixing every day, if you're on Windows Apps. -
Delete a ListView Item together with its livebinding DB record.
Rollo62 replied to Tang's topic in FMX
The "wipe-left" feels also not very iOS-UX-standard-like, that is what my clients complain. So I tried to remove that, by some other methods. -
SmartPointer implementations, Pros's and Con's
Rollo62 posted a topic in Algorithms, Data Structures and Class Design
Hi there, I just stumbled about an interesting article here, about SmartPointer internals https://www.beginend.net/view.dws?136077 This leads me to the question: Where do we stand now, after the new CustomRecords, which one would be the most favorite SP implementation ? There are some candidates out there in the field: from Spring4D, Grijjy, Marco Cantu, now Habrahabr version, and maybe hundrets more in older style, also recently discussed here in DP. To be honest, I love SmartPointer from C++, but not really used them productively in Delphi yet, the way I should, only in a few side-projects, because of the Delphi limitations, and probable instabilities, in the past. This might have changed now, since CustomRecords arrived, and about one year experiences with them. So I would like to start the challenge: Which SmartPointer implementation is the clear winner here, or maybe there is no clear winner, but maybe many different implementations, needed for many different situations. What are the possible Pro's and Con's of the different designs ? P.S.: (My favorite would be the Spring4D version, but maybe you can convince me otherwise). -
Tarray , uses unit not found :-(
Rollo62 replied to FranzB's topic in Algorithms, Data Structures and Class Design
Both: https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TArray is defined as type TArray = array of T; and https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Generics.Collections.TArray contains the generic version of the array var LDest : TArray< Integer >; begin SetLength( LDest, 2 ); LDest[ 0 ] := 111; LDest[ 1 ] := 222; -
I would love that Feature too, but I would also completely drop it, if that debugger cannot even inspect an Integer value correctly all the time. First things first...
-
What happens when you offset the Top and Left position ?
-
What is part of your contiuos integration?
Rollo62 replied to Mike Torrettinni's topic in General Help
I wanted to use Jenkins, but since Jenkins X arrived I'm a kind of starred like a rabbit in front of a snake, not konwing the status and future of Jenkins. While Jenkins X is a dockerized version of Jenkins, but not really compatible and not my true favorite, I'm not sure where the roadmap and the developers will move. Will Jenkins dissappear and get less active, or not ? Will Jenkins be replaced by Jenkins X in the long run ? Is Jenkins X just intended for different kind of customers ? Meanwhile still some time has passed by, and Jenkins seemed still normal and active, but I haven't checked the current situation for a least a few months now. -
When you start XCode, open the menu Windows/Devices and Simulators/ page, then plug in your iPHone device do you see the iPhones info popping up in this page ? If not, maybe some settings were missing, like the registration of your device in the AppStore, the provisioning files, etc. Not sure if you have a full Apple account already, or if you just first time playing with this stuff ?
-
Which implementation of this is easier to understand?
Rollo62 replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
You mean these little red thingies ? Not visible enough for me, I use standard lines like this, as my default -
Which implementation of this is easier to understand?
Rollo62 replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
@dummzeuch Done. You're perfectly right. At this time of the day my english translation brain sub-module doesn't work so well anymore. I have to wait until next morning, if I'm lucky -
I hope that I make my first D11 AppStore Upload soon ... thats usable enough if it works as expected
-
Which implementation of this is easier to understand?
Rollo62 replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
I prefer 2 as well. But in case of AntiPattern, I like to make "shouting" comments showing me where the problem sits. Make it as as much as "shouting" as you like, its more a question of "taste" ( Ok, I'm overdoing a bit in the upper example ). Are these "shouting" comments another AntiPattern maybe ? 🤔 -
Another question beside the move to M1, if Apple will also move away from Objective-C to Swift, with more speed now. I think Swift will still be a problem for Delphi, but on the other hand maybe its easier and cleaner too once a bridge is in place. But I'm afraid that it includes more obstacles for Delphi, as Objective-C did (which has maybe not the latest features inside). Will M1 ARM also affect this move to Swift somehow ?
-
But you have to sometimes, in case of you have to use Android / iOS. Anyway, I find D11 quite stable so far, but I'm still in the process of porting and testing. At least I can say that I have no show-stoppers yet 🙏
-
YouTube playback & control using WebView2 on Delphi 7
Rollo62 replied to Yaron's topic in Windows API
Not sure if you mean Cef4Delphi ? This one is always quite actual. -
If there is no way to use Win x86 on this nice M1 MacBook Max machine, this will be a showstopper for me. So I will be probably locked-in on Intel desktop then, lets wait and see. I don't believe in Win on ARM and Microsofts x86 emulation that much, so maybe time will tell.
-
Why??! (they've changed the way main menu works in the IDE).
Rollo62 replied to Lajos Juhász's topic in Delphi IDE and APIs
Exactly, the issue was that it always overwrites, no matter what you do, which may drive you crazy soon. After a single checkbox change, it behaves normally again (toggle), but I'm afraid I had never seen the locking of the insert mode.