#% text_encoding = iso8859_1 # Copyright (C) Field Consulting and Services, Inc. 2020, all rights reserved. ######################################################################## ## ## Created By: Mark Field (FCSI) ## Date: 2020/09/28 ## Last Modified Time-stamp: <09/28/2020 10:40, Mark Field (FCSI)> ## ## Project Files ## ## Description: ## ######################################################################## _package user $ _global !fcsi_error_on_no_environment?! << _false $ _package sw $ user:fcsi_method_manip.fcsi_copy_method(text_input_mixin,:get_magnitude|()|) user:fcsi_method_manip.fcsi_copy_method(system,:getenv|()|) $ _pragma(classify_level=restricted) _private _method text_input_mixin.get_magnitude(radix) ## Returns an integer value derived from following decimal ## digits. _local eofp << _proc() _return _unset _endproc _local c << _self.get_at_eof(eofp) _if c _is _unset _then _return _unset _endif _if c _isnt %% _then _self.unget(c) # let core handle normal _return _self.sw!get_magnitude(radix) _endif _local envStr << "" + c _loop _if (c << _self.get_at_eof(eofp)) _is _unset _then _leave _endif envStr +<< c _if c _is %% _then _leave _endif _endloop _dynamic user:!fcsi_error_on_no_environment?! << _true _local str << envStr.substitute_environment_variables(_false) _local int << str.as_radix_integer(radix,_true) _local numDigs << _if int _isnt _unset _then >> int.write_string.size _else >> 0 _endif _return int,numDigs _endmethod $ _pragma(classify_level=advanced) _method system.getenv(name) ## FCSI Mods : if result from core is unset, and if dynamic ## user:!fcsi_error_on_no_environment?! is true, than raise ## :environment_variable_not_set error #---------------- HISTORY --------------------- # (2020/09/28 - Mark Field (FCSI)): Modified #---------------------------------------------- _local res << _self.sw!getenv(name) _dynamic user:!fcsi_error_on_no_environment?! _if res _is _unset _andif user:!fcsi_error_on_no_environment?! _is _true _then condition.raise(:environment_variable_not_set,:name,name) _endif _return res _endmethod $