Giter Site home page Giter Site logo

Comments (4)

SteveMcNeill avatar SteveMcNeill commented on May 30, 2024

Is this really a necessary change to make? The vast majority of the user's code would have to be inside $IF blocks, as above, and all they'd need to do is add a single truth statement to the start of the program to toggle when they wanted to see the debug information or not. IE:

$LET DEBUG = FALSE

'do all sorts of stuff

$IF DEBUG THEN
Print "We are debugging"
$End If

Change that $LET from FALSE to TRUE, and the user can manually turn on that debug segment, without necessarily having to rely on the built in vWatch debugging system.

QB64 source is quite complex and longish already. I'm not certain we'd see much actual benefit to digging into and sorting an extension out for this, when it's already so easily available for an end user. ;)

from qb64pe.

a740g avatar a740g commented on May 30, 2024

Yes true. But QB64 IDE automatically wants to add $DEBUG at the top when the line column is clicked. It would be nice if we could detect this using the preprocessor rather than manually editing.

from qb64pe.

mkilgore avatar mkilgore commented on May 30, 2024

Personally I'm somewhere in-between - the suggestion seems reasonable to me, but Steve's not wrong that you can get basically the same functionality by just defining DEBUG yourself. That said I don't actually know all that much about how $DEBUG works, I think I should look into it a bit more.

Seeing your snippet of code, what would also be nice is if you could wrap the whole thing into some kind of DebugPrint statement, rather than have the $ifs everywhere. You could almost get there with just a SUB, but it's not quite the same :-/ Any kind of change like that would require a fair amount more thought though :D

I would personally encourage you to give this change a shot if you feel like it. Looking at the qb64.bas code I don't think this is a hugely significant change to make, but even if we did decide to do it it's probably not something we would get to soon. I would not be opposed to adding this if we had a working version and it wasn't too complicated to add. The only thing I would suggest is make the define _DEBUG or something so it's less likely to clash with what people might already have.

from qb64pe.

 avatar commented on May 30, 2024

I'm with Matt on this. I'm somewhere in-between. It sounds nice but can easily be replicated with your own $LET.

from qb64pe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.