hi ppl im new at Scilab, im doing a script which i send the user through menus and i'm making a function for every sub-menu. I read that functions can have 0 input parameters but it must have at least 1 output parameter. According to this i wrote this
//execution file landing menu
option='1'
while (option~=0)
clc
mprintf('1 - First Sub-menu')
mprintf('2 - Second Sub-menu')
option=input('Select the option: ', 's')
select option
case '1' then
result=sub_one(),
case '2' then
result=sub_two(),
else
disp('Invalid Option!!!')
end
end
//Function sub_one
function result=sub_one()
option='1'
while (option~=0)
clc
mprintf('1 - Do stuff')
mprintf('2 - Do other stuff')
option=input('Select the option: ', 's')
select option
case '1' then
result=do_stuff(),
case '2' then
result=do_other_stuff(),
else
disp('Invalid Option!!!')
end
end
result=0
endfunction
and i always get the error
result=sub_one(),
!--error 4
Undefined variable: sub_one
at line xx of exec file called by :
exec('dir\dir\dir\file.sce', -1)
this is freaking annoying me
some experter then me?