PDA

View Full Version : New Programming Style? Programming Convention?



Minty23185Fresh
February 22nd, 2021, 03:59
In CoreRPG\common\scripts\combobox.lua
I notice the variables of modular (file) scope are prefaced with an underscore character, as in:


local _bReadOnly = false;
local _bActive = false;
local _tItems = {};
local _tOrderedItems = {};


Is this a new convention or style you're employing?
Have got that right, it is just a new convention? Not something more than that? Correct?

Moon Wizard
February 22nd, 2021, 08:25
My convention styles tend to shift over time. I'm trying out using _ for variables global to a script, but localized within the script scope.

Regards,
JPG

Minty23185Fresh
February 22nd, 2021, 14:15
K. Thank you.

You’ve really thrown Field Filters for All Libraries into conniptions. But what the “hey”... :)

As I have become more and more familiar with ruleset script, I’ve often wondered why FG variables of scope greater than local (function) were not tagged in some way. Years ago I used “m” (modular) as in “mbReadOnly” and the despised “g” for project global.

Thanks again for the quick reply.