Jump to content

Sadece Sayı Girişi


KintaRo
 Share

Recommended Posts

Aşağıdaki kodu yazdığınız inputa sadece sayı girilmesine izin verir. Koşullandırmaları çoğaltarak , veya . girişine de izin verebilirsiniz:


[code]local sText = Input.GetText(this)

if String.ToNumber(String.Mid(sText, #sText, 1)) == 0 then
if String.Mid(sText, #sText, 1) ~= "0" then
Input.SetText(this, String.Mid(sText, 1, #sText-1))
end
end[/code]
Link to comment
Share on other sites

Söylediğinde haklı olabilirsin ama o usluba dikkat etsen iyi olur!

Neyse şöyle bişeyde ben yazdım:

Global Functionsa:

[quote]sText = ""[/quote]

İnputun On_Key evresine:

[code]if (e_Key < 58 and e_Key > 47) or (e_Key < 106 and e_Key > 95) then
sText = Input.GetText(this)
else
Input.SetText(this, sText)
end[/code]

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...