Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/09/23 in all areas

  1. https://docwiki.embarcadero.com/CodeExamples/Sydney/en/PtInRect_(Delphi) The rectangle passed to PtInRect example could be a one wide "solid wall" adjusting Height with Y or a "water trap" adjusting width with X.
  2. I remember exactly the same topic some time ago. Was it yours? But the exact problem I can't understand either. Plz specify it more concretely. You can use arrays , dictionaries, lists and any other container that have unlimited length. Or VarInRange. Or, if the ranges are static, "case" (though internally it will be not more than multiple if's). I'm not aware of a class that handles multiple ranges (like ranges.Add(3, 300); ranges.Add(40000, 50000000); if ranges.Includes(i)) but probably someone had created such one. Otherwise it seems relatively easy to create from scratch. If you need exactly this, try to search in the area of Unicode handling. This is the 1st application that comes to mind which could require multiple ranges (f.ex., to define letters of some alphabet that are not coming in single block in the Unicode table)
  3. I don't understand how this can even work at all. If PosY equals Y - 1 then PosY cannot be equal to Y - 2 nor Y - 3 and so on. There can either one condition be met or none, but not all.
  4. David Heffernan

    Remove quotes from a string

    Looks like your json parsing code is wrong but you didn't show any code. Very hard for us to say what's wrong with your code when we can't see it. Don't be shy.
  5. A set has its limitations but can work in some cases. But you also can use Case: Case myInteger Of: 0, 15, 1999, 65535: Begin // DoSomething End; Else Exit; End;
  6. What you describe gets the local IPs of the device that your code is running it. It does not get the IPs of other devices on the local network. You don't need to use the IdStackXXX units directly in this example, just the base IdStack unit by itself will suffice. The correct way to use TIdStack methods is to call them on the global GStack object. Indy can instantiate the correct derived class for you based on the local OS platform, eg: uses IdGlobal, IdStack; function GetLocalIpList(Name: string): TStringList; var Lista: TIdStackLocalAddressList; temp: TIdStackLocalAddress; I: Integer; begin Result := TStringList.Create; try TIdStack.IncUsage; // instantiates GStack if needed... try Lista := TIdStackLocalAddressList.Create; try GStack.GetLocalAddressList(Lista); for I := 0 to Lista.Count-1 do begin temp := Lista[I]; if temp.IPVersion = Id_IPv4 then Result.add(temp.IPAddress); end; finally Lista.Free; end; finally TIdStack.DecUsage; // frees GStack if needed... end; except Result.Free; raise; end; end;
  7. If you mean all the local IP addresses on your LAN, ICS has a new component TIcsNeighbDevices that builds a historic LAN neighbourhood MAC device and IPv4 and IPv6 address table using ARP, neighbourhood discovery and network scanning. There is a new sample OverbyteIcsNetTools.dpr that illustrates its use. Angus
×