Jump to content
C4 Forums | Control4

Code reuse

Recommended Posts

Maybe I am dense or missed this - but is there a way to reuse code? Meaning, say I copy/paste a huge chuck of code to a new button on a keypad. If I want to change an IF I have to delete that IF, dig for the object, recreate the conditional etc. Is there no way to simply change "Variables = X" via simply typing in the number? Or maybe I want copy/paste a bunch of code and everywhere is says to "close" shades I want to "open" shades without have to drag every new command. Is this not a thing anywhere?

Link to comment
Share on other sites

you can't edit parts of a single line of code, so yes you have to go digging for that object to drag the new command in.  When it comes to copy and paste you can copy/paste either a selected command or the entire page.  Note that if you copy a selected if statement it will copy all commands nested in that if statement.  Hope that answers your questions.  

Link to comment
Share on other sites

Yeah, C4 WYSIWYG is a real PITA if you are a real programmer.   ;)

Could do some awesome stuff if it supported dynamic variables and arrays.  

But after you get used to it there are some workarounds.  And it’s certainly better than trying the When/If web based mess.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...