How do i convert a string to an integer? I'm using tboxes in forms for integers. That's why.
How do i convert a string to an integer? I'm using tboxes in forms for integers. That's why.
StrtoInt()
i could have swore there was a strtoint() in SCAR. =o
<TViYH> i had a dream about you again awkwardsaw
Malachi 2:3
Any idea how i use it?
I did,
But it still says type mismatch.SCAR Code:StrToInt(Problemo2);
StrToInt(Problemo1);
EDIT: Nevermind I'm stupid![]()
SCAR Code:program New;
var
st1:string;
begin
st1 := '5';
writeln(StrToInt(St1));
end.
Works here,.
Rogeruk's Al-Kharid Tanner V1.1 [Released]
Rogeruk's Barbarian Crafter [Coming Soon]
Rogeruk's Guild Fisher [Coming Soon]
!! - Taking Requests - !!
Thanks people!
Last edited by Mr. Doctor; 11-19-2009 at 11:33 PM.
I recommend using radio buttons for that kind of selection over combo boxes. You won't have to deal with strings, or people typing in the combo box (although you could prevent that).
If you use radio buttons just use something like this when the equals button is pressed:
Code:if MultiplyRadioBtn.Checked then YourMultiplyFunc(InputBox1, InputBox2) else if DivideRadioBtn.Checked then YourDivideFunc(InputBox1, InputBox2)
Scripts: AIOCurser !, Tea Stall Thiever !, Flax Picker !
Other: Objective Functions, Scarduku
Tutorials: How to create a plugin for Simba, [VB.NET] Using My.Settings, [Photoshop] Basic Abstract Art
Outdated: m!ne v1.00 [STATS]
Use Round(FloatToStr())
I think ~.^
That would try to round a string. Should be
FloatToStr(Round(i))
Scripts: AIOCurser !, Tea Stall Thiever !, Flax Picker !
Other: Objective Functions, Scarduku
Tutorials: How to create a plugin for Simba, [VB.NET] Using My.Settings, [Photoshop] Basic Abstract Art
Outdated: m!ne v1.00 [STATS]
StrToIntEx(number: String; Default: Integer): Integer;
That will catch if you try todo the conversion and it can't, following so, will set it to default.
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
There are currently 1 users browsing this thread. (0 members and 1 guests)