We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variables in Subroutines
#11
JR,

Thanks, I can reproduce issues now.

They come from event subroutines, with issues relating to a variety of event threads interacting, being created or still running while other threads are paused for the debugging.  If I come up with a solution I will implement, but not hopeful at the moment.

I'm not sure I can easily fix this using the fairly basic debugging technique I used.  In general I suggest to do limited work in event subroutines - just set flags - and do all the work in an application game loop reacting to the event subroutine flags.  This is good practice for a variety of reasons (not just debugging) and is how interactive software generally works.  It keeps all the action on a single UI thread.

In your case, you have done a lot of work inside event subroutines - I would suggest carring on with your code (albeit with reduced debugging capability) and maybe next program you write think about the apllication loop idea.
[-] The following 1 user Likes litdev's post:
  • z-s
Reply


Messages In This Thread
Variables in Subroutines - by jrmrhrb00 - 12-08-2023, 12:49 AM
RE: Variables in Subroutines - by litdev - 12-08-2023, 12:58 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-08-2023, 05:52 PM
RE: Variables in Subroutines - by WhTurner - 12-08-2023, 06:13 PM
RE: Variables in Subroutines - by litdev - 12-08-2023, 07:03 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-08-2023, 07:31 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-09-2023, 12:19 AM
RE: Variables in Subroutines - by Scout - 12-09-2023, 08:10 AM
RE: Variables in Subroutines - by litdev - 12-09-2023, 10:08 AM
RE: Variables in Subroutines - by jrmrhrb00 - 12-09-2023, 12:18 PM
RE: Variables in Subroutines - by litdev - 12-09-2023, 07:04 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-09-2023, 07:34 PM
RE: Variables in Subroutines - by Scout - 12-11-2023, 10:39 AM
RE: Variables in Subroutines - by jrmrhrb00 - 12-11-2023, 07:16 PM
RE: Variables in Subroutines - by litdev - 12-16-2023, 12:01 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-16-2023, 01:59 PM
RE: Variables in Subroutines - by litdev - 12-16-2023, 03:41 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-16-2023, 04:41 PM
RE: Variables in Subroutines - by jrmrhrb00 - 12-18-2023, 11:24 PM
RE: Variables in Subroutines - by litdev - 12-19-2023, 11:24 AM
RE: Variables in Subroutines - by jrmrhrb00 - 12-19-2023, 01:36 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)