Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
procedure TLocationForm.LocationSensor1LocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
const
LGoogleMapsURL: String = 'https://maps.google.com/maps?q=%s,%s&output=embed';
var
latS, lonS: string;
begin
{ convert the location to latitude and longitude }
Str(NewLocation.Latitude:8:5, latS);
Str(NewLocation.Longitude:8:5, lonS);
lbLatitude.Text := 'Latitude: ' + NewLocation.Latitude.ToString;
lbLongitude.Text := 'Longitude: ' + NewLocation.Longitude.ToString;
{ and track the location via Google Maps }
// WebBrowser1.Navigate(Format(LGoogleMapsURL, [NewLocation.Latitude.ToString, NewLocation.Longitude.ToString]));
WebBrowser1.Navigate(Format(LGoogleMapsURL, [latS, lonS]));
end;

try
Create;
finally
Free;
end
Create;
try
..
finally
Free;
end
obj1 := TMyObj1.Create;
try
obj2 := TMyObj2.Create;
try
....
finally
obj2.Free;
end;
finally
obj1.Free;
end;
obj1 := nil;
obj2 := nil;
try
obj1 := TMyObj1.Create;
obj2 := TMyObj2.Create;
...
finally
obj1.Free;
obj2.Free;
end;
item1 := nil;
item2 := nil;
try
GetMem(item1, SizeOf(item1^));
GetMem(item2, SizeOf(item2^));
...
finally
if assigned(item1) then FreeMem(item1);
if assigned(item2) then FreeMem(item2);
end;
StrList := TStringList.Create;
try
//some code here
finally
StrList.Free;
end;
StrList := nil;
try
StrList := TStringList.Create;
//some code here
finally
StrList.Free;
end;
Delphi XE5 + Android: первые впечатления