Ask a Jedi: Getting your scope on

Justin asks…

I am a programmer coming from a background of php and ruby on rails and I need to find a place to get some info on scopes. I have heard a lot mentioned about the different scopes while at cfunited this year, but I don't really know what the basic scopes are or what is appropriate in them. Any good resources for learning about this kind of thing?

First off, welcome to a real programming language. (Kidding!) While I haven’t used Ruby, I’ve used PHP a bit, and while I definitely prefer ColdFusion, PHP is probably what I would use if I didn’t have access to CF. Anyway, your best bet for such problems is always the documentation. You can read the docs online for CF7 at livedocs.macromedia.com. For your specific question, check this resource:

Scope types

This is a nice table that covers just about everything you need to know.

ColdFusion lets address scopes without fully qualifying them. I don’t believe the order of look up is in the docs, but Yacoblog has a nice page describing the order here:

ColdFusion Scopes
Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments