<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set variable as read-only via macro or in script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072563#M941084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this adjusted example from APIGuide.qvw for read only:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("Variable1")&lt;/P&gt;&lt;P&gt;prop = v.GetProperties&lt;/P&gt;&lt;P&gt;prop.ConstraintsFlag = 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'read only&lt;/P&gt;&lt;P&gt;v.SetProperties prop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this here is an example how to loop through the variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vars = ActiveDocument.GetVariableDescriptions&lt;/P&gt;&lt;P&gt;for i = 0 to vars.Count - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = vars.Item(i) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(v.IsConfig)&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jan 2016 12:01:13 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-01-26T12:01:13Z</dc:date>
    <item>
      <title>How to set variable as read-only via macro or in script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072562#M941083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to mark a variable as read-only, either via macro or in script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have about 10'000 variables in Document properties -&amp;gt; Variables, and do not like to scroll throuth all of them to set the attribute manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See as well &lt;A _jive_internal="true" href="https://community.qlik.com/thread/24463"&gt;https://community.qlik.com/thread/24463&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx - Marcel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 11:36:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072562#M941083</guid>
      <dc:creator>hugmarcel</dc:creator>
      <dc:date>2016-01-26T11:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set variable as read-only via macro or in script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072563#M941084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this adjusted example from APIGuide.qvw for read only:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("Variable1")&lt;/P&gt;&lt;P&gt;prop = v.GetProperties&lt;/P&gt;&lt;P&gt;prop.ConstraintsFlag = 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'read only&lt;/P&gt;&lt;P&gt;v.SetProperties prop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this here is an example how to loop through the variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vars = ActiveDocument.GetVariableDescriptions&lt;/P&gt;&lt;P&gt;for i = 0 to vars.Count - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = vars.Item(i) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(v.IsConfig)&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 12:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072563#M941084</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-01-26T12:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to set variable as read-only via macro or in script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072564#M941085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;alternatively add this to your macro code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;set macroVariable = ActiveDocument.GetVariable("yourVariableName")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;then use marcroVariable.GetContent.String to retrieve the variable's contents&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HTH,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hirish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 12:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072564#M941085</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2016-01-26T12:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to set variable as read-only via macro or in script?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072565#M941086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 12:26:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-set-variable-as-read-only-via-macro-or-in-script/m-p/1072565#M941086</guid>
      <dc:creator>hugmarcel</dc:creator>
      <dc:date>2016-01-26T12:26:22Z</dc:date>
    </item>
  </channel>
</rss>

