Forum: Forums topas RSS
How to define and import the values of string variables
Definition and working with parameters as string
masgari #1
Member since Jun 2018 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to define and import the values of string variables
I am working on sequential rietveld refinement of some PXRD data and I need to attach the name of CIF output CIF files to the Number of runs that has been defined as variable in inp. file. How can I do that?

For example, let's assume that I have a parameter defined as following:

prm !N = 10 ;

How can I make a CIF file with the name which follows the content of N parameter, i.e. in this case:
A CIF file with the name which is called "10.CIF".

Thanks,
johnsoevans (Administrator) #2
User title: John Evans
Member since Aug 2009 · 170 posts
Group memberships: Administrators, Members
Show profile · Link to this post
Does the following do what you want:

Out_CIF_STR(cif_files\run_number_##Run_Number##.cif)
masgari #3
Member since Jun 2018 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thanks johnsoevans for your answer. I tried that but I couldn't make it. When I write the command you have written here, instead of the number, it writes the cif file with the name "Run_Number" instead of the Run_Number.
I think that somewhere I am doing wrong but I don't know where exactly.

This is the command that I have written:

Out_CIF_STR(CuBTT_NPD_Bare_10K##Run_Number##.cif)
 and this is the name of the CIF file it has been produced:

"CuBTTr_NPD_Bare_10KRun_Number.cif"

It does not depend that I define the parameter or not! I tried to define the Run_Number like this:
 prm !Run_Number 10
or
 prm !Run_Number=10;

But this also doesn't work.

I should also mention I am using Topas 5.
AlanCoelho #4
Member since Aug 2011 · 240 posts
Group memberships: Members
Show profile · Link to this post
Version 5 does not have Run_Number. Version 6 does.

However, the ## string concatenation sequence works in version 5 and the following should work:

macro Run_Number { 10 }

Out_CIF_STR(cif_files\run_number_##Run_Number##.cif)

cheers
alan
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Not logged in. · Lost password · Register
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Current time: 2018-09-22, 17:43:23 (UTC +00:00)