var dueArray = [0, 0, 345, 137, 0, 0, 0, 181, 0, 0, 0, 131, 284, 0, 0, 56, 315,0, 0, 0];
var currentDate = 300;
var dateDue
function showCatalogue()
{
for (var count = 0; count < bookArray.length; count = count + 1)
{
dateDue = dueArray[count] - currentDate
document.write(count + '------' + bookArray[count] +'------' + daysOverDue(dueDate) + '<BR>');
}
}
function daysOverdue(dateDue)
{
if (dateDue = 300)
{
document.write('On shelf')
}
}
i have created the above code to write out the arrays, i have only included the array i am having trouble with in the code. What i need to do is covert dueArray[count] into text based on the value. i.e if the due date equals 300 then it writes out 'on shelf' instead. The code above is probably a mile off. i have tried lots of variations but this was my last attempt.
any hints, pointers or assistance would be fantastically appreciated.

New Topic/Question
This topic is locked



MultiQuote





|