I have a code and dont know how to include a variable name "asubject1" in a TextFile.ReadToString address. The variable has the subject name which determines the location.
Example Code:
if asubject1 then
Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\\asubj ect1\\q2011\\2ans.txt");
if Qans2 == "1" then Image.Load("Ans1", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "2" then Image.Load("Ans2", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "3" then Image.Load("Ans3", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "4" then Image.Load("Ans4", "AutoPlay\\Images\\tick.png");
end
end
Please i need help with example. Thanks.
Example Code:
if asubject1 then
Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\\asubj ect1\\q2011\\2ans.txt");
if Qans2 == "1" then Image.Load("Ans1", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "2" then Image.Load("Ans2", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "3" then Image.Load("Ans3", "AutoPlay\\Images\\tick.png");
elseif Qans2 == "4" then Image.Load("Ans4", "AutoPlay\\Images\\tick.png");
end
end
Comment