Problems With Code

  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

I have some trouble with my code (below), instead of having all 5 lines i want to make them into 1 main line, im trying a "for" command, but it aint working, if anyone could help with anything it would be great, any questions just ask.

Code: [ Select ]
[PUSHHoldi]
For i = 1 to 5
    If (hold(i) = 1) Then hold(1) = 0 Else hold(i) = 1
  Next ii
Wait

'[PUSHHold2]
'If (hold(2) = 1) Then hold(2) = 0 Else hold(2) = 1
'wait
'[PUSHHold3]
'If (hold(3) = 1) Then hold(3) = 0 Else hold(3) = 1
'wait
'[PUSHHold4]
'If (hold(4) = 1) Then hold(4) = 0 Else hold(4) = 1
'wait
'[PUSHHold5]
'If (hold(5) = 1) Then hold(5) = 0 Else hold(5) = 1
'wait
  1. [PUSHHoldi]
  2. For i = 1 to 5
  3.     If (hold(i) = 1) Then hold(1) = 0 Else hold(i) = 1
  4.   Next ii
  5. Wait
  6. '[PUSHHold2]
  7. 'If (hold(2) = 1) Then hold(2) = 0 Else hold(2) = 1
  8. 'wait
  9. '[PUSHHold3]
  10. 'If (hold(3) = 1) Then hold(3) = 0 Else hold(3) = 1
  11. 'wait
  12. '[PUSHHold4]
  13. 'If (hold(4) = 1) Then hold(4) = 0 Else hold(4) = 1
  14. 'wait
  15. '[PUSHHold5]
  16. 'If (hold(5) = 1) Then hold(5) = 0 Else hold(5) = 1
  17. 'wait
  • bjhess
  • Student
  • Student
  • User avatar
  • Posts: 77
  • Loc: Owatonna, Minnesota

Post 3+ Months Ago

khayoz wrote:
Code: [ Select ]
[PUSHHoldi]
For i = 1 to 5
    If (hold(i) = 1) Then hold(1) = 0 Else hold(i) = 1
  Next ii
Wait
  1. [PUSHHoldi]
  2. For i = 1 to 5
  3.     If (hold(i) = 1) Then hold(1) = 0 Else hold(i) = 1
  4.   Next ii
  5. Wait


Could it be because your second call to the hold function after the "Then" has a '1' as an argument rather than an 'i'?

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 70 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.