Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Help with if/elseif
Started by Max Niebylski Jun 01 2013 07:45 AM

- - - - -
2 replies to this topic
else elseif
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Max Niebylski

[GLOBAL: userInfoPane.html]
Max Niebylski
  • Contributor

  • 126 posts
  • Enterprise

Hey guys apparently this code does not work...

function workoutPrep(event)
  if numCurrent == 1 then
  activityCurrent = myTable:ex1
  elseif numCurrent == 2 then
    activityCurrent = myTable:ex2
  elseif numCurrent == 3 then
    activityCurrent = myTable:ex3
    elseif numCurrent == 4 then
    activityCurrent = myTable:ex4
    elseif numCurrent == 5 then
    activityCurrent = myTable:ex5
    elseif numCurrent == 6 then
    activityCurrent = myTable:ex6
    end
end

 

The error I am getting is- 

 

TimedActivities/main.lua
Line: 45
 
Function arguments expected near 'elseif'
 
 
Any help is appreciated! Thanks!


[TOPIC: post.html]
#2

JonPM

[GLOBAL: userInfoPane.html]
JonPM
  • Corona Geek

  • 1,077 posts
  • Corona SDK

Should be myTable.ex1, myTable.ex2, etc



[TOPIC: post.html]
#3

Max Niebylski

[GLOBAL: userInfoPane.html]
Max Niebylski
  • Contributor

  • 126 posts
  • Enterprise

Thanks a ton! Now fixed :)




[topic_controls]
[/topic_controls]