CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CEL in CFD-Post - Combining Parameter with String (https://www.cfd-online.com/Forums/cfx/190623-cel-cfd-post-combining-parameter-string.html)

Dog92 July 18, 2017 12:21

CEL in CFD-Post - Combining Parameter with String
 
Hello,

i am new in writing Macros for CFD-Post that's why I have some problems.
My problem is that I want to combine a Paramter with a String.

Thats my Code:

# Macro GUI begin
#
# macro name = TestMakro
# macro subroutine = mySub
#
# macro parameter = Version-Number
# type = integer
#
# macro parameter = VelAngle
# type = float
#
# Macro GUI end

! no warnings 'redefine';

! sub mySub {
! ($datanr, $angle) = @_;

>load filename=/home/XXX/YYY/CFD/$datanr/'$datanr'Version-transient.dat, force_reload=\
true


For example my file-name is 83Version-transient.dat and i want to load this result file with this macro. How can I achieve that ? The '83' will be declared as a parameter and i want to use it.
What i get is '83'Version-transient.dat with the code above and that can't be loaded.
Thanks

Opaque July 18, 2017 14:00

try adding a variable for the filename location, say

! myfile = /home/XXX....
> load filename = myfile , ....

Then, it is all about Perl string concatenation rules.

Dog92 July 21, 2017 08:54

Sorry for the late reply. It worked. Thank you.


All times are GMT -4. The time now is 17:52.