@bluethunder sagte in Url wert mit slider verändern und senden:
Ich war schon am Umwandeln des Strings von Dezimal in Hex gescheitert und war auf der Suche nach einer Lösung.
Bei solchen Dingen wirst du immer auf Javascript angewiesen sein - so was kann Blockly nicht selbst. Ausser Du rechnest das alles selbst aus. Das probiere ich noch mal kurz. 😉
Na mit mal kurz war das nicht - da auch Rekursivität fehlt - aber hier mal mein Versuch, wie ich händisch eine Hexumrechnung mit Blockly machen würde.
237b729a-c36b-4419-9114-a0b8768a1d63-image.png
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="S?S[URR$o2Pih#LBFC@0">x</variable>
<variable id="jFFnZozX[(ir)GNBvX[%">Hex-Ziffern</variable>
<variable id="?48$UX./h6LW}Amgg@HK">Ergebnis</variable>
<variable id="s9a{fMN;kH$fP[TU/~Y2">i</variable>
</variables>
<block type="debug" id="C}Vc+uyd_/0fSl**Vy9U" x="-962" y="-588">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="jx5^rB[c0#Ud5yt$$M3c">
<field name="TEXT">test</field>
</shadow>
<block type="text_join" id="f._#4pw:b;/{marP2Ew4">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="PUAN;P8$u8qw_|JV;C@7">
<field name="TEXT">Ergebnis: </field>
</block>
</value>
<value name="ADD1">
<block type="procedures_callreturn" id="3G)nyj~Gl,Lle/4)`NAh">
<mutation name="Hex">
<arg name="x"></arg>
</mutation>
<value name="ARG0">
<block type="math_number" id="+I#+SS[apySnV=wQ;ZqL">
<field name="NUM">100</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
<block type="procedures_defreturn" id=":3ac[6j_$uB5MK{B^|*a" x="-963" y="-462">
<mutation>
<arg name="x" varid="S?S[URR$o2Pih#LBFC@0"></arg>
</mutation>
<field name="NAME">Hex</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="variables_set" id="ZPT{8pX*=IX{;q=cb/R6">
<field name="VAR" id="jFFnZozX[(ir)GNBvX[%">Hex-Ziffern</field>
<value name="VALUE">
<block type="lists_split" id="tRFub`%_c/a[lP3)*KaP">
<mutation mode="SPLIT"></mutation>
<field name="MODE">SPLIT</field>
<value name="INPUT">
<block type="text" id="AZO0MiLEO#y!P8z5HbGr">
<field name="TEXT">0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F</field>
</block>
</value>
<value name="DELIM">
<shadow type="text" id="MmnmwemAP2%85B}M-7|l">
<field name="TEXT">,</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="*9uYqqil*GBF[hb)lq?O">
<field name="VAR" id="?48$UX./h6LW}Amgg@HK">Ergebnis</field>
<value name="VALUE">
<block type="text" id="2ar@u@-)w{?PZT})Wy}/">
<field name="TEXT"></field>
</block>
</value>
<next>
<block type="variables_set" id="bO@-n(oMPb_ruyxbcD*l">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
<value name="VALUE">
<block type="math_number" id="59pOoNt=iRasib4s2IH:">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="controls_whileUntil" id="d5XQN2$58i`D|OBzvEQg">
<field name="MODE">WHILE</field>
<value name="BOOL">
<block type="logic_compare" id="o2sTKa7p4[fLbw7H_s8l">
<field name="OP">GT</field>
<value name="A">
<block type="math_round" id="vg*z:?nt*a:*,5]5H[7O">
<field name="OP">ROUNDDOWN</field>
<value name="NUM">
<shadow type="math_number" id="rwd+y-.%XmFULo9q-@tg">
<field name="NUM">3.1</field>
</shadow>
<block type="math_arithmetic" id="sWWaGV^o=Tzmv)yj;%+C">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="io_sQp_l=dYCZ:y_)+8U">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id=":c;J8SLp5mdrWU_PEF5X">
<field name="VAR" id="S?S[URR$o2Pih#LBFC@0">x</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="m/}~b7dOYWYmXv25rPE+">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="-%XF-]!%HD%$03L^4CHi">
<field name="OP">POWER</field>
<value name="A">
<shadow type="math_number" id="P{YU6^E9mCugz)xzxvB9">
<field name="NUM">16</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="if6$o#wNf2dCnk@O?D_c">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="q?||;j.yP(VIgQ|d(|Mc">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="%5QLs_j17E5!QQtO[R]b">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO">
<block type="math_change" id="{h2HYXd*Udsn+z9IK7)i">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
<value name="DELTA">
<shadow type="math_number" id="wn)j/e,/K8Q2IVReSWN@">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="controls_whileUntil" id="335gg]Z%k,(:An!uACsf">
<field name="MODE">WHILE</field>
<value name="BOOL">
<block type="logic_compare" id="iEmIfirr(VvL5JMe{IMe">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="`6uxK[t#}!q3(.ptUvnU">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
</block>
</value>
<value name="B">
<block type="math_number" id="Hi@+4(Gg?buk[,z-lxEE">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<statement name="DO">
<block type="math_change" id="-Ar?+%N=6@AK[]Jd-Ai3">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
<value name="DELTA">
<shadow type="math_number" id="Aix|q%@Lm]A5q#V?guMD">
<field name="NUM">-1</field>
</shadow>
</value>
<next>
<block type="variables_set" id="[Okpq*X/RX0J?GgYlu%a">
<field name="VAR" id="?48$UX./h6LW}Amgg@HK">Ergebnis</field>
<value name="VALUE">
<block type="text_join" id="*R}[1a)mf$#v882tq|oD">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="variables_get" id="OaP~jX}h3?hy%]cF%6]Z">
<field name="VAR" id="?48$UX./h6LW}Amgg@HK">Ergebnis</field>
</block>
</value>
<value name="ADD1">
<block type="lists_getIndex" id=")7!KJMc[So4e)9E+izpN">
<mutation statement="false" at="true"></mutation>
<field name="MODE">GET</field>
<field name="WHERE">FROM_START</field>
<value name="VALUE">
<block type="variables_get" id="/@oOrD?.*,^CJRc|ON/p">
<field name="VAR" id="jFFnZozX[(ir)GNBvX[%">Hex-Ziffern</field>
</block>
</value>
<value name="AT">
<block type="math_arithmetic" id="TsM}6Z^sY/,fNshFn;Lb">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="q;tQp0J}D~TZtR@Y]mc,">
<field name="NUM">1</field>
</shadow>
<block type="math_round" id="4K#-rB/pX.)Z%90)FB[2">
<field name="OP">ROUNDDOWN</field>
<value name="NUM">
<shadow type="math_number" id="#9W$CvQo-jw[uU$,C,Zu">
<field name="NUM">3.1</field>
</shadow>
<block type="math_arithmetic" id="a#Zu=0e%UF[Kz!jh:[zV">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="TTt|.lJ[(U[z7WhAfzR3">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="Fdn.O_C]FsjZE;znV`gl">
<field name="VAR" id="S?S[URR$o2Pih#LBFC@0">x</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="_jyJ5t1L?}i7c(/Rg7n-">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="yHpjw+)g*mt`2LX@)HzV">
<field name="OP">POWER</field>
<value name="A">
<shadow type="math_number" id=":t%DT=BRKmA}_qQI~U)z">
<field name="NUM">16</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="CB9r7@[;5#}nz/Q=1HTI">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="B4/L%=KhgSL|vsK(=a:|">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="lEE]|e$6q.y8g[11[G32">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="|L/U`]FIkd;*6u1%X:Ci">
<field name="VAR" id="S?S[URR$o2Pih#LBFC@0">x</field>
<value name="VALUE">
<block type="math_modulo" id="$tT-;0{EYt=@h+TYVbn(">
<value name="DIVIDEND">
<shadow type="math_number" id="L/Ew(F9Fkgx;!TWgNhzJ">
<field name="NUM">64</field>
</shadow>
<block type="variables_get" id="%0MSFxjT)h27Y2Dyw{!~">
<field name="VAR" id="S?S[URR$o2Pih#LBFC@0">x</field>
</block>
</value>
<value name="DIVISOR">
<shadow type="math_number" id="8oh-FV+-LpfZ6y,MF2!@">
<field name="NUM">10</field>
</shadow>
<block type="math_arithmetic" id="^f#s//a{olil8VYQ5!}B">
<field name="OP">POWER</field>
<value name="A">
<shadow type="math_number" id="aU^{:H4N1`SV|rlp`LL/">
<field name="NUM">16</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="F?4OmoYckuBvs0}eZm^:">
<field name="VAR" id="s9a{fMN;kH$fP[TU/~Y2">i</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="RETURN">
<block type="variables_get" id="tQt9a~_:J(y+ct%!]EN(">
<field name="VAR" id="?48$UX./h6LW}Amgg@HK">Ergebnis</field>
</block>
</value>
</block>
</xml>
Ich finde da Javascript Code fast noch übersichtlicher. 😉 - Aber wahrscheinlich kann ein Blockly-Fan das viel schöner machen. Ich mach ja im Prinzip mit Blockly selber nichts.