1页(9条)
Function in line odd behavior - When a function is placed in a 'line' it provides an error - 消息
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.18 KiB)已下载 1464 次。
Thanks in advance!!
ER - Braced Excavation test_3.sm (154.18 KiB)已下载 1464 次。
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.46 KiB)已下载 1379 次。
Function Error.sm (14.46 KiB)已下载 1379 次。
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.31 KiB)已下载 1346 次。
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.31 KiB)已下载 1346 次。
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.81 KiB)已下载 1387 次。
See attached
Function in line error.sm (44.81 KiB)已下载 1387 次。
Back to my original problem.. I just can't seem to get this one.
ER - Braced Excavation_1.sm (853.59 KiB)已下载 1474 次。
ER - Braced Excavation_1.sm (853.59 KiB)已下载 1474 次。
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.01 KiB)已下载 1421 次。
Regarding my "in-line" problem:
引用The 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.
引用I 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.
引用use 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?
引用unnecessarily (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.01 KiB)已下载 1421 次。
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.18 KiB)已下载 1451 次。
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.18 KiB)已下载 1451 次。
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!
Thanks Ioan, I understand now. The term "cosmetics" does make sense. However, those lines help me keep my mind organized
I
I
1页(9条)
- 有新帖
- 无新帖