? on For Next Loops
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 09:01 PM
FOR dist=0 TO 30' STEP brick_tie
ADDx dist
GOSUB 111
NEXT dist
RETURN
Will this work in an object? It's just putting 1 in and that's it. The brick_tie is a parameter for a length. GOSUB 111 is the actual lines for the brick tie.
Thanks for any help,
Michele
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 09:07 PM
Thanks,
Michele
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 09:51 PM
It should work.
Why don't you try it and see.
Del the addx transformations
before return.
Peter Devlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 09:57 PM
Thanks,
Michele
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 10:20 PM

Peter Devlin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 10:44 PM
I would go with more of a WHILE/DO. like
WHILE dist < 30'-0" DO.... dist = dist + bricktie ENDWHILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-07 11:26 PM
Could you tell us what happens if
you end up with fractions/decimals.
Until two days ago I thought
for loops could only work with integers
but now I'm not so sure.
Thanks,
Peter Devlin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-08 02:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-08 09:00 PM
That was my impression also until, as I said, two days ago.
You mentioned once that you were studying C++.
Does the C++ for loop have the "step" part like GDL ?
It occurs to me that maybe some computer languages
may not have "step" and in that case only integers can be used.
I did a little test using the piece of code using a for loop on
page 1.26 of the GDL Cookbook 3. I tried to force the for loop
to use fractional values and calculate fractional values and
it seemed like there was no problem. The result were always
what you would expect.
Just a few thoughts,
Peter Devlin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-09-08 09:13 PM
Peter wrote:Honestly, I've not used any C++ for almost a year... I think there was, but I cannot say for sure from memory and I'm too lazy to look it up right now
Hello Tom,
That was my impression also until, as I said, two days ago.
You mentioned once that you were studying C++.
Does the C++ for loop have the "step" part like GDL ?
It occurs to me that maybe some computer languages
may not have "step" and in that case only integers can be used.
I did a little test using the piece of code using a for loop on
page 1.26 of the GDL Cookbook 3. I tried to force the for loop
to use fractional values and calculate fractional values and
it seemed like there was no problem. The result were always
what you would expect.
Just a few thoughts,
Peter Devlin