Concatenating Strings

Tecplot's automation language

Python scripts were supported in the alpha version for Legacy 360 (2013). Python inquiries in 2017 should be directed to the PyTecplot Forum.

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

dchalhub
Newbie
Posts: 4
Joined: Wed May 09, 2012 11:32 am
Location: Brasil

Concatenating Strings

Postby dchalhub » Wed Sep 26, 2012 1:08 pm

How do I concatenate strings in Tecplot scripting.

Example:

Code: Select all

$!EXPORTSETUP EXPORTFNAME = "C:\test"+"|&(ZONENAME[ACTIVEOFFSET=1])|"+".eps"


Thanks

thealchemist
Experienced user
Posts: 17
Joined: Tue Dec 18, 2007 4:47 pm
Location: Sunnyvale
Contact:

Re: Concatenating Strings

Postby thealchemist » Fri Sep 28, 2012 7:51 am

Hi,

You do not need any special functionality to concatenate. Tecplot macros replaces the variable names on the fly in the macro.

In your case, it would look something like this:

Code: Select all

$!EXPORTSETUP EXPORTFNAME = "C:\test\|ZONENAME[NNN]|.eps"


where NNN is the NNNth zone. Note that I believe you cannot use ACTIVEOFFSET when using the macro variable ZONENAME.

As an aside, when using intrinsic variables in a macro replace "&(VARNAME)" with "|VARNAME|".

Hope this helps.

User avatar
salter
Moderator
Posts: 188
Joined: Thu Dec 21, 2006 10:57 am
Location: NASA Langley Research Center
Contact:

Re: Concatenating Strings

Postby salter » Fri Sep 28, 2012 11:35 am

If you want to concatenate strings, for some other reason, you can simply do it by placing everything within double quotes. For example,

Code: Select all

$!VarSet |FileName| = "ThisFile"
$!VarSet |Directory| = "./overhere/"
$!VarSet |FileToLoad| = "|Directory||FileName|"


will produce the contents of "./overhere/ThisFile"

Good Luck,
Steve...

Aerospace Research Engineer
Aerothermodynamics Branch
NASA Langley Research Center


Return to “Tecplot Macro Language”

Who is online

Users browsing this forum: No registered users and 7 guests