{"id":216,"date":"2007-05-12T17:08:51","date_gmt":"2007-05-12T15:08:51","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/random-string\/"},"modified":"2007-05-12T17:08:52","modified_gmt":"2007-05-12T15:08:52","slug":"random-string","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/random-string\/","title":{"rendered":"Random String"},"content":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]Var<br \/>\n  LoopInt : Integer;<br \/>\n  DirName, FullName, RanStr : String;<br \/>\n  FileSavedTo : TextFile;<br \/>\n\/\/ Length of string to create<br \/>\n  RandArray : Array[0..4087] Of Char;<br \/>\n  FirstCount : Extended;<br \/>\nbegin<br \/>\nFirstCount := GetTickCount;<br \/>\n Label2.Caption := &#8221;;<br \/>\nRandomize;<br \/>\nRanStr := &#8221;;<br \/>\n  DirName := Directory95ListBox1.Directory;<br \/>\n  If DirName[Length(DirName)] <> &#8216;\\&#8217; Then DirName := DirName + &#8216;\\&#8217;;<br \/>\n  FullName := DirName + Edit1.Text;<br \/>\n  If FileExists(FullName) Then DeleteFile(FullName);<br \/>\n   For LoopInt := Low(RandArray) To High(RandArray) Do<br \/>\n    Begin<br \/>\n     RanStr := RanStr + Chr(Random(255 &#8211; 32 + 1) + 32);<br \/>\n    End;<br \/>\n  AssignFile(FileSavedTo, FullName);<br \/>\n  If FileExists(FullName) Then<br \/>\n   Reset(FileSavedTo)<br \/>\n   Else<br \/>\n   Rewrite(FileSavedTo);<br \/>\n    Writeln(FileSavedTo, RanStr);<br \/>\n   CloseFile(FileSavedTo);<br \/>\n   Label2.Caption := &#8216;DONE&#8217;;<br \/>\n   Label4.Caption := FloatToStr((GetTickCount &#8211; FirstCount) \/ 1000);<br \/>\n   FileListBox1.Update;<br \/>\n[\/code]<\/p>\n<p>[tags]Delphi, Strings[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]Var LoopInt : Integer; DirName, FullName, RanStr : String; FileSavedTo : TextFile; \/\/ Length of string to create RandArray : Array[0..4087] Of&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[75,123],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-3u","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/216"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}