Skip to content

88. Quick editing tip

July 4, 2013

Suppose you have a function, and you think of a different approach that might be better, but you need to test it. You don’t want to mess up the function you have, so you first create a copy with a different name, to keep it safe, and then mess with the code.

There’s a neater way to do this, if you do it a lot.

Create an extra tab on the right called (say) “Test”. Make a copy of your function in there (keep the name the same). Mess with the code. Run it. When Codea compiles your code (from left to right), it will compile both copies of the function, but the Test copy will overwrite the original function because its tab is to the right and gets compiled later, so it will be used instead.

This enables you simply to copy any function into your Test tab and play with it, then delete it when you’re done, keeping your original code very clean.

Advertisement

From → Programming

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: