ide/bdebugger

Aug 9, 2009
173
0
TCC 25.00.7 x64 Windows 10 [Version 10.0.18362.295]

ide/debugger

running a script inside the ide the script fails to run
1) fails to see loaded plugins.

running script on its own no errors runs as expected

also noticed if i use gosub "path\script" xgen
the script must have a blank line top of code other wise it fails to
find the label
 
Aug 9, 2009
173
0
ide /c path\script.btm
when running in the ide the script fails in debugger.
1) I see another console window behind the debugger with the errors
which tells me that its a plugin function that its having trouble with

--- the plugin is 4UTILS: @MRAND @MRANDSEED
these two functions that cause errors while running inside the ide. how ever!
if not running in ide/debugger no errors eveything runs as expected.
 
Aug 9, 2009
173
0
more info;
the functions are in another script which i call with gosub "path\seek.bt" xgen
this script creates pure randomized numbers.

may be the ide has problems when calling an external gosub routine
 
Aug 9, 2009
173
0
if i use 0 as seed the numbers generated become predictable at any given time daily,
i use it like this example @mrandseed[%@random[1,10000]]
 

rconn

Administrator
Staff member
May 14, 2008
11,910
133
more info;
the functions are in another script which i call with gosub "path\seek.bt" xgen
this script creates pure randomized numbers.

may be the ide has problems when calling an external gosub routine
Not reproducible here - please post a (hopefully simplified) sample batch file that shows the problem.
 
May 20, 2008
10,571
78
Syracuse, NY, USA
I also have no problem calling a subroutine in another BTM. But there is a BDEBUGGER problem. I give this command.
Code:
BDEBUGGER mrandtest.btm
and I see this.
1565925710834.png


I press "Go" and then "Step into" repeatedly until debugging stops. Now I'm here (with no apparent way of repeating the debugging session).
1565925864469.png
 
May 20, 2008
10,571
78
Syracuse, NY, USA
if i use 0 as seed the numbers generated become predictable at any given time daily,
i use it like this example @mrandseed[%@random[1,10000]]
Did you test that? You won't convince me. It has nothing to do with the time of day. When you specify 0 it uses the value of the Windows performance counter, a 64-bit number which (here) changes 10,000,000 times a second and which won't repeat for about 60,000 years.
 

rconn

Administrator
Staff member
May 14, 2008
11,910
133
I also have no problem calling a subroutine in another BTM. But there is a BDEBUGGER problem. I give this command.
Code:
BDEBUGGER mrandtest.btm
and I see this.
View attachment 2462

I press "Go" and then "Step into" repeatedly until debugging stops. Now I'm here (with no apparent way of repeating the debugging session).
View attachment 2463
The problem is when the child batch file tries to return the parent isn't there anymore (edge condition, not new to v25). If you had another line (even "echo.") after the enddo, it would have returned to mrandtest.btm.

I've added a workaround for build 8.
 
Aug 9, 2009
173
0
simplified scripts if run from cmdline no problem problem is when run inside ide

i found the code in simple_2 years ago on klaus meinhard 4dos.info site it was originally an lotto type generator and just modified it to suit my needs.
 

Attachments

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,202
72
Albuquerque, NM
prospero.unm.edu
Going back to the original question:

Forgive me if this is bloody obvious, but... you are aware that IDE and BDEBUGGER launch a new shell, right? Plugins loaded in the parent shell are not inherited by the new one. The child shell must load its own plugins, either automatically because they're in the PLUGINS directory, or else via the PLUGIN command, e.g. in 4START.BTM.
 
Aug 9, 2009
173
0
Thank you all.

charles, tcc-v24 i was having trouble with plugins reloading in the IDE automatically as it complained about plugin already loaded. in tcc-v25 i get no errors about them because they arent thanks.! both version behave differently about plugins while in the IDE.

I've changed the startup to reflect this with v25 now all is good.