Go Down

Topic: All sorts of wrong quotation marks from M$ word (Read 5091 times) previous topic - next topic

liuzengqiang

I was typing up a manual for a new design and used M$ word to type up example codes and I got this:

Code: [Select]
Serial.print('\f'); // Clear screen
Serial.println("GPS Menu:"); // Display "GPS Menu" on line 1
Serial.println("1.Display GPS info"); // Display option 1 on line 2
Serial.println("2.Record GPS info"); // Display option 2 on line 3
Serial.print("3.Show credit"); // Display option 3 on line 4



Arduino wouldn't compile. I looked again and again and found the weird quotation marks both single and double. No wonder arduino won't compile. So I did all the replacement and it compiled. I have written a few hundred lines in word so any quick way to change and or disable this feature? Thanks. My first response is replace but maybe I can turn it off so I don't have to do replace next time I type in M$ word.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

Coding Badly


To turn off the "feature" you need to change AutoFormat / Replace / "Straight quotes" with "smart quotes".  In newer version of Word, the option is found...

• Start Word
• Click the round button in the upper-left corner
• Click Word Options in the lower-right corner
• Click Proofing in the left-side list
• Click the AutoCorrect Options button in the middle-top
• Navigate to the AutoFormat tab
• Under Replace, ensure "Straight quotes" with "smart quotes" is not checked
• Navigate to the AutoFormat As You Type tab
• Under Replace as you type, ensure "Straight quotes" with "smart quotes" is not checked
• Click OK
• Click OK

To change the quotes already in your document...

• Load your document
• Press Ctrl + F to open the Find dialog
• Navigate to the Replace tab
• For Find what type a quote character
• For Replace with type a quote character
• Click Replace All
• Click OK
• Click Close
• Relax and enjoy your improved document


liuzengqiang

Thank you Coding Badly! So here is a graphical solution for anyone that is annoyed by the same problem:

Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

robtillaart

liudr, this is a case of using right tool for the right job.

Example code for manuals is must be edited in an IDE so you can check that the code compiles.  ==> Word for prose,  IDE for code.

From the IDE you can copy and paste it into Word AND in the zip file with all sources from the manual you want people to download from your website..

Have seen too much manuals/books/websites with code examples that did not compile :( 

Rob
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

liuzengqiang

Rob, agreed. I think I started typing up my manual in word and just went ahead and typed up some code as well. Next time I will use IDE. This was the first time I wrote a manual with a complete description of a unit, which I only wrote partial code. So the manual will act as a guide on what else I need to code in order to make it a complete product.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

Go Up