Blockland Forums > Modification Help
I need help with a script
Pages: (1/1)
PartyMan:
I was messing around on FreeBasic, and it was working fine untill i tried adding a new sub "helloworld" (At the bottom of the code)
-This has nothing to do with Blockland :3-
So if you guys can help me out so i can get this to work thanks.
--- Code: ---declare sub main
declare sub add
declare sub subtract
declare sub multiply
declare sub divide
declare sub calc
declare sub helloworld
main
sub main
cls
print "-Main Menu-"
dim choice1
print "1. Calculator"
print "2. Hello"
input choice1
if choice1 = 1 then
calc
if choice1 = 2 then
helloworld
else
main
end if
end sub
sub calc
cls
print "-Calculator-"
dim choice1
print "1. Add"
print "2. Subtract"
print "3. Multiply"
print "4. Divide"
input choice1
if choice1 = 1 then
add
elseif choice1 = 2 then
subtract
elseif choice1 = 3 then
multiply
elseif choice1 = 4 then
divide
else
main
end if
end sub
sub add
cls
print "-Add-"
dim num1
dim num2
dim answer1
input num1
input num2
answer1 = num1 + num2
print answer1
sleep
main
end sub
sub subtract
cls
print "-Subtract-"
dim num1
dim num2
dim answer1
input num1
input num2
answer1 = num1 - num2
print answer1
sleep
main
end sub
sub multiply
cls
print "-Multiply-"
dim num1
dim num2
dim answer1
input num1
input num2
answer1 = num1 * num2
print answer1
sleep
main
end sub
sub divide
cls
print "-Divide-"
dim num1
dim num2
dim answer1
input num1
input num2
answer1 = num1 / num2
print answer1
sleep
main
end sub
sub helloworld
cls
print "-Hello World-"
dim word1 as string
input "Say hello!" ; word1
if number = Hello then
print "Ohia there!"
sleep
main
end sub
--- End code ---
Red_Guy:
well based on whats already working -- I think you need somethign like this:
--- Code: ---sub helloworld
cls
print "-Hello World-"
dim word1 as string
input "Say hello!" ; word1
if number = Hello then
print "Ohia there!"
end if
sleep
main
end sub
--- End code ---
I dont know freebasic - so that could be totally wrong
DrenDran:
--- Quote from: PartyMan on January 07, 2011, 01:15:30 PM ----This has nothing to do with Blockland :3-
--- End quote ---
Then if goes in off topic.
Or possibly Creativity.
You'd get more help there, also.
takato14:
--- Quote from: DrenDran on January 07, 2011, 06:34:53 PM ---Then it goes in off topic.
Or possibly Creativity.
You'd get more help there, also.
--- End quote ---
Pages: (1/1)