Changes

Jump to: navigation, search

Module:String

160 bytes added, 20:39, 24 February 2013
accommodate the commonly used "no_category" function
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String]. no_category: If set to an empty string'true' or 1, no category will be added during if an error is generated.
]]
if j < 0 then
j = len + j + 1;
end
if j < i then
return str._error( 'String subset indices out of order' );
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' );
end
if j < i then
return str._error( 'String subset indices out of order' );
end
local error_category = frame.args.error_category or 'Errors reported by Module String';
local ignore_errors = frame.args.ignore_errors or false;
local no_category = frame.args.no_category or false;
if str._getBoolean(ignore_errors) then
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>';
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str;
end
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower();
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then
boolean_value = false;
else
Anonymous user

Navigation menu