Page 1 of 1
Debug List Separator
Posted: Wed Apr 03, 2013 2:41 am
by buddymatkona
Code: Select all
a.i = 1 : b.f = 2.0 : c.s = "astring"
Debug " a,b,c = " + a + b + c + "A mixed-type Debug list is something I use often. Now if only there were an option for an automatic separator. "
Debug " a,b,c = "+a+", "+b+", "+c+", "+" Making lazy programmers add a space or comma between variables is cruel. "
Re: Debug List Separator
Posted: Wed Apr 03, 2013 8:42 am
by Joris
+1
Re: Debug List Separator
Posted: Wed Apr 03, 2013 4:01 pm
by Tenaja
+1 for a new DebugList command.
In the meantime, you can use a macro:
Code: Select all
Macro DebugList(a,b=0,c=0,d=0,e=0,f=0) ;
Debug Str(a) + ", " + Str(b) + ", " + Str(c) + ", " + Str(d) + ", " + Str(e) + ", " + Str(f)
EndMacro
; Make some variables with random values.
vara = 5
varb = 4
varc = 3
vard = 22
vare = 11
varf = 9
DebugList(vara,varb,varc) ; zeros are filled in.
DebugList(vara,varb,varc,vard,vare,varf)
You could, of course, rename the macro to DebugList6, and make other macros for lists containing other quantities.
Re: Debug List Separator
Posted: Wed Apr 03, 2013 7:31 pm
by moogle
-1
How would it be able to tell if you are outputting an addition of two variables or numbers?
If PB had the string concatenation character like VBA "&" then maybe it'd be able to work.
Re: Debug List Separator
Posted: Thu Apr 04, 2013 2:25 am
by buddymatkona
@moogle
Debug in 5.11 is different from many earlier versions. It accepts mixed type variables following an initial string.
Code: Select all
a.i = 1 : b.f = 2.5
Debug "You no longer have to do it this way : " + Str(a) + StrF(b) ; = 12.5
Debug "In 5.11, PB will do the string conversion for you: " + a + b ; = 12.5 All I am requesting is a new option to separate string terms so "12.5" becomes " 1, 2.5 "
Debug a + b ; = 3.5 Without an initial string, the "+" still adds values before conversion.
Re: Debug List Separator
Posted: Thu Apr 04, 2013 7:39 am
by moogle
Ah right, well if the functionality is already there then I apologize, I haven't tried the latest builds.
+1