×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Stop Execution in SMath

Stop Execution in SMath

Stop Execution in SMath

(OP)
Is there a command that will halt execution of a 'for loop' if the program reaches that point and maintains the variable values? I'm haveing difficulty with the attached program. Using the same function, I get different values inside the loop and outside the loop. The post does not allow me to upload a *.sm or *.pdf, for some reason. Maybe from an edit?

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik
Replies continue below

Recommended for you

RE: Stop Execution in SMath

Can you add a loop counter such as:

if(condition I want OR N>10000)
N=N+1

More specific to what you seem to be asking for:

if(condition1 OR condition2)
i=i+1
{other stuff that satisfies condition 1}
if(result(i)-result(i-1) < 0.0001, condition2=TRUE)


Which would catch your result once it's leveled off.

Please remember: we're not all rednecks!
www.sparweb.ca

RE: Stop Execution in SMath

(OP)
Thanks, gentlemen, I'll try... The calculation error, at this time does not make sense... might be a bug of some kind... there should be some kind of exit/stop command.

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

RE: Stop Execution in SMath

(OP)
thanks... I'll try it out.

Dik

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

RE: Stop Execution in SMath

Sorry for not being able to help on this issue. I am learning Smath. I don't want to open a new thread for this question. Will you be able to implement the Vlookup in Smath to pull all section properties of an AISC steel section when you select? I don't see it in your attached sheet. Did you have to enter Szx manually?

RE: Stop Execution in SMath

(OP)
Yes... my excel sheets use Vlookup with a drop down... I copy the first column and do a sort on it for Vlookup. I would love to have that in SMath. If you have a method, please post it... with common sections I have an array that I fill in and add to it as new common sections pop up... same with steel types, etc. but it's a matter of adding an NDX value to select the line of the array.

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

RE: Stop Execution in SMath

I think I got a solution for this Vlookup. I'll post a template for that when I am done. Working on it right now. Thanks.

RE: Stop Execution in SMath

Attached is what I got after googling Smath forum for posts regarding the same purposes. Don't shoot me if the same solution has been posted here.
This post talked about it but I found it too complicated for my level https://en.smath.com/forum/yaf_postst7129p3_Data-t...

This template and AISC database can get anyone a start. I broke the AISC database table into smaller tables for specific shapes and deleted all columns that don't apply for the shape. You need to save the excel file into the same Smath folder. It'll take 2 or 3 seconds to re-calculate whenever you change the shape.

Is there anyway to force Smath to calculate in Imperial units? I hate to retype unit for every calculation.

RE: Stop Execution in SMath

(OP)
In an array, as long as the array has the same units it's easy... as far as normal data goes... I've posted a couple of SMath programs where the data is both Imperial and Metric... the impereial data can be copied into the metric data column, the unit can be highlighted and the metric unit can be typed in... it's in itallic and if you tab the value it automatically changes the units to metric... you can also use cut and paste to achieve the same.

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close