tonalli
Hi everyone,
I have been trying to use the “for” statement defining my own iteration parameter. I have been looking examples in tutorials, manuals and user macros but I just found the “for strs {}", "for xdds {}" and "For(Mi=0, Mi<M, Mi=M+1,…)" statements, I understood that the For(Mi=0, Mi<M, Mi=M+1,…) statement is exclusive for the iteration parameter Mi. Does anybody knows how to make a loop using a “for” statement defining my own iteration parameter?
I will show you with this example, just to ilustrate my question:
Imagine that I want to vary the scale with a regular step, .001, to solve this I will propose:
xdd
…
str
…
for (iterator=1, iterator<1000, iterator=iterator+1)
{
scale = 0.001 * iterator;
out(Get(weight_porcent), “%10.5f”)
}
…
Thank you for your time and help
Best regards
alan-coelho
Hi Tonalli
The For statment cannot be used in the manner you have described. It is a construct that can only be used within an equation. At present its not possible to ouput non-independent parameters per interation but it is possible to ouput independent parameters per iteration; this will output all independent parmaeters per interation:
out_prm_vals_per_iteration SOME_FILE.TXT
You can change the 'scale' parameter each iteration as follows:
scale = 0.001 * Cycle_Iter;
But in this case 'scale' wont be an independent parameter.
cheers
alan
iangie
Hi Alan,
I have a question also about "for xdd". So I put my questuion here in the same thread.
I am trying to fit multiple ranges (xdd), but I really do not want to copy phase structures into every xdds. So I define all the strctures (str) in "for xdd".
It seems I can not use PO macro in these structures, because the key words "str_hkl_angle" inside PO macro will give "ang" a random name, but the program do not like same parameter name in "for xdd".
May I ask how can we use PO in str defined in "for xdd"?
Thank you very much.