NotToday Posted October 29, 2011 Share Posted October 29, 2011 Asağıdaki kodlarla hız toplam boyut ve indirilen boyutu labele yazdırdım.Fakat zamanı nasıl yazdırabilirim? [code] local indirilen=string.format("%s",String.GetFormattedSize(tblData.Loaded, FMTSIZE_AUTOMATIC, true)) local topindirilen=string.format("%s",String.GetFormattedSize(tblData.Total, FMTSIZE_AUTOMATIC, true)) local hiz=string.format("%d Kb/s",tblData.CurrentSpeed)[/code] Quote Link to comment Share on other sites More sharing options...
DespryRammstein Posted October 29, 2011 Share Posted October 29, 2011 (edited) Neden Geçek Duyuyorsunki Edited October 29, 2011 by DespryRammstein Quote Link to comment Share on other sites More sharing options...
NotToday Posted October 29, 2011 Author Share Posted October 29, 2011 [quote name='DespryRammstein' date='30 October 2011 - 01:05 ' timestamp='1319925957' post='1103290'] Neden Geçek Duyuyorsunki [/quote] Nedeni önemli değil asıl önemli olan komutunu veya mantığını kavramak Quote Link to comment Share on other sites More sharing options...
Bitmap Posted October 30, 2011 Share Posted October 30, 2011 (edited) [b][color="#FF0000"]Global Function :[/color][/b] [codebox]function ZamaniHesapla(hiz,boyut) -- Boyutu KB cinsinden Yazdırın if hiz ~= "" and hiz ~= nil and boyut ~= "" and boyut ~= nil then sSaniye = Math.Round(boyut/hiz, 0); -- Kaç Saniye sDakika = 0; sSaat = 0; while sSaniye>59 do --Hesaplamaların Başlangıcı sSaniye = sSaniye-60 sDakika = sDakika+1 if sDakika > 59 then -- 60 Olduğunda saate ekleme sDakika = 0 sSaat = sSaat+1 end end --Hesaplamaların Bitişi if sDakika < 10 then -- 10dan Küçükse yanlarına 0 ekleme sDakika = "0"..sDakika end if sSaniye < 10 then sSaniye = "0"..sSaniye end if hiz > boyut then -- Hız Boyuttan Fazla İse 1 saniye olarak gösterir. sSaniye = "01" end if sSaat < 10 then sSaat = "0"..sSaat end return sSaat..":"..sDakika..":"..sSaniye ; -- En son Bu şekilde Çıktı Alınır. end end [/codebox][b][color="#FF0000"] Kullanımı: [/color][/b][color="#FF0000"][color="#000000"][code]sTime = ZamaniHesapla("10","100") -- 100 Boyut 10 Hız Label.SetText("Label1", sTime);[/code] Denedim Bende Çalıştı.. Bi hata yapmadysam yada birşeyi kaçırmadıysam çalışacaktır. [/color][/color][b] [/b] Edited October 30, 2011 by Kazım Quote Link to comment Share on other sites More sharing options...
NotToday Posted November 12, 2011 Author Share Posted November 12, 2011 (edited) Kazım olmadı Boyut me olursa olsun 10 saniye gösteriyor Edited November 12, 2011 by ReaLyMaN Quote Link to comment Share on other sites More sharing options...
xarax Posted November 12, 2011 Share Posted November 12, 2011 Yardım Dosyasında "Callback Functions" diye aratarak, aradığınız şeyi bulabilirsiniz. Biraz ingilizce bilmeniz yada AMS de tecrübeli olmanız, kodları çözmenizi kolaylaştıracaktır. Kolay Gelsin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.