Error Help?
-
Sometimes when I copy paste a code block into a namespace, it gives me this error. When I take it back out of the namespace the error still persists even though it worked before putting it into the namespace in the first place. I notice this happens when copy/pasting stuff around my scripts. How do I reset this? Sometimes when I just rewrite the codeblock from scratch it will work again and sometimes it just keeps giving me this pesky error message. Please advise
I've re-written the 'for loop' with and without brackets and both ways still gives me an error. I can just rewrite the whole thing but I dont want to do this everytime I copy/paste something.
In namespace, same error:
-
@Chazrox Your namespace has the same name as your variable, that will cause an issue
-
@d-healey that was it.
-
@Chazrox As a naming convention, use camel case with all words starting with an uppercase letter for namespaces, for example
MyNamespace
.For variables and functions use camel case with the first word starting with a lower case letter and the rest having uppercase, for example
myFunction
orlafComboBoxSampleMaps
.Be consistent and you'll avoid a lot of little bugs.
-
@d-healey Crucial info. Thank you!
-
@d-healey What about naming namespaces and the .js file? I always name the .js file the same as the namespace. Is that correct?
-
@Chazrox I always name the namespaces with the word Space in there, so
FilterSpace
EnvelopeSpaceetc.
-
@Lindon Ah. I like that one.
Thanks.
-
@Chazrox said in Error Help?:
Is that correct?
That's what I do.
You might want to read this document I wrote a while back - https://docs.hise.dev/scripting/scripting-in-hise/hise-script-coding-standards.html
-
@d-healey I'll read this for sure. Thank you.