<snapdata remixID="9258567"><project name='edit variables in script' app='Snap! 5.4, http://snap.berkeley.edu' version='1'>
  <notes>See inside!</notes>
  <thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAABnklEQVR4nO3Vsa3CUBAFUbqBwFRiB3abDigKCnk/QiIxhCP5nyNtfoOR9jIgdKkH8L8JkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQAD9xut7Hvez3j9AT4xbZtY13Xsa7rmKZpPJ/PetLpCPCHd4Cft23bWJalnnYKAvzhKMB5nutppyDALz5f8P1+H6/Xq550OgI8cL1ex+PxqGecngBJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEkJkJQASQmQlABJCZCUAEn9AXE1r8uAI+NYAAAAAElFTkSuQmCC</thumbnail>
  <stage inheritance='true' penlog='false' volume='100' height='360' tempo='60' lines='round' width='480' sublistIDs='false' name='Stage' threadsafe='false' codify='false' id='1' color='255,255,255,1' scheduled='false' pan='0' ternary='false' costume='0'>
    <pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAACtUlEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+Bo3+AAF/RMkcAAAAAElFTkSuQmCC</pentrails>
    <costumes>
      <list id='2' struct='atomic'/>
    </costumes>
    <sounds>
      <list id='3' struct='atomic'/>
    </sounds>
    <variables/>
    <blocks/>
    <scripts/>
    <sprites>
      <sprite x='0' pen='tip' id='8' y='0' name='Sprite' idx='1' volume='100' rotation='1' scale='1' heading='90' costume='0' color='80,80,80,1' pan='0' draggable='true'>
        <costumes>
          <list id='9' struct='atomic'/>
        </costumes>
        <sounds>
          <list id='10' struct='atomic'/>
        </sounds>
        <blocks/>
        <variables/>
        <scripts>
          <script x='20' y='20'>
            <custom-block s='does variable %s exist?'>
              <l/>
            </custom-block>
          </script>
          <script x='20' y='53'>
            <custom-block s='$globe variables %mult%txt'>
              <list>
                <l/>
              </list>
              <comment collapsed='false' w='111'>Make a global variable</comment>
            </custom-block>
          </script>
          <script x='20' y='110'>
            <custom-block s='$location variables %mult%txt'>
              <list>
                <l/>
              </list>
              <comment collapsed='false' w='103'>Make a local variable</comment>
            </custom-block>
          </script>
          <script x='20' y='167'>
            <custom-block s='set %s to %s'>
              <l/>
              <l/>
              <comment collapsed='false' w='146'>Set any variable to something</comment>
            </custom-block>
          </script>
          <script x='20' y='224'>
            <custom-block s='change %s by %n'>
              <l/>
              <l/>
              <comment collapsed='false' w='173'>Change any variable by something</comment>
            </custom-block>
          </script>
          <script x='20' y='281'>
            <custom-block s='delete $globe variables %mult%txt'>
              <list>
                <l/>
              </list>
              <comment collapsed='false' w='125'>Delete a global variable</comment>
            </custom-block>
          </script>
          <script x='20' y='338'>
            <custom-block s='delete $location variables %mult%txt'>
              <list>
                <l/>
              </list>
              <comment collapsed='false' w='118'>delete a local variable</comment>
            </custom-block>
          </script>
        </scripts>
      </sprite>
    </sprites>
  </stage>
  <hidden/>
  <headers/>
  <code/>
  <blocks>
    <block-definition s='$globe variables %&apos;names&apos;' category='variables' type='command'>
      <comment x='0' w='348.0000009999999' collapsed='false' y='0'>en: Adds new variables with the given names.de: Erstellt neue Variablen mit den gegebenen Namen.</comment>
      <header/>
      <code/>
      <translations>de:erstelle $globe Variablen _</translations>
      <inputs>
        <input type='%mult%txt'/>
      </inputs>
      <script>
        <block s='doForEach'>
          <l>each item</l>
          <block var='names'/>
          <script>
            <block s='doRun'>
              <block s='reportJSFunction'>
                <list>
                  <l>name</l>
                </list>
                <l>if ((typeof name) != "string") {    throw new Error("name isn&apos;t a string: " + name);}if (name != "") this.addVariable(name, true);</l>
              </block>
              <list>
                <block var='each item'/>
              </list>
            </block>
          </script>
        </block>
        <block s='doRun'>
          <block s='reportJSFunction'>
            <list/>
            <l>var ide = this.parentThatIsA(IDE_Morph);ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritanceide.refreshPalette();</l>
          </block>
          <list/>
        </block>
      </script>
    </block-definition>
    <block-definition s='$location variables %&apos;names&apos;' category='variables' type='command'>
      <comment x='0' w='348.0000009999999' collapsed='false' y='0'>en: Adds new sprite-local variables with the given names.de: Erstellt neue objektspezifische Variablen mit den gegebenen Namen.</comment>
      <header/>
      <code/>
      <translations>de:erstelle $location Variablen _</translations>
      <inputs>
        <input type='%mult%txt'/>
      </inputs>
      <script>
        <block s='doForEach'>
          <l>each item</l>
          <block var='names'/>
          <script>
            <block s='doRun'>
              <block s='reportJSFunction'>
                <list>
                  <l>name</l>
                </list>
                <l>if ((typeof name) != "string") {    throw new Error("name isn&apos;t a string: " + name);}if (name != "") this.addVariable(name, false);</l>
              </block>
              <list>
                <block var='each item'/>
              </list>
            </block>
          </script>
        </block>
        <block s='doRun'>
          <block s='reportJSFunction'>
            <list/>
            <l>var ide = this.parentThatIsA(IDE_Morph);ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritanceide.refreshPalette();</l>
          </block>
          <list/>
        </block>
      </script>
    </block-definition>
    <block-definition s='does variable %&apos;var&apos; exist?' category='variables' type='predicate'>
      <comment x='0' w='398' collapsed='false' y='0'>en: Checks, if a variable name exists.de: Prüft, ob ein Variablenname existiert.</comment>
      <header/>
      <code/>
      <translations>de:existiert Variable _ ?</translations>
      <inputs>
        <input type='%s'/>
      </inputs>
      <script>
        <block s='doReport'>
          <block s='evaluate'>
            <block s='reportJSFunction'>
              <list>
                <l>varname</l>
              </list>
              <l>if ((typeof varname) != "string") {    throw new Error("name isn&apos;t a string: " + varname);}return this.isVariableNameInUse(varname, true);</l>
            </block>
            <list>
              <block var='var'/>
            </list>
          </block>
        </block>
      </script>
    </block-definition>
    <block-definition s='set %&apos;variable&apos; to %&apos;something&apos;' category='variables' type='command'>
      <comment x='0' w='351' collapsed='false' y='0'>en: Sets a variable to a value.de: Setzt eine Variable auf einen Wert.</comment>
      <header/>
      <code/>
      <translations>de:setze _ auf _</translations>
      <inputs>
        <input type='%s'>
          <options>§_getVarNamesDict</options>
        </input>
        <input type='%s'/>
      </inputs>
      <script>
        <block s='doRun'>
          <block s='reifyScript'>
            <script>
              <block s='doSetVar'>
                <l/>
                <block var='something'/>
              </block>
            </script>
            <list/>
          </block>
          <list>
            <block var='variable'/>
          </list>
        </block>
      </script>
    </block-definition>
    <block-definition s='change %&apos;variable&apos; by %&apos;something&apos;' category='variables' type='command'>
      <comment x='0' w='345' collapsed='false' y='0'>en: Changes a variable&apos;s value by a nuber.de: Ändert den Wert einer Variable um eine Zahl.</comment>
      <header/>
      <code/>
      <translations>de:ändere _ um _</translations>
      <inputs>
        <input type='%s'>
          <options>§_messagesMenu</options>
        </input>
        <input type='%n'/>
      </inputs>
      <script>
        <block s='doRun'>
          <block s='reifyScript'>
            <script>
              <block s='doChangeVar'>
                <l/>
                <block var='something'/>
              </block>
            </script>
            <list/>
          </block>
          <list>
            <block var='variable'/>
          </list>
        </block>
      </script>
    </block-definition>
    <block-definition s='delete $globe variables %&apos;names&apos;' category='variables' type='command'>
      <comment x='0' w='348.0000009999999' collapsed='false' y='0'>en: Deletes variables with the given names.de: Löscht Variablen mit den entsprechenden Namen.</comment>
      <header/>
      <code/>
      <translations>de:lösche $globe Variablen _</translations>
      <inputs>
        <input type='%mult%txt'/>
      </inputs>
      <script>
        <block s='doForEach'>
          <l>each item</l>
          <block var='names'/>
          <script>
            <block s='doRun'>
              <block s='reportJSFunction'>
                <list>
                  <l>name</l>
                </list>
                <l>if ((typeof name) != "string") {    throw new Error("name isn&apos;t a string: " + name);}if (name != "") this.deleteVariable(name, true);</l>
              </block>
              <list>
                <block var='each item'/>
              </list>
            </block>
          </script>
        </block>
        <block s='doRun'>
          <block s='reportJSFunction'>
            <list/>
            <l>var ide = this.parentThatIsA(IDE_Morph);ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritanceide.refreshPalette();</l>
          </block>
          <list/>
        </block>
      </script>
    </block-definition>
    <block-definition s='delete $location variables %&apos;names&apos;' category='variables' type='command'>
      <comment x='0' w='348.0000009999999' collapsed='false' y='0'>en: Deletes sprite-local variables with the given names.de: Löscht objektspezifische Variablen mit den entsprechenden Namen.</comment>
      <header/>
      <code/>
      <translations>de:lösche $location Variablen _</translations>
      <inputs>
        <input type='%mult%txt'/>
      </inputs>
      <script>
        <block s='doForEach'>
          <l>each item</l>
          <block var='names'/>
          <script>
            <block s='doRun'>
              <block s='reportJSFunction'>
                <list>
                  <l>name</l>
                </list>
                <l>if ((typeof name) != "string") {    throw new Error("name isn&apos;t a string: " + name);}if (name != "") this.deleteVariable(name, false);</l>
              </block>
              <list>
                <block var='each item'/>
              </list>
            </block>
          </script>
        </block>
        <block s='doRun'>
          <block s='reportJSFunction'>
            <list/>
            <l>var ide = this.parentThatIsA(IDE_Morph);ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritanceide.refreshPalette();</l>
          </block>
          <list/>
        </block>
      </script>
    </block-definition>
  </blocks>
  <variables/>
</project><media name="edit variables in script" app="Snap! 5.4, http://snap.berkeley.edu" version="1"></media></snapdata>