How would i only allow integers to be typed into the TEdit and then have them used say for an inventory number.
How would i only allow integers to be typed into the TEdit and then have them used say for an inventory number.
My Scripts:
Cafinated Killer|~~| Ghoul Killer With Bank|~~|CraftingGuild
First TuT, Objonscreenfinder!
StrToIntDef(TEditBox.Text, DefaultValueIfUserEntersCrap);
I am Ggzz..
Hackintosher
How would that go in and where for Tedit
Simba Code:Edit3 := TEdit.Create(FrmDesign);
Edit3.Parent := FrmDesign;
Edit3.Top := 350;
Edit3.Left := 75;
Edit3.Width := 100;
Edit3.Height := 27;
all i want this to do isbe able to change a global variable known as
InvNumber: Integer;
My Scripts:
Cafinated Killer|~~| Ghoul Killer With Bank|~~|CraftingGuild
First TuT, Objonscreenfinder!
ill assume you learnt this from tutorial and you have this procedure
Simba Code:Procedure ButtonClick(Sender: TObject);
Begin
frmDesign.ModalResult:= mrOk;
InvNumber:=StrToInt(Edit3.text);//you need to convert the value entered from a string
End;
that should work
Last edited by Mark; 01-15-2012 at 04:48 PM.
Thanks.
My Scripts:
Cafinated Killer|~~| Ghoul Killer With Bank|~~|CraftingGuild
First TuT, Objonscreenfinder!
View my OSR Script Repository!
Botted to max
Guides: How to Report Bugs to the Scripter
~~~~ Moved to Java. Currently Lurking ~~~~
would cause an error
BankPin Invalid Int value "981c"
you could make a check for this.
But really tho your not going to enter a letter to a number only field like bank pin without you noticing.
Previously Known or not Known as CRU1Z1N.
If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)
There are currently 1 users browsing this thread. (0 members and 1 guests)