Author Topic: Using "USING" and BYTE pointers & how to make a LONG IP-Adress into X.X.X.X  (Read 2624 times)

0 Members and 1 Guest are viewing this topic.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 966
    • it-berater
This is a nice example how to save a Loop by using the builtin "USING$" command.

Code: [Select]
' IP-Adress(Long)->IP-Adress (String)
FUNCTION IP_Adress(BYVAL T01 AS LONG) AS STRING
LOCAL T02 AS STRING, T03 AS BYTE PTR
T03 = VARPTR(T01)
T02 = USING$("#_.#_.#_.#", @T03, @T03[1], @T03[2], @T03[3])
FUNCTION = T02
END FUNCTION