DRX command stack issue

It seems that the command stack does not differentiate between a lisp function and a command function. I.e in the following example both "NETLOAD" and "C:NETLOAD" call the same function. This used to work in SDS, is this a design change?static func_def func_table[] = { {_T("NETLOAD") , Netload}, {_T("C:NETLOAD") , CmdNetload}, {_T("Reload") , ReloadCommands}, {_T("C:Reload") , CmdReloadCommands}};Thanks

Comments

  • Hello, Daniel,I asusme you use both sds_defun() and sds_regfunc() to register the functions and commands ?Can you give a few more details ?1. When entering NETLOAD at command line, the real C: command code is called ?2. when using (netload), which code is started then ?I will try to reproduce the problem here, but some help is always appreciated.Many greetingsand a nice dayTorsten

  • Hi Torsten,Ah maybe that’s my problem, I was only using sds_defun () I will play around with using sds_regfunc. In this code _T("NETLOAD") was not found

    static func_def func_table[] = { {_T("C:version") , cmdVersion}, {_T("C:test") , cmdTest}, {_T("NETLOAD") , lspNetload}, {_T("C:NETLOAD") , cmdCNetload}, {_T("Reload_") , lspReloadCommands}, {_T("C:Reload") , cmdReloadCommands}};int funcload(){ for (int i = 0; i < ARRAYELEMENTS(func_table); i++) { if (!sds_defun(func_table[i].func_name, i)) return RTERROR; } return RTNORM;}void funcunload(){ for (int i = 0; i < ARRAYELEMENTS(func_table); i++) { ads_undef(func_table[i].func_name, i); }}int dofun(){ int val, rc; val = sds_getfuncode(); if (val < 0 || ARRAYELEMENTS(func_table) <= val) { sds_fail(_T( "Failed" )); return RTERROR; } rc = (*func_table[val].func)(); return rc;}</code>

    Thanks for all your helpDaniel

  • Hello, Daniel,even if you only use sds_defun(), all those defined functions and commands should be found and should be functional :-)Using sds_regfunc() is only an option - to omit sds_dofun() loop.I'm just starting with investigations here - and I will use your code as example ... I was busy with the CLR + managed code problem :-)I will come back soon here.Many greetingsTorsten

  • Hello, Daniel,meanwhile, I figured out why the functions were called instead of the C: commands, when entering the command name at command line ...There was a bug in command recognition, when a same-named function and command (like "NET" and "C:NET") were defined - in that case, always the function was mistakenly called.I have fixed this issue, and it will be included in next public Bricscad build.In any case, please keep us updated for any problems.Many greetingsTorsten

  • Hi Torsten, Thank you for looking into this, I Also want to thank you for looking into the Mixed managed/unmanaged situation. You guys are doing a great job making Bricscad a world class CAD platform.

  • Hello, Daniel,it seems, one of our programmers found a good, safe solution for the .NET problem, regarding the hang-up ... :-)Will be in next public Bricscad build, I guess ... Luc will probably send you another notification regarding that topic ...CheersTorsten

This discussion has been closed.