Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Execution in SMath 1

Status
Not open for further replies.

dik

Structural
Apr 13, 2001
25,969
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

Unfortunately I can't run smath.

One nasty trick would be
if <I want to end it>
i=rows(data)
else
<carry on>

That works on very bad implementations of some languages.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
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!
 
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
 
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
 
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?
image_vh1r9k.png
 
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
 
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.
 
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
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor