pastojs: procedure val(const string; out enum; out int)

git-svn-id: trunk@40551 -
This commit is contained in:
Mattias Gaertner 2018-12-14 15:36:12 +00:00
parent f15a8b90f1
commit cea0060507

View File

@ -950,7 +950,7 @@ var rtl = {
};
},
floatToStr : function(d,w,p){
floatToStr: function(d,w,p){
// input 1-3 arguments: double, width, precision
if (arguments.length>2){
return rtl.spaceLeft(d.toFixed(p),w);
@ -975,6 +975,18 @@ var rtl = {
}
},
valEnum: function(s, enumType, setCodeFn){
s = s.toLowerCase();
for (var key in enumType){
if((typeof(key)==='string') && (key.toLowerCase()===s)){
setCodeFn(0);
return enumType[key];
}
}
setCodeFn(1);
return 0;
},
initRTTI: function(){
if (rtl.debug_rtti) rtl.debug('initRTTI');