Page 1 of 1

Debug with more than one parameter

Posted: Mon Feb 14, 2011 3:38 pm
by Hysteria
Apologies if this has already been requested, I did have a quick look first :wink:

It would be very useful to be able to use the command debug with more than one parameter. Many times I've wanted to use: debug "Variable name", variable

Many thanks.

update I've realised this can be achieved by debug "text"+variable. oops :oops:

Not sure if there is any merit in allowing comma seperators, e.g. debug A$,b,"xyz". Probably not.

Re: Debug with more than one parameter

Posted: Mon Feb 14, 2011 10:31 pm
by STARGĂ…TE
Note: The second parameter specifies the debug level!
Syntax
Debug <expression> [, DebugLevel]

Code: Select all

DebugLevel 1
Debug "Level Default"
Debug "Level 1", 1
Debug "Level 2", 2
Debug "Level 3", 3
Debug "Level 1", 1

Re: Debug with more than one parameter

Posted: Mon Feb 14, 2011 10:58 pm
by Tenaja
Hysteria wrote:Apologies if this has already been requested, I did have a quick look first :wink:

It would be very useful to be able to use the command debug with more than one parameter. Many times I've wanted to use: debug "Variable name", variable

Many thanks.

update I've realised this can be achieved by debug "text"+variable. oops :oops:

Not sure if there is any merit in allowing comma seperators, e.g. debug A$,b,"xyz". Probably not.
debug "a="+str(a)+", b="+str(b)

...and yes, it's a pita typing str so many times.

Re: Debug with more than one parameter

Posted: Mon Feb 14, 2011 11:54 pm
by PB
You can use the watch list for viewing variable values in realtime, or even hover the mouse over a variable name in the ide to see its value.

Re: Debug with more than one parameter

Posted: Tue Feb 15, 2011 10:48 am
by C64
Here's a way to print three variables at a time, but not on the same line. It's handy so you don't have to type Str() all the time.

Code: Select all

Macro Debug3(v1,v2,v3)
  Debug v1
  Debug v2
  Debug v3
EndMacro

three$="3"

Debug3(1,"two",three$)