Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   TAB command in Pbasic (http://www.chiefdelphi.com/forums/showthread.php?t=16816)

virusmirusne 21-01-2003 21:22

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.

n[ate]vw 21-01-2003 21:30

A tab is an ASCII character value 9. Try sending debug 9 and see if it gives a tab.

n[ate]vw 21-01-2003 21:35

Just tried it myself:
Code:

debug "A"
debug 9

in the main loop spits out A's separated with tabs.

For all the ascii characters, http://www.asciitable.com .

virusmirusne 21-01-2003 21:44

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.

virusmirusne 21-01-2003 21:48

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

n[ate]vw 21-01-2003 21:52

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?

virusmirusne 21-01-2003 21:56

Just highlight all of the data and Ctrl+C, Ctrl+V it. I'll probably just stick to parsing...

virusmirusne 21-01-2003 22:01

1 Attachment(s)
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
Doing that outside the loop will run that code only once, as opposed to the 38.687 (or whatever) times per second that the other observed variables are sent.

n[ate]vw 21-01-2003 22:01

Quote:

Originally posted by virusmirusne
Just highlight all of the data and Ctrl+C, Ctrl+V it.
I thought I tried that, but on this laptop keyboard, I had hit [Fn] instead. I should be more awake by this time in the day.:rolleyes:

virusmirusne 21-01-2003 22:04

(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.)

Jeff Waegelin 22-01-2003 09:13

Quote:

Originally posted by virusmirusne
(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.)
You can use a USB to Serial adapter for programming. Just make sure you don't get one for PDA's (they're not standard serial ports).

Lloyd Burns 25-01-2003 02:51

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


All times are GMT -5. The time now is 09:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi