« Ves enrere

Query AdoScript AQL_EXPRESSION using variable names?

Vista combinada Visió plana Vista en arbre
Fils [ Anterior | Següent ]
toggle
Query AdoScript AQL_EXPRESSION using variable names?
query adoscript expr eval_aql_expression
Resposta
10/08/18 08:52
Hello,

How can i use variables in AdoScript queries ?

Example Code:
CC "AQL" EVAL_AQL_EXPRESSION expr:"({\"A\":\"B\"}<-\"Is inside\")"  modelid: (modelid)

This code works is gets all elements inside element "A" which has the type "B".

But now i want to use instead of the hardcoded string "A" a  variable to get the elements inside depending on the variable.

Can you please help me with the syntax and post also the link to the documenation.

BR
Martin

RE: Query AdoScript AQL_EXPRESSION using variable names?
query adoscript query adoscript eval_aql_expression
Resposta
10/08/18 10:37 com a respotat a Martin Paczona.
Hallo Martin,

you can use the „+“ operator for concatenation of Strings.

Example: Get all objects of class B, which are inside the class V:
1) Without a variable:
1CC "Modeling" GET_ACT_MODEL
2CC "AQL" EVAL_AQL_EXPRESSION expr:("<\"V\"><-\"Is inside\">\"B\"<") modelid: (modelid)

2) Using a variable:
1CC "Modeling" GET_ACT_MODEL
2SETL sClass:("V")
3CC "AQL" EVAL_AQL_EXPRESSION expr:("<\"" + sClass + "\"><-\"Is inside\">\"B\"<") modelid: (modelid)