Jump to content

input.onkey Kısmında And Veya Or Operatörünü Nasıl Kullanırım?


PColik
 Share

Recommended Posts

Arkadaşlar merhaba,

Input'ın OnKey kısmına aşağıdaki kodu yazdım:

if e_key ~= (48 or 49 or 50 or 51 or 52 or 53 or 54 or 55 or 56 or 57) then
Dialog.Message("","");
end

Dialog.Message kısmını konuyu basitleştirmek için ekledim. Sorunu çözersem oraya kodlarımı ekleyeceğim. Ben Input'a sadece 0,1,2,3,4,5,6,7,8,9 harici birşey girilirse kodumun çalışmasını istiyorum. Yukarıda ki kodda or yerine and operatörü de kullandım fakat ikisi de olmadı. Bunu sorunu nasıl çözebilirim?

Link to comment
Share on other sites

Xerkan, 23 saat önce yazdı:

if (e_Key < 48 or e_Key > 57) then
Dialog.Message("","Sadece rakam girebilirsin");
end

Bu kodu deneyebilirsin

Bu kod çalıştı, çok teşekkür ederim kardeşim. Fakat uyarıyı verdikten sonra harf input a giriliyor. Bu son girilen harfi sildirmemin bir yolu var mı?

Link to comment
Share on other sites

PColik, 1 saat önce yazdı:

Bu kod çalıştı, çok teşekkür ederim kardeşim. Fakat uyarıyı verdikten sonra harf input a giriliyor. Bu son girilen harfi sildirmemin bir yolu var mı?

if (e_Key < 48 or e_Key > 57) then
  	Input.SetText(this, "");
	Dialog.Message("Hata", "Sadece rakam girebilirsin");
end

 

Edited by Dark_Angel
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...