mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 13:59:29 +02:00
pastojs: procedure val(const string; out enum; out int)
git-svn-id: trunk@40551 -
This commit is contained in:
parent
f15a8b90f1
commit
cea0060507
14
utils/pas2js/dist/rtl.js
vendored
14
utils/pas2js/dist/rtl.js
vendored
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user