Posted 20 June 2014 - 11:24 PM
Hi,
I have a relatively small question. I am using a touchscreen and trying to detect which page I am on so that I only visually update the current page. However, the page length is dynamic, so I want to loop through the total number of pages for each category and check if the current page is part of that category and then get the exact page. Is there any "fancy" or clean way to do what I have in mind?
Also, this whole code snippet is in a loop already, so I want a relatively 'efficient' way to do it (I don't want to loop through everything again to check what page/category it is if possible).
Here is the idea that doesn't work because the syntax of the elseif statements are incorrect:
Essentially something that has the functionality of: elseif (currPage is in the array fullJarsPage) then
Thanks!
I have a relatively small question. I am using a touchscreen and trying to detect which page I am on so that I only visually update the current page. However, the page length is dynamic, so I want to loop through the total number of pages for each category and check if the current page is part of that category and then get the exact page. Is there any "fancy" or clean way to do what I have in mind?
Also, this whole code snippet is in a loop already, so I want a relatively 'efficient' way to do it (I don't want to loop through everything again to check what page/category it is if possible).
Here is the idea that doesn't work because the syntax of the elseif statements are incorrect:
if currPage == emptyPage then
--do stuff for this page
elseif
for i = 1, #emptyJarsPages do
if t == emptyJarsPages[i] then
--Do stuff for that page
end
end
elseif
for i = 1, #fullJarsPages do
if t == fullJarsPages[i] then
--Do stuff for that page
end
end
end
Essentially something that has the functionality of: elseif (currPage is in the array fullJarsPage) then
Thanks!