Difference between revisions of "VS:GetVWRString"

From Vectorworks Developer
Jump to: navigation, search
(add remark about VW 2014 bug)
Line 42: Line 42:
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
<remark></remark>
+
<remark>([[User:Orso.b.schmid|Orso]], 2016.08.23):
 +
GetVWRString is supported by VW 2014, but due to a bug not timely reported, you can’t use it in a subroutine to return the string value. Only directly. This is my workaround (from VW 17/2012):
 +
 
 +
<code lang="pas">
 +
{ Orso ************************************************ }
 +
{ this fails on VW 2014: strings don't set! }
 +
FUNCTION D_GetVWRStr(resID, resNr: INTEGER): STRING;
 +
BEGIN
 +
GetResourceString(D_GetVWRStr, resID, resNr);
 +
{ this silently fails on later versions }
 +
 +
{$IF ver > 19}
 +
GetVWRString(D_GetVWRStr, Concat(resID), Concat(resNr));
 +
{$ENDIF}
 +
END;
 +
</code>
 +
</remark>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Revision as of 01:01, 23 August 2016

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

Description

Replaces GetResourceString -- load a string from VWR file

More information about VWR files can be found here Vectorworks VWR Resources.

PROCEDURE GetVWRString(
VAR outputString  :STRING;
resIdentifier  :STRING;
stringIdentifier  :STRING);
def vs.GetVWRString(resIdentifier, stringIdentifier):
    return outputString

Parameters

outputString STRING result value
resIdentifier STRING VWR identifier and path to vwstrings file
stringIdentifier STRING key in vwstrings file

Remarks

(Orso, 2016.08.23):

GetVWRString is supported by VW 2014, but due to a bug not timely reported, you can’t use it in a subroutine to return the string value. Only directly. This is my workaround (from VW 17/2012):

{ Orso ************************************************ }
{ this fails on VW 2014: strings don't set! }
FUNCTION D_GetVWRStr(resID, resNr: INTEGER): STRING;
BEGIN
	GetResourceString(D_GetVWRStr, resID, resNr); 
	{ this silently fails on later versions }
		
	{$IF ver > 19}
	GetVWRString(D_GetVWRStr, Concat(resID), Concat(resNr));
	{$ENDIF}
END;

Example

vwr = 'EnergyAnalysis/Strings/FormatDef_ThermalBridge.vwstrings'
formatName = vs.GetVWRString(vwr, 'FormatName' )
vs.AlrtDialog( formatName )

Version

Availability: from Vectorworks 2014
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox