Jump to content

Inı'ye Sırasıyla Verileri Girdirme


Yusuf-Yildiz
 Share

Recommended Posts

[b]Selamun aleykum arkadaşlar. Benim yardım etmenizi istediğim konu şu;[/b]
[b]
[/b]
[b]Bir tane input bir tane de butonumuz var. Şimdi butona tıkladığımızda inputa girilen yazıyı ini dosyasına kayıt edecek. Ancak, mesela ad1 girişi boş ise ad1'e, dolu ise ad2 ye; ad2 girişi dolu ise ad3'e, ad3 girişi dolu ise ad4'e... kayır edecek. 10-15 olsa yaparım kodları biliyorum ama en az 160 adet olacağı için biraz zorlandım. Bunları for ile veya başka bir yöntemle nasıl yazarım? Teşekkürler....[/b]
[b]
Edit: Aşağıdaki benim yazdığım kodlar düzgün çalışıyor, fakat sadece 3 adet için. Sınırsız ya da yüksek bir sayıda yapmamız lazım;
[/b]
[spoiler][code]ad = Input.GetText("Input1");
yer = Input.GetText("Input2");

ad1= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad1");
yer1= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer1");

ad2= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad2");
yer2= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer2");

ad3= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad3");
yer3= INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer3");

if ad1=="" and yer1=="" then
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad1", ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer1", yer);
elseif ad2=="" and yer2=="" then
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad2", ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer2", yer);
elseif ad3=="" and yer3=="" then
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad3", ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer3", yer);
elseif ad4=="" and yer4=="" then
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad4", ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer4", yer);
else
Dialog.Message("Uyarı!", "Yer kalmadı!", MB_OK, MB_ICONSTOP, MB_DEFBUTTON3);
end[/code][/spoiler][b]
[/b] Edited by severalnasty
Link to comment
Share on other sites

[b]Çözüldü. [color="#ff0000"]Kazım[/color] abiye çook teşekkürler...[/b]
[b]
[/b]
[spoiler][code]ad = Input.GetText("Input1");
yer = Input.GetText("Input2");

veriler = INIFile.GetValueNames("AutoPlay\\Docs\\Kullanici.ini", "bilgiler");

if veriler ~= nil then
sVeriSayisi= Table.Count(veriler);
else
sVeriSayisi=2;
end

kontrol=1;

for i=1,sVeriSayisi+1 do
veri_ad = INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad"..i);
veri_yer = INIFile.GetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer..i");
if veri_ad == "" and veri_yer == "" then
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad"..i, ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer"..i, yer);
kontrol=0;
break
end
end

if kontrol == 1 then
value_new =(sVeriSayisi+2)/2;
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "ad"..value_new, ad);
INIFile.SetValue("AutoPlay\\Docs\\Kullanici.ini", "bilgiler", "yer"..value_new, yer);
end

Dialog.Message(kontrol, "Başarılı", MB_OK, MB_ICONINFORMATION);[/code][/spoiler]

Edited by severalnasty
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...