Jump to content

Lars Fosdal

Administrators
  • Content Count

    3303
  • Joined

  • Last visited

  • Days Won

    110

Lars Fosdal last won the day on April 17

Lars Fosdal had the most liked content!

Community Reputation

1732 Excellent

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

10074 profile views
  1. Lars Fosdal

    Delphi and "Use only memory safe languages"

    They kept start index 1 to stay compatible with the short strings. At some point it might be desirable to change it, but ... well... Bye bye backwards compatibility.
  2. Lars Fosdal

    ActionList Editor: New Standard Action...

    The new QP doesn't support voting and I cannot see a benefit in sharing this. Well, sharing allows discovery, and those that are affected can add a comment?
  3. Replace the brackets with parenthesis?
  4. Lars Fosdal

    ActionList Editor: New Standard Action...

    Try something else, then decide. Only you know what you need.
  5. Lars Fosdal

    ActionList Editor: New Standard Action...

    Stay on topic, please.
  6. Lars Fosdal

    Parameter passing

    Which language Which version Which class is SslHttpRest, and from which unit? If you use System.Net.HttpClient (which I use, because getting the REST classes to work with various flavours of OAuth2 turned out to be a challenge), you can do it something like this (code is not complete 😞 var HTTPRequest: IHttpRequest; // from System.Net.HttpClient HttpResponse: IHttpResponse; // System.Net.HttpClient ReqHeaders: TNetHeaders; // System.Net.URLClient URL: String; begin try try try HTTPRequest := HTTP.GetRequest('GET', URL); ReqHeaders := [ TNetHeader.Create('Content-Type', 'application/json'), TNetHeader.Create('Content-Length, ''), TNetHeader.Create('Store-Token', '22345673301244567896663456789012'), TNetHeader.Create('User-Agent', 'PostmanRuntime/7.37.3'), TNetHeader.Create('Accept', '*/*'), TNetHeader.Create('Postman-Token', '40f28212-2f71-487a-a22f-d6ecdfa61b8b'), TNetHeader.Create('Host', 'localhost:8080'), TNetHeader.Create('Accept-Encoding', 'gzip, deflate, br'), TNetHeader.Create('Connection', 'keep-alive') ]; HttpResponse := HTTP.Execute(HTTPRequest,nil, ReqHeaders); // HTTP is THTTPClient from System.Net.HttpClient ...
  7. If the date doesn't follow spec, do you really want to attempt to import it?
  8. Lars Fosdal

    RAD Studio 12.1 Athens Patch 1 Available

    RSS-425 doesn't open for me either. It could be that the reporter chose to NOT share the report with the Embarcadero Customer group.
  9. Lars Fosdal

    Delphi Low-code No-code?

    If you are a corporate developer, the money for tools are peanuts compare to other costs.
  10. Lars Fosdal

    Delphi and "Use only memory safe languages"

    Can we stay on the topic, please? Are there any practical languages that are applicable to writing the same variety of solutions as Delphi, that are actually memory safe? Even if you manage your memory in Delphi, it is not hard to get corrupted data due to a dangling or misdirected pointer, even in Delphi.
  11. Lars Fosdal

    TListview and TImage Pixalated Image

    Sometimes, when entering new areas of knowledge, you might not even know what to expect. Hence, a guiding hand can go a long way. Most people appreciate those that offer help without conditions.
  12. Lars Fosdal

    TListview and TImage Pixalated Image

    IMO, that was not very helpful. If you are a new user, you may need to be guided on how to do it right, not just be told that you are doing it wrong.
  13. Lars Fosdal

    Alexandria 11.3 and Android 13 (part 2)

    Irrelevant content removed.
  14. There also is https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TypInfo.GetEnumProp which returns a PPropInfo, which again contains a PropType: PPTypeInfo, which you then can use with GetEnumValue?
  15. What if you treat every value as a generic type? That way you are free to use TypeInfo? procedure TParam<T>.SetAsString(const aValue: string); var TV: TValue; begin TV := TValue.From<T>(Default(T)); try case TV.Kind of tkEnumeration: TV := TValue.FromOrdinal(TypeInfo(T), GetEnumValue(TypeInfo(T), aValue)); tkInteger: TV := TValue.From<Integer>(StrToInt(aValue)); tkInt64: TV := TValue.From<Int64>(StrToInt(aValue)); tkFloat: TV := TValue.From<Extended>(StrToFloat(aValue)); else TV := TValue.From<String>(aValue); end; FValue := TV.AsType<T>; except on E:Exception do begin CmdDebugOut(Parent.Debug + ': "' + aValue + '" -> ' + E.Message); FValue := Default(T); end; end; end; function TParam<T>.GetAsString: string; var TV: TValue; begin TV := TValue.From<T>(FValue); Result := TV.AsString; end;
×