<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE passolo_macrotemplate SYSTEM "macrotemplate.dtd">
<passolo_macrotemplate>
<header>
	<name xml:lang="en">Operation on string list</name>
	<name xml:lang="zh">字串列表操作</name>

	<info xml:lang="en">Does some operation on the active or all string lists.</info>
	<info xml:lang="zh">对活动的字串列表或者所有列表进行某些操作。</info>

	<parameter id="ACTIVE" type="bool">
		<prompt xml:lang="en">Active list only</prompt>
		<prompt xml:lang="zh">仅活动列表</prompt>
		<parinfo xml:lang="en">Only the active text list is handled.</parinfo>
		<parinfo xml:lang="zh">仅处理活动的字串列表。</parinfo>
		<value>1</value>
	</parameter>

	<string id="MESSAGE1">
		<text xml:lang="en">No active string list found.</text>
		<text xml:lang="zh">No active string list found.</text>
	</string>

	<string id="MESSAGE2">
		<text xml:lang="en">No active project found.</text>
		<text xml:lang="zh">No active project found.</text>
	</string>

	<string id="COMMENT1">
		<text xml:lang="en">Do something with src...</text>
		<text xml:lang="zh">Do something with src...</text>
	</string>

	<string id="COMMENT2">
		<text xml:lang="en">Do something with trn...</text>
		<text xml:lang="zh">Do something with trn...</text>
	</string>


</header>

<code ext="bas">
<![CDATA[
Sub Main
	Dim src As PslSourceList
	Set src = PSL.ActiveSourceList

	Dim trn As PslTransList
	Set trn = PSL.ActiveTransList

@if %ACTIVE%
	If Not src Is Nothing Then

		' %COMMENT1%

	ElseIf Not trn Is Nothing Then

		' %COMMENT2%

	Else
		PSL.Output "%MESSAGE1%"
		Exit Sub
	End If

@else

	Dim prj As PslProject
	Set prj = PSL.ActiveProject
	If prj Is Nothing Then
		PSL.Output "%MESSAGE2%"
	End If
	For Each src In prj.SourceLists

		' %COMMENT1%

	Next src
	For Each trn In prj.TransLists

		' %COMMENT2%

	Next trn
@endif
End Sub
]]>
</code>

</passolo_macrotemplate>