1 Pages (9 items)
Function in line odd behavior - When a function is placed in a 'line' it provides an error - Messages
#1 Posted: 4/2/2015 12:45:37 PM
Attached is a long calc, but I you will see a section toward the middle where I have pulled a function out of a line. I have a trace error on the input parameter H.T# which assigns itself to itself and thus causes an error message. Can anyone help explain. If the file if clouding my problem I can try to reduce this later.
Thanks in advance!!
ER - Braced Excavation test_3.sm (154 KiB) downloaded 43 time(s).
Thanks in advance!!
ER - Braced Excavation test_3.sm (154 KiB) downloaded 43 time(s).
#2 Posted: 4/5/2015 10:34:47 PM
Attached is the function removed from the rest of the calculation. I just can't seem to figure this out. When the function is in a "line" it returns that H.T# is not defined. If you take the function out of the line it seems to operate fine. This is driving me nuts
Function Error.sm (14 KiB) downloaded 35 time(s).

Function Error.sm (14 KiB) downloaded 35 time(s).
#3 Posted: 4/6/2015 1:58:08 PM
Ioan -> thanks for your response!
I used to do as you describe. However, I noticed Martin had used the function parameters for input and output. See here for his explanation.
However it seems to be causing me problems for some reason I don't understand. Attache is another example.
Is it possible for me to edit the name of this thread? It should really be function input/output parameter error or something along those lines.
Function with output parameter.sm (43 KiB) downloaded 36 time(s).
I used to do as you describe. However, I noticed Martin had used the function parameters for input and output. See here for his explanation.
However it seems to be causing me problems for some reason I don't understand. Attache is another example.
Is it possible for me to edit the name of this thread? It should really be function input/output parameter error or something along those lines.
Function with output parameter.sm (43 KiB) downloaded 36 time(s).
#4 Posted: 4/6/2015 4:35:47 PM
Very odd that I still get a result when I put the function back into a "Line".
See attached
Function in line error.sm (44 KiB) downloaded 37 time(s).
See attached
Function in line error.sm (44 KiB) downloaded 37 time(s).
#5 Posted: 4/6/2015 6:34:38 PM
Back to my original problem.. I just can't seem to get this one.
ER - Braced Excavation_1.sm (853 KiB) downloaded 38 time(s).
ER - Braced Excavation_1.sm (853 KiB) downloaded 38 time(s).
#6 Posted: 4/7/2015 11:37:08 AM
Ioan -> I really appreciate you taking a look at this. thank you.
Regarding my "in-line" problem:
The only time that function should run is if there is 2 or more rows. Due to the d.brc = 1 if statement check. However disregarding this. I don't understand why the functions when separated work fine. However when put on the same "line" they do not work. See attached.
Yes this is very true, I do need to get a function started, working, then keep it working. I do though normally start with the program as not a function, such as this one and it was working. Then when I assembled it, I started having issues.
How else do you build functions? I adapted this technique from Martins FEA Beam Prepocessor. It is a way to "build" matrices. I had thought it was good practice to define a Matrix of zero size then fill it with the necessary information, no?
Could you elaborate on this? I do want to improve this.
I will try to re-write this. I don't mean to be risky...
Functionerror bis - in-line error.sm (30 KiB) downloaded 34 time(s).
Regarding my "in-line" problem:
QuoteThe second one has errors in its body. ---> for 2,...
The only time that function should run is if there is 2 or more rows. Due to the d.brc = 1 if statement check. However disregarding this. I don't understand why the functions when separated work fine. However when put on the same "line" they do not work. See attached.
QuoteI propose you to operate, by your self, a full program refactoring, keeping it simply, readable, to test each function individually and to assembly them after.
Yes this is very true, I do need to get a function started, working, then keep it working. I do though normally start with the program as not a function, such as this one and it was working. Then when I assembled it, I started having issues.
Quoteuse of illicit matrix definition: MK.a#:matrix(0,6)
How else do you build functions? I adapted this technique from Martins FEA Beam Prepocessor. It is a way to "build" matrices. I had thought it was good practice to define a Matrix of zero size then fill it with the necessary information, no?
Quoteunnecessarily (only cosmetic) programming lines; for me it is not very clear the work of unnecessarily "programming lines"
Could you elaborate on this? I do want to improve this.
I will try to re-write this. I don't mean to be risky...

Functionerror bis - in-line error.sm (30 KiB) downloaded 34 time(s).
#7 Posted: 4/7/2015 7:27:42 PM
Thanks ioan.
I have retooled and now it seems to be working. Although there are nested functions. Is this ok?
I still think I like the idea of 0 matrix, but if there is a better way to build matrices securely, I'm all ears.
ER - Braced Excavation.sm (145 KiB) downloaded 39 time(s).
I have retooled and now it seems to be working. Although there are nested functions. Is this ok?
I still think I like the idea of 0 matrix, but if there is a better way to build matrices securely, I'm all ears.
ER - Braced Excavation.sm (145 KiB) downloaded 39 time(s).
#8 Posted: 4/9/2015 11:01:03 AM
Ioan -> No, not intrusive at all, you have great advice.
I like the idea of initializing a "zero matrix" because it ensures that the variable is empty and now I can add to it. Although maybe this is poor thinking. I like the idea of functions because I can keep calculations all one page in a condensed format and not have to worry too much about global vs local variables.
I still am not sure what you are referring to as cosmetic treatment.
thanks again!
I like the idea of initializing a "zero matrix" because it ensures that the variable is empty and now I can add to it. Although maybe this is poor thinking. I like the idea of functions because I can keep calculations all one page in a condensed format and not have to worry too much about global vs local variables.
I still am not sure what you are referring to as cosmetic treatment.
thanks again!
#9 Posted: 4/10/2015 10:12:42 AM
Thanks Ioan, I understand now. The term "cosmetics" does make sense. However, those lines help me keep my mind organized
I

I
1 Pages (9 items)
-
New Posts
-
No New Posts