Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
49
Task/Integer-comparison/FutureBasic/integer-comparison.basic
Normal file
49
Task/Integer-comparison/FutureBasic/integer-comparison.basic
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
_window = 1
|
||||
begin enum 1
|
||||
_integer1Fld
|
||||
_integer2Fld
|
||||
_compareBtn
|
||||
_messageLabel
|
||||
end enum
|
||||
|
||||
local fn BuildWindow
|
||||
window _window, @"Integer Comparison", (0,0,356,85)
|
||||
|
||||
textfield _integer1Fld,,, (20,44,112,21)
|
||||
TextFieldSetPlaceholderString( _integer1Fld, @"Integer 1" )
|
||||
|
||||
textfield _integer2Fld,,, (140,44,112,21)
|
||||
TextFieldSetPlaceholderString( _integer2Fld, @"Integer 2" )
|
||||
|
||||
button _compareBtn,,, @"Compare", (253,38,90,32)
|
||||
|
||||
textlabel _messageLabel,, (18,20,320,16)
|
||||
ControlSetAlignment( _messageLabel, NSTextAlignmentCenter )
|
||||
end fn
|
||||
|
||||
local fn DoDialog( ev as long, tag as long )
|
||||
long int1, int2
|
||||
|
||||
select ( ev )
|
||||
case _btnClick
|
||||
select ( tag )
|
||||
case _compareBtn
|
||||
int1 = fn ControlIntegerValue( _integer1Fld )
|
||||
int2 = fn ControlIntegerValue( _integer2Fld )
|
||||
|
||||
if ( int1 < int2 ) then textlabel _messageLabel, @"The first integer is less than the second integer."
|
||||
if ( int1 == int2 ) then textlabel _messageLabel, @"The first integer is equal to the second integer."
|
||||
if ( int1 > int2 ) then textlabel _messageLabel, @"The first integer is greater than the second integer."
|
||||
|
||||
end select
|
||||
|
||||
case _controlTextDidChange
|
||||
textlabel _messageLabel, @""
|
||||
end select
|
||||
end fn
|
||||
|
||||
fn BuildWindow
|
||||
|
||||
on dialog fn DoDialog
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue