Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kind of easy ?
#31
Oh, ok then.
It's not that big of deal its just that it's good if you don't get told that answer =P
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#32
understanding.. i hear what your saying. thank you.
Reply
#33
The MOD issue.

Several guys explained how MOD works, but failed to explain why Mango used it in the following code:
Code:
FOR i = 1 TO 100
  PRINT USING " ###"; table(i);
  IF i MOD 10 = 0 THEN PRINT
NEXT i
He's got 100 values to print and wants to print 10 of them per row; that is, 10 of them across the page.
He needs to know each time he finishes printing 10 of them so he can do a PRINT to the next line or row. So he needs to know when the index number "i" is a multiple of 10. The easiest way to determine if the index is a multiple of 10 is to use the MOD function.
The instruction "IF i MOD 10 = 0 THEN PRINT"
means: if the value of i divided by 10 produces a remainder of zero, then print. Obviously, if I divide a number by 10 and the remainder is zero, then the number is a multiple of 10.

P.S. Your use of "IF i MOD 12 THEN PRINT" doesn't make any sense because you're only going to print 12 values anyway, based of the FOR above.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)