-
Content Count
332 -
Joined
-
Last visited
-
Days Won
5
Posts posted by John Kouraklis
-
-
Yes, but I don't want to write a function from scratch
-
-
That's what I use now and sadly does not replace whole words.
Eg. in this string 'abc and abc.def' if you want to replace 'abc' whole word only the above and the one from stringhelper will replace both instances of 'abc'
-
Hi,
I am using TStringHelper.Replace to replace substrings in strings but it seems that it does not respect whole words.
Anyone knows how to do this with Replace?
-
Ok, upgrade completed and things seem to be in place except the Connection Managers.
I can see the files in Documents. Anyone knows how to make the (new) IDE recognise them? Does it use the registry?
Edit: It doesn't seem to recognise GetIt installed packages.....sadly
-
I am also installing 10.3.1 right now...let's see
-
-
@Mahdi Safsafi Thanks! the hack helps me a lot.
About the debate regarding Create/Free, it looks to me it is good practice.
Similar to this, I've seen people always but always setting interfaces to nil as a matter of coding style
-
@Mahdi Safsafi Very cool. Thanks for this
A couple of questions:
1. Do you need to create/Free TRTTIContext? All the books/articles I've seen they just use the record
2. The TypeInfo variable in DoSomething conflicts with TypeInfo from RTTI. It should use a different name, right?
3. How do I get the value of the fields now? I tried this:
for lFields in LType.GetFields do Writeln(' '+lFields.Name + ': '+lFields.GetValue(TypeInfo(Rec)).AsString);
but the instance in GetValue is not correct.
Thanks again
-
4 hours ago, dummzeuch said:function pass(var aRec): boolean;
or
function pass(const aRec): boolean;
1 hour ago, David Heffernan said:How will you use RTTI with this?
I would be great if this were possible...
-
The goal is to extract the fields and their values from the record.
The class function approach looks more promising but it looks such "openness" makes things complicated.
I think I will pass the list of the fields directly rather than the record itself...
Thanks everyone
-
Hi,
I want to write a function and allow the user of the function to pass a record that I do not know in advance. Then, the idea is I iterate through the fields in the function.
Something like this:
function pass (aRec: record): boolean;
But a 'record' can't be used like this.
I've thought of two approaches but without being able to make them work:
1. Use of pointers:
function pass (aRP: Pointer): boolean;
begin
....
/// here I do not know how to (cast the pointer to any record and) iterate using RTTI
/// I think this can not be done as the cast seems very arbitrary
...
end;
2. A kind of adapter record:
type
TAdapterRec<T> = record
instance: T
constructor Create (aRec: T);
end;
and then tried to declare the function:
function pass (aRec: TAdapterRec<T>): boolean;
but generics like these are not allowed.
Anyone can help with this? I would like to avoid using classes.
Thanks
-
QuoteFor strings in the form '1.000' (or '1,000') it assumes that the separator is the decimal separator. This could be wrong (That's why it's called GuessDecimalSeparator and not DetectDecimalSeparator.)
@dummzeuch This is impossible to guess without any context. Maybe if you can sample a few numbers in the file you may be able to figure it out
-
-
8 minutes ago, Ugochukwu Mmaduekwe said:On my Android or PC?
Probably on both as TI uses a non-standard port
But I don't know how to do it on Android. If you find out please share. I am interested
-
Yes I know the plugin.
When you run the tests from TI, does it use the selected platform or only Win32?
-
-
I use SourceTree as well. It has some glitches but in general saves lots of command-line work
-
Why don't you use TFormatSettings? It should load the locale of the machine
-
-
2 hours ago, Ugochukwu Mmaduekwe said:so from what I can deduce, the connection back to the plugin on my PC via my IP Is not working on Android, can't seem to figure out why.
The annoying thing is that it works fine when I compile it and run my test project on Windows.
I believe you need to open the ports that TestInsight is listening to
-
On 2/4/2019 at 10:56 AM, Yaron said:But as soon as I try to run any Delphi 10.3 app on NOX, it instantly closes with an error message that the app has closed.
Have you tried a simple project that does nothing?
-
I uploaded a package for 10.2
Very welcome to test and see if all is good.
Also, it would be great if someone could check/test/create packages for other versions as I don't have any other installed. Please see the open issue on github.
Thanks👌
-
Yeah, I only had 10.3 installed at that time.
I have now installed it and will prepare a package for 10.2 and fix the code.
How to replace whole words in a string
in General Help
Posted
Thanks for the RegEx suggestions