common code patterns
Devin Asay
devin_asay at byu.edu
Thu Aug 10 20:53:58 EDT 2017
I’d like to see one like this for conditional structures:
if <condition> then
-- do if true
else
-- do if false
end if
I always try to use the “full” form of if-then-else. It solves lots of confusion when you end up with nested if-thens. I teach my students to do it this way as best practice, and I think it reinforces the idea of a completely formed and terminated structure.
Devin
> On Aug 10, 2017, at 6:42 PM, Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Over on the Parent of Target thread we are discussing local var access so I wonder if this is a useful common pattern:
>
> local s<Something>
>
> command set<Something> p<Something>
> put p<Something> into s<Something>
> end set<Something>
>
> function get<Something>
> return s<Something>
> end get<Something>
>
> Cheers
>
> Monte
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/
More information about the use-livecode
mailing list