1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-20 04:24:45 +00:00

Added keywords: _Strcmp, _Stricmp

This commit is contained in:
William Barnes 2022-06-15 14:31:57 -04:00
parent 68ae74e5ee
commit 181d7ac281
4 changed files with 15 additions and 1 deletions

View file

@ -39,7 +39,7 @@ CodeMirror.defineMode("qbjs", function(conf, parserConf) {
'_display', '_fontwidth', '_freeimage', '_fullscreen', '_g2d', '_g2r', '_green', '_green32', '_height', '_hypot', '_instrrev', '_limit', '_keyclear', '_keydown', '_display', '_fontwidth', '_freeimage', '_fullscreen', '_g2d', '_g2r', '_green', '_green32', '_height', '_hypot', '_instrrev', '_limit', '_keyclear', '_keydown',
'_keyhit', '_loadimage', '_mousebutton', '_mouseinput', '_mousex', '_mousey', '_newimage', '_pi', '_printstring', '_printwidth', '_keyhit', '_loadimage', '_mousebutton', '_mouseinput', '_mousex', '_mousey', '_newimage', '_pi', '_printstring', '_printwidth',
'_putimage', '_r2d', '_r2g', '_red', '_red32', '_resize', '_resizewidth', '_resizeheight', '_rgb', '_rgba', '_rgb32', '_rgba32', '_round', '_putimage', '_r2d', '_r2g', '_red', '_red32', '_resize', '_resizewidth', '_resizeheight', '_rgb', '_rgba', '_rgb32', '_rgba32', '_round',
'_screenexists', '_sech', '_shl', '_shr', '_sinh', '_source', '_sndclose', '_sndopen', '_sndplay', '_sndloop', '_sndpause', '_sndstop', '_sndvol', '_tanh', '_screenexists', '_sech', '_shl', '_shr', '_sinh', '_source', '_sndclose', '_sndopen', '_sndplay', '_sndloop', '_sndpause', '_sndstop', '_sndvol', '_strcmp', '_stricmp', '_tanh',
'_title', '_trim', '_width', 'abs', 'asc', 'atn', 'beep', 'chr', 'circle', 'cls', 'color', 'command', 'cos', 'cvi', 'cvl', 'data', 'draw', 'exp', '_title', '_trim', '_width', 'abs', 'asc', 'atn', 'beep', 'chr', 'circle', 'cls', 'color', 'command', 'cos', 'cvi', 'cvl', 'data', 'draw', 'exp',
'fix', 'hex', 'input', 'inkey', 'instr', 'int', 'lbound', 'left', 'lcase', 'len', 'line', 'locate', 'log', 'ltrim', 'mid', 'mki', 'mkl', 'fix', 'hex', 'input', 'inkey', 'instr', 'int', 'lbound', 'left', 'lcase', 'len', 'line', 'locate', 'log', 'ltrim', 'mid', 'mki', 'mkl',
'oct', 'paint', 'point', 'preset', 'print', 'pset', 'right', 'rtrim', 'randomize', 'read', 'restore', 'rnd', 'screen', 'shared', 'sgn', 'sin', 'sleep', 'space', 'sqr', 'oct', 'paint', 'point', 'preset', 'print', 'pset', 'right', 'rtrim', 'randomize', 'read', 'restore', 'rnd', 'screen', 'shared', 'sgn', 'sin', 'sleep', 'space', 'sqr',

10
qb.js
View file

@ -660,6 +660,16 @@ var QB = new function() {
GX.soundVolumne(sid, v); GX.soundVolumne(sid, v);
}; };
this.func__Strcmp = function(x, y) {
return ( ( x == y ) ? 0 : ( ( x > y ) ? 1 : -1 ) );
};
this.func__Stricmp = function(x, y) {
var a = x.toLowerCase();
var b = y.toLowerCase();
return ( ( a == b ) ? 0 : ( ( a > b ) ? 1 : -1 ) );
};
this.func__Tanh = function(x) { this.func__Tanh = function(x) {
return Math.tanh(x); return Math.tanh(x);
}; };

View file

@ -2832,6 +2832,8 @@ if (QB.halted()) { return; }
await sub_AddQBMethod( "SUB", "_SndPause", False); await sub_AddQBMethod( "SUB", "_SndPause", False);
await sub_AddQBMethod( "SUB", "_SndStop", False); await sub_AddQBMethod( "SUB", "_SndStop", False);
await sub_AddQBMethod( "SUB", "_SndVol", False); await sub_AddQBMethod( "SUB", "_SndVol", False);
await sub_AddQBMethod( "FUNCTION", "_Strcmp", False);
await sub_AddQBMethod( "FUNCTION", "_Stricmp", False);
await sub_AddQBMethod( "FUNCTION", "_Tanh", False); await sub_AddQBMethod( "FUNCTION", "_Tanh", False);
await sub_AddQBMethod( "SUB", "_Title", False); await sub_AddQBMethod( "SUB", "_Title", False);
await sub_AddQBMethod( "FUNCTION", "_Trim", False); await sub_AddQBMethod( "FUNCTION", "_Trim", False);

View file

@ -3020,6 +3020,8 @@ Sub InitQBMethods
AddQBMethod "SUB", "_SndPause", False AddQBMethod "SUB", "_SndPause", False
AddQBMethod "SUB", "_SndStop", False AddQBMethod "SUB", "_SndStop", False
AddQBMethod "SUB", "_SndVol", False AddQBMethod "SUB", "_SndVol", False
AddQBMethod "FUNCTION", "_Strcmp", False
AddQBMethod "FUNCTION", "_Stricmp", False
AddQBMethod "FUNCTION", "_Tanh", False AddQBMethod "FUNCTION", "_Tanh", False
AddQBMethod "SUB", "_Title", False AddQBMethod "SUB", "_Title", False
AddQBMethod "FUNCTION", "_Trim", False AddQBMethod "FUNCTION", "_Trim", False