Using a variable in a loop before it is defined?
‎Sep 17, 2024
04:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Sep 17, 2024
04:10 AM
Using a variable in a loop before it is defined?
Whilst looking at another worksheet in Mathcad Prime 10, I noticed that an as-yet undefined variable in a loop had a value (albeit zero)
I can't remember if this was standard behaviour in previous versions of Mathcad or not. However, it certainly caused me some moments of pondering whilst I tried to determine how a variable was initialized in a much longer program (that I was trying to understand in the first place!).
Stuart
Solved! Go to Solution.
Labels:
- Labels:
-
Programming
ACCEPTED SOLUTION
Accepted Solutions
‎Sep 17, 2024
08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Sep 17, 2024
08:18 AM
The behaviour is the same in MC15 and it seems that any loop does the trick
1 REPLY 1
‎Sep 17, 2024
08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Sep 17, 2024
08:18 AM
The behaviour is the same in MC15 and it seems that any loop does the trick