permanently displayed text
-
Engine.loadFromJSON("../Name.txt");
This function gets the data for you to put into a variable, but you haven't provided the variable. Then once you have the data you need to display it. HISE doesn't know that you want to show it in a label, it just knows to get the data from the file.
You can see in the doc here that the function has a return type.
So you'll want something like this:
const d = Engine.loadFromJSON("Name.json"); if (isDefined(d) && isDefined(d.name)) Input.set("text", d.name);
Also json files should have a .json extension rather than .txt.
You should probably include this at the top of your button's callback to stop everything happening twice:
if (value) return;
-
I really don't get I think I'm overthinking it
I've pasted this in nowHiseSnippet 1110.3ocsVEtaaaCDlJNZaVKcXEXO.B9GE1.YtRtw0dqXapw1YvaMNFycAc+pkVhxlKRjFRTo0qn.6QYOJ6QZuAaGEksnZbJBLV4OLLu69n9ti79Hmlv8Ioo7DjQ8mudEAYbj4r0LwxAKwTFZ7PjwmXJHoBzoqWgSSIAHCiZ+nzmQ8CQ4i+4GNEGgY9jRSHzkbpO4YzXpnz5TuelFEcFNf7bZrVzm3M1myFvi3Y.OpY5fVg8uBufLAKC6.SfDiBnBdxLAFHCx3vS4Aqmsj+ZlJ9Kooz4QD4DWzLXgTlOiGEHYrzJZvRZTvzM4aJBVkokYeMU1+UlmSCnasWVE9xbG1kHzqGFGTkd0pPOWc54nQucPICMJcnhR22bleBcknzijOet4XlfjDhgxtNUTwhN3g0LGvgHXh1w3qHmk.S1hnYWGmis6z0o0SrrrgAT9SE1WiSrkkb6uydC1EDw.d7JNClzrgzYC.SUHiYqxD2Jlbua.k+CkEQYD6vLlufxY1b1rr4vAkSyDB4w.lHgG0zeyRbL7QhxHsxw9Vq5zP6lEVpWudBQjkvfzntcwHh6iifOhhT4edIktTBoIvisAJyl1oDfiBxaDMNVgQOB0REfEXXkJMuY71aZRNZz3aUK0Mc+NXwKsNhs.JDsCxhW8zzeZ1ESZJ+TG2nc6GlyseOkyfJGT1rJ.as6Zrd8qQKYNUTEGfihlC8RM2YMVt6q1FCf7qfMQbb.bZINmOMz4gkkrzSSGRBg.CZFzx9AOvVadaFDcKXaQUz0KsE9dh1l9DtfbAqYKKnLZ8NK622UX3N8Uv8HRxNcKUVR9P.axxhmSR1dppHPncqZOr4s2CqKw3q1PzBjyFynhKVQX2lvCpXWD92uNdHrkKa7KrAwshjHnRJXLjbMnhpjApaNjjdkfuBV0sa8fNfH268JDIdFdNIBQCjx14pmuYqL6eF5stTych2RBcwRM049dulFHVt0veO2iJHwJY4NprUtalKHGBrcF8OzDwa3Qf5GdqL27EaDzOx7jN8569MNN8kZd2At+ol4mfzHu2qzHu2u4skHU4rGeGoUUlzumSuNtOpadtrSJVl0HCKS2G2qG.nKpRwnxJomSGoxounHmT8a4IEXRqETK29q.sbyNzildNOFVLbxZ0InT70jwroIDniRUbeur9U2Hq+du6RVT2z00s+I8cqTLzh911Du4sTv8i7frHrn5klxWJT3.5BqbSk71HVJUrV+kD+ucS5ckh22bJU3ub2b7fcvQnW8iAGKd+w8LGEFR7EkD7PyydwGmGaf9EdlfxVbNVjPgiilSxhmAa19D3qyXjHoJnwAR8J0bG4bYEXFgEjO4egQgSW4biBmtabhhw9I7W5qzdkuv4yxs.bhk+3t5lmKma6hx0iAblNscPwvisdouuL8+ZPBc2X5rGXdzdf4j8.S28.yi2CL81CL8+fXjuy8oYBdrpc.LLcT9kTFFiXR887Sgn+iT+rCi
-
@treynterrio You're almost there.
You need to give your data a name:
local data = {"": input};
""
Isn't any good. You can see when I load the file I'm checking to see ifd.name
exists (so that means I'm using:local data = {"name": input};
Here, why do you have
../
?Engine.dumpAsJSON(data,"../Name.json");
When I'm loading the file I don't have that
const d = Engine.loadFromJSON("Name.json");
These need to match so that you are reading and writing the same file.
-
@d-healey no matter what I do, one error after another occurs, I can no longer compile, then I can no longer change the text in the created file, then it no longer creates a file
-
@treynterrio said in permanently displayed text:
one error after another occurs
The error message will nearly always point you to the cause of the problem.
The real struggles you'll have are when you have a problem but no error message!
-
@d-healey that's what I mean with I can't compile there is no error and nothing works anymore
-
@treynterrio What happens when you press the compile button?
-
@d-healey nothing happens and nothing work anymore
-
@treynterrio what do you expect to happen when you press compile? What do you mean 'nothing' works?
-
This post is deleted! -
@d-healey When I click compile, Compile Ok doesn't even appear in the console anymore
-
@treynterrio can anyone please just solve this for me? I still don't know what I'm missing or what I'm doing wrong
HiseSnippet 1097.3ocsVEtiZbCD1KbaagdopQJO.q3GQfzUztji.MUscyAbUzliCURO09qDytdA2aWaztduDZTj5iReT5iTeCZGau.dS3hNgZ1efvdlO6uuY7L1SS4AjrLdJxp1yWuhfrN1d1ZlX4fkXJCMdHx5SrEjLA5r0qvYYjPjkU0ePZyp1QH02+78mgiwr.xtoPnq3z.xynITwtYm5+Sz33ywgjmSSL79T+wAb1.dLOG3QUaWzJbv03EjIXoaUrARLJjJ3oyDXfLHqiNiGtd1R9qXZ+uhlQmGSjC7PyfERO8473PIikyhFrjFGNcidyPvpLcm5qpU+CrufFR2N+tnvWpL3rCgY7vpRY5UsD87LomqA81CkrLnzQZJce6YAozUhcVj74ysGyDjzHLD1Moh1WTETU6AbvClncB9Zx4ovfsHZ1008DmNcca8M0q6.eP3OS3bCN0QFxc9VmMXWPDC3Iq3LXPyFRiM.LkgLlsJWbqXTV2.R8CkESYDmnbVffxYNb1r74vAkyxEB4w.lHkG2LXyRbBrIw4jVJruodMZjSyhYpUqVJQjmx.YTyo3KlGfigMQSJ01KozURHMAdr0QoZZmQ.NJHuVz3DMFSOzKUHVfgU5MZ4+Dsau0vsc+aDaAHs1g4IqdZ1ON6xIMkfOQgr8umwYPf.7WIEXEpu+PlY3nQKIEKBJCvwwygRil6MjISl5rRHP2BpDywgPxOQQlR7ndcYjjlMjDANF1LrkyCeniw31RuaAQYcLzLRUXChAFYwIbA4RVyV0gjT82V24cMEEsWaErOljtWyxVEoeHfMY4IyIoaOlT3HT+Ttnz91KJM6YDnSIFNxYiYTwkqHraqSBpHOB+6WFODx3xJ4h4.+VQRETIErFRtAZKpqqqYOjjcsfuBV0sIenvVnrduhp9mgmShQzPYeXU6vWusu4eF4udWSzI9KIzEKMZ212+UzPwxsS72y8oBRhtOaGsZk4SUG1Hfsyn+gQW4F9DH9g212Z9hMcnO19zN85680tt8kMwtCb+SsUmgLHu+KMHu+u4ukHk4rOeOxpLS52ysWGuG0Uok8RwcpFYU216w85A.5hJELJsRlZ5Xsl9hBMoq3ThBlxnHzPa+Ung1bh7oYWvSfECmtVeBJCeCYLaZJApozA22Q0u78T824eWTQMaOOu9m12qTvvv6aKI99W6.W3wCyiwhx2BJu5uv.TEV5pG40KrLpXs4SC9e6pw6JEuu8TpHX494Xk8vQnV8iAGKdPw8rGEEQBD6H3Q1m+qebd8.5m44BJawEXQJENNZOIOYFjrCHvtyXjXYWPqJx9U5wtxwxHvLBKTM3eguBidxwVEF81XDkfCR4uHP26U9jkOSMCvIl50Z0ruPN1wCo5GC3rca6hRfWO8hf.o7+JnE59wz4.v7nC.yoG.ltG.lGe.X5c.X5+AwHe35SyE7Dc4.LwzQpKorrFwj82UmBQ+GXAl1zF
-
@treynterrio Your snippet works here
-
@d-healey I've export it and tested it but now the text stays in the wrong label it should be in the black one above because the label where you type something will disappear
-
@treynterrio I'm only seeing what you post, is that the code you're testing? If so then you need to change it to set the text to show where you want it to.
-
@d-healey its still the same issue when I hit compile nothing changes the console don't say Compile OK I can change in the script Name to Input or Input to Name its everything the same there must be something inside that must be changed but I don't know what
-
@treynterrio said in permanently displayed text:
console don't say Compile OK
Sometimes it doesn't show but it will show above the Console
Are you using the same snippet you posted above to test?
-
@d-healey yes its the same
-
@treynterrio Can you show me a video of it not working for you?
-
@d-healey It works now in the snippet, but it doesn't work in my project. the file is created but the file will not be loaded