![]() |
|
Better parameters mismatch function (solved) - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://forum.boriel.com/forumdisplay.php?fid=15) +---- Thread: Better parameters mismatch function (solved) (/showthread.php?tid=2582) |
Better parameters mismatch function (solved) - baltasarq - 2024-12-13 I was compiling my program when the compiler claimed (correctly) that there was an error in my code: Code: util.bas:105: error: Function 'FormatStr' takes 3 parameters, not 1It also messes with the line number, which corresponds to where the error happened, not where the function was defined. In my case, the error happened at line number 105 of player.bas, calling function FormatStr() defined in line number 39 of util.bas. I think it would be better to expose both pieces of information, maybe this way: Code: player.bas: 105: error: Function 'FormatStr' takes 3 parameters, not 1RE: Better parameters mismatch function - boriel - 2024-12-14 Can you post a minimal example to reproduce this error? Otherwise, contact me privately and send me the source code so I can reproduce the error and fix it.
RE: Better parameters mismatch function - baltasarq - 2024-12-14 Sure, say you have two files: params_error.bas Code: sub foo(a as ubyte, b as ubyte)params_error2.bas Code: #include "params_error.bas"You compile, and the output is: Code: params_error.bas:3: error: Function 'foo' takes 2 parameters, not 1While I think it should be, or at least ir would be more infomative being: Code: params_error2.bas:2: error: Function 'foo' takes 2 parameters, not 1RE: Better parameters mismatch function - boriel - 2024-12-20 Please try this new version and let me know if it works correctly now :-) http://www.boriel.com/files/zxb/zxbasic-v1.18.0-beta6.tar.gz http://www.boriel.com/files/zxb/zxbasic-v1.18.0-beta6.zip http://www.boriel.com/files/zxb/zxbasic-v1.18.0-beta6-win32.zip http://www.boriel.com/files/zxb/zxbasic-v1.18.0-beta6-linux64.tar.gz http://www.boriel.com/files/zxb/zxbasic-v1.18.0-beta6-macos.tar.gz RE: Better parameters mismatch function - baltasarq - 2024-12-20 Working correctly, thanks!! |