{"id":1465,"date":"2012-09-21T11:49:06","date_gmt":"2012-09-21T11:49:06","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=1465"},"modified":"2012-09-21T13:30:29","modified_gmt":"2012-09-21T13:30:29","slug":"gerenating-a-guid-using-delphi-7","status":"publish","type":"post","link":"https:\/\/galhano.com\/blog\/?p=1465","title":{"rendered":"Gerenating a GUID using Delphi 7"},"content":{"rendered":"<p><strong>GUID &#8211; Globally Unique IDentifier<\/strong><\/p>\n<p>In Delphi, GUID values are represented with the TGuid record defined in the System unit. A Guid value is a 128-bit integer (16 bytes) that can be used in database applications when a unique identifier is required.<br \/>\nWhen developing database applications, the TGuidField is used to represents a guid field in a dataset.<\/p>\n<p>[delphi]<\/p>\n<p>procedure TForm1.btnGetGUIDClick(Sender: TObject);<br \/>\nvar<br \/>\n  Guid: TGUID;<br \/>\nbegin<br \/>\n  CreateGUID(Guid);<br \/>\n  form1.label1.Caption := GUIDToString(Guid);<br \/>\nend;<\/p>\n<p>[\/delphi]<\/p>\n<p><!--more-->To create a sample GUID, hit CTRL + SHIFT + G in the code editor, this will create a unique GUID value, like this one: [&#8216;{B54ED86E-211F-4803-AF46-0586DA66C583}&#8217;]. Each time you press CTRL + SHIFT + G, you&#8217;ll get a new Guid value.<br \/>\nA Guid value can be converted from a string constant in the following form &#8216;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&#8217;, in which each x is a hexadecimal digit in the range 0-9 or A-F. For example, &#8216;123ABC45-65DE-F0F0-4242-A1B2C3D4E5F699&#8217; is a valid uniqueidentifier value.<\/p>\n<p><span style=\"font-family: verdana,geneva,helvetica; font-size: x-small;\">To create a sample GUID, hit CTRL + SHIFT + G in the code editor, this will create a unique GUID value, like this one: [&#8216;{B54ED86E-211F-4803-AF46-0586DA66C583}&#8217;]. Each time you press CTRL + SHIFT + G, you&#8217;ll get a new Guid value.<br \/>\nA Guid value can be converted from a string constant in the following form &#8216;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&#8217;, in which each x is a hexadecimal digit in the range 0-9 or A-F. For example, &#8216;123ABC45-65DE-F0F0-4242-A1B2C3D4E5F699&#8217; is a valid uniqueidentifier value. <\/span><br \/>\nmore info:<br \/>\nhttp:\/\/delphi.about.com\/library\/weekly\/aa022205a.htm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GUID &#8211; Globally Unique IDentifier In Delphi, GUID values are represented with the TGuid record defined in the System unit. A Guid value is a 128-bit integer (16 bytes) that can be used in database applications when a unique identifier is required. When developing database applications, the TGuidField is used to represents a guid field [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,12],"tags":[],"class_list":["post-1465","post","type-post","status-publish","format-standard","hentry","category-code-snippets","category-delphi","author-admin"],"_links":{"self":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1465"}],"version-history":[{"count":5,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1465\/revisions"}],"predecessor-version":[{"id":1468,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1465\/revisions\/1468"}],"wp:attachment":[{"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}