Using,tutorial,will,able,create,ToDo,file,wic
Quick Search for:  in language:    
Using,tutorial,will,able,create,ToDo,file,wic
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
C/ C++ Stats

 Code: 451,578 lines
 Jobs: 605 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for C/ C++.
Visual Pi Hex
By jo122321323 on 8/25


Click here to see a screenshot of this code!ShortCutSample
By Massimiliano Tomassetti on 8/25

(Screen Shot)

AnPMoneyManager beta
By Anthony Tristan on 8/24


A calculator (english/polish )
By Tom Dziedzic on 8/24


MMC (Mouse Move Counter)
By Laszlo Hegedüs on 8/24


Text-DB
By Jerome A. Simon on 8/24


JDos
By Jerome A. Simon on 8/23


Game 1945X
By Ozgun Harmanci on 8/23


Find hidden "back streamed" files on NTFS partitions. This code is a must for sec consultants.
By Israel B. Bentch on 8/22


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Creating a comfortable ToDo list in "Visual C++" using "Visual C++" macros (Not an add-in).

Print
Email
 

Submitted on: 2/7/2001 3:22:30 PM
By: Vitaly 
Level: Beginner
User Rating: By 4 Users
Compatibility:Microsoft Visual C++

Users have accessed this article 3609 times.
 

(About the author)
 
     Using this tutorial you will be able to create a ToDo file wich writes the dates and marks the done tasks. All this using macros.


 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
First of all about the picture.
What you have used to see as Breakpoint, means in this task list a ToDo task. The first date is the date you added the Task to ToDo, the second date is when you finished the task.

Before we start you have to choose your Todo file. Just create an empty text file, in the program I will refer to it as [filename], remember to replace it with your file name. The path to the file will appear as [path] in the tutorial and so you have to replace it as well with your path.
An example to [filename] is: Todo.txt
An example to [path] is: C:\Todo.txt

Lets start with the real thing now.
Go to your macro file (.dsm) and add the following sub to it:

Sub OpenTodoList()
'DESCRIPTION: Opens the todo.
Documents.Open "[path]", "Text"
End Sub
Remember to replace the path with the path to your text file just like in the example

When you run it, the macro will open the text file which you will be using as your ToDo file.
If you wish create now a button on the toolbar of "Visual C++" that will run this macro.

Now lets go for the second macro, again go to the macro file and add the following Sub to it:

Sub WriteDate()
'DESCRIPTION: Writes the date, duh.
ShortName=ActiveDocument.Name
If ShortName="[filename]" Then
Line = ActiveDocument.Selection.CurrentLine
Column = ActiveDocument.Selection.CurrentColumn
'Finding the bottom
ActiveDocument.Selection.SelectAll
Bottom = ActiveDocument.Selection.BottomLine
ActiveDocument.Selection.GoToLine Line
'Find the place for the date
Do
ActiveDocument.Selection.LineDown
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.CharRight dsExtend
Loop Until ActiveDocument.Selection = "*"
ActiveDocument.Selection.LineUp
ActiveDocument.Selection.EndOfLine
ActiveDocument.Selection = " (" & CStr(Date) & ")"
'Find the place to do the BreakPoint
ActiveDocument.Selection.LineDown
Do
ActiveDocument.Selection.LineUp
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.CharRight dsExtend
Loop Until ActiveDocument.Selection = "*"
ExecuteCommand "DebugToggleBreakpoint"
'Moving back
ActiveDocument.Selection.GoToLine Line
ActiveDocument.Selection.CharRight dsMove, Column
Else
ExecuteCommand "DebugToggleBreakpoint"
End If
Remember to replace the path with the path to your text file just like in the example

This is the important macro of the program, it will simulate regular Breakpoint for your programs, however, for your ToDo file it will work in a special way.
To continue go to Visual C++ costumize and assign the key F9 to that macro (WriteDate in this tutorial). Now you try to use F9 in your programs and you'll see that it works as usual (just to make sure).
The format of the tasks in the ToDo file has to be in a specific format if you want it to work as planned:
- Every task has to start with the '*' character.
- Tasks can be longer then one line, the '*' character says when a new task begins.
- There should be no space lines between tasks (As on the picture).
- The last line of the macro should be any line that begins with '*'. In my picture it is: "*************** END OF TASKS *************".

After you write your task, mark it as ToDo by having the marker anywhere on the task and pressing F9. The Task will be marked with the Breakpoint mark and the starting date will appear in the end of the task.
When you finish the task move the marker to there and press F9 again. The Breakpoint mark will be removed and the ending date will be added to the end of the task.

TIP: You might want to cause the finished mark to disappear instead.


I hope that you found this tutorial helping and if you did then please vote for it. Thanks.


Other 4 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
10/26/2001 6:59:30 AM:Ward
Indeed a very fine piece of work! You can even show the date AND time by replacing the line ActiveDocument.Selection = " (" & CStr(Date) & ")" by the following: ActiveDocument.Selection = " (" & CStr(Date) & ", " & CStr(Time) & ")"
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.