VS:Concat: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
(move remark from Num2Str to Concat, fix missing braket in example)
Line 31: Line 31:
</lineList>
</lineList>
</params>
</params>
-----------------------------------------------------------------------------------------------------------
<remark>
([[User:Orso.b.schmid|Orso]], 2015.05.23):
You can use [[VS:Concat]] to convert numbers to strings, but it uses exclusively a dot "." as symbol for the decimal marker, it outputs the number as seen from inside VS. See the table below for a list of routines formatting according to your system's settings.
{| class="wikitable"
|+ Decimal marker symbol usage
! Metric: ',' !!  American '.'
|-
|
: 100,123
|
: 100.123
|-
! Formatting routines: !!  Non formatting routines:
|-
|
: [[VS:Num2Str]], [[VS:Num2StrF]], [[VS:Angle2Str]], [[VS:Area2Str]], [[VS:Volume2Str]]
: <code>Num2Str(3, 100.123) { --> 100,123 on metric systems } </code>
: <code>Num2Str(3, 100.123) { --> 100.123 on American systems } </code>
|
: [[VS:Concat]]
: <code>Concat(100.123) { --> 100.123 on any system } </code>
|}
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 36: Line 62:
==== VectorScript ====
==== VectorScript ====
<code lang="pas">
<code lang="pas">
MessageConcat('A','sample','string'));</code>
Message(Concat('A', 'sample', 'string'));</code>
==== Python ====
==== Python ====
<code lang="py">
<code lang="py">
vs.Message(vs.Concat('A','sample','string'))
vs.Message(vs.Concat('A', 'sample', 'string'))
</code>
</code>
</sample>
</sample>

Revision as of 04:10, 24 May 2015

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function Concat combines, or concatenates, all the specified parameters in order and returns the resultant string.

FUNCTION Concat(
txt :DYNARRAY[] of CHAR) : DYNARRAY[] of CHAR;
def vs.Concat(txt):
    return DYNARRAY[] of CHAR

Parameters

txt DYNARRAY[] of CHAR

Remarks

(Orso, 2015.05.23):

You can use VS:Concat to convert numbers to strings, but it uses exclusively a dot "." as symbol for the decimal marker, it outputs the number as seen from inside VS. See the table below for a list of routines formatting according to your system's settings.

Decimal marker symbol usage
Metric: ',' American '.'
100,123
100.123
Formatting routines: Non formatting routines:
VS:Num2Str, VS:Num2StrF, VS:Angle2Str, VS:Area2Str, VS:Volume2Str
Num2Str(3, 100.123) { --> 100,123 on metric systems }
Num2Str(3, 100.123) { --> 100.123 on American systems }
VS:Concat
Concat(100.123) { --> 100.123 on any system }

Example

VectorScript

Message(Concat('A', 'sample', 'string'));

Python

vs.Message(vs.Concat('A', 'sample', 'string'))

Version

Availability: from All Versions