|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
TAB command in Pbasic
I was looking around in the various forums and things and I wasn't able to find any documentation discussing the tab character in PBasic. Specifically in its relation to debug statements (we would like to be able to dump debug data easily from the debug window into an excel spreadsheet.) Our problem now, with the tab command is the necessity of dumping the data into a word document and replacing all of the spaces in between the columns of data with tab characters. It's somewhat inefficient. Our thinking was it would be nice to be able to copy and paste these multiple columns of debug data directly into Excel.
|
|
#2
|
||||
|
||||
|
A tab is an ASCII character value 9. Try sending debug 9 and see if it gives a tab.
|
|
#3
|
||||
|
||||
|
Just tried it myself:
Code:
debug "A" debug 9 For all the ascii characters, http://www.asciitable.com . |
|
#4
|
|||
|
|||
|
I thank you for the assistance. It seems like excel may have some difficulty dealing with tabs from the debug window... but, the ASCII does separate the data enough to parse it, so it's okay. (Try copy and pasting the A's into excel.) My problem was the data wasn't automatically behaving like other tabbed data that one would copy and paste into excel... I was curious. Thanks again.
|
|
#5
|
|||
|
|||
|
Ooo yeah... your A's will work, I think... but I'm looking at multiple variables... p1_y, p1_x, PWM1, and PWM2 in one debug statement...
debug DEC p1_y, 9, DEC p1_x, 9, DEC PWM1, 9, DEC PWM2, CR |
|
#6
|
||||
|
||||
|
You could separate fields with commas and linefeeds, save the data to a file with a .csv (comma separated values) extension and open it in excel.
But I have a question for you: How do you copy and paste data from the debug window? |
|
#7
|
|||
|
|||
|
Just highlight all of the data and Ctrl+C, Ctrl+V it. I'll probably just stick to parsing...
|
|
#8
|
|||
|
|||
|
Attached is an example of me shaking around the joystick a bit
I'm sure you've thought of this, but you can add another debug statement outside of the main operational loop that'll label your columns for you for easy, easy dumping and graphing... Code:
debug p1_y, 9, p1_x, 9, PWM1, 9, PWM2, 9, cr |
|
#9
|
||||
|
||||
|
Quote:
![]() |
|
#10
|
|||
|
|||
|
(Understandable... these stupid laptop keyboards can be annoying in their layout... my new Toshiba doesn't have a serial port... so I have to program off my server. This, of course, is also fun at this hour of high usage.)
|
|
#11
|
|||||
|
|||||
|
Quote:
|
|
#12
|
|||
|
|||
|
Back in the days of yore, spreadsheets could import text files in which data was separated by "," as in
"2","5","seventeen monkeys","0"<cr>. HTH |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Obscure PBASIC for RoboEmu | rbayer | Programming | 1 | 28-03-2003 23:57 |
| PBasic 2.5 vs. 2.0 | Anthony Kesich | Programming | 6 | 09-02-2003 22:06 |
| Broken PBASIC 2.5 Complier? | Mike Yan | Programming | 12 | 01-02-2003 09:11 |
| RoboEmu 1.09 (supports PBASIC 2.5) | rbayer | Programming | 22 | 21-01-2003 17:22 |
| Another PBASIC Question | Ian W. | Programming | 4 | 31-01-2002 21:36 |