Go to Post It does it automagically. - David Kelly [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-02-2003, 18:31
manodrum manodrum is offline
Registered User
#1127
 
Join Date: Feb 2003
Location: Alpharetta, GA
Posts: 3
manodrum is an unknown quantity at this point
Arrow loops inside of subs???

hi, i have written a little code that will fire our pistons for approx. 3 seconds when one of the joystick buttons is pushed, so I wrote an if statement after the SERIN that

"if p2_sw_trig = 1 then GOSUB FIRE3"

that works and sends it to my sub code which looks like this:


FIRE3:
relay1_fwd = 1
MyCounter VAR byte
StepSize VAR byte

MyCounter = 1

FOR MyCounter = 1 TO 3001 STEP StepSize
StepSize = delta_t * 25
NEXT

relay1_fwd = 0
RETURN


but once i push the trigger, i get a basic run error, but, when i take away the FOR...NEXT statements, everything works, what's up with this? can i not do loops inside of subs? thanks a lot

Stephen
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grease inside the Drill Motor gear box? archiver 2000 2 23-06-2002 23:07


All times are GMT -5. The time now is 03:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi