home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00003 / s / latedate.fr$ / latedate.bin (.txt)
Visual Basic Form  |  1993-01-01  |  31KB  |  622 lines

  1. LatedateForm
  2. wwwww
  3. wp|||
  4. wwp|||
  5. wwwp|||
  6. wwwwwwww
  7. Form1
  8. Picture2
  9. SystemText
  10. SystemText
  11. FileText
  12. FileText
  13. Label2
  14. !Microsoft Project Conflict Finder
  15. Label1
  16. XFor distribution, modification, and usage information, please read the file SAMPLES.WRI.
  17. Label4
  18. =Copyright 
  19.  1992 Microsoft Corporation.  All rights reserved.
  20. Resolve_Btn_Click
  21. Quit_Btn_Click
  22. MainForm
  23. LinText
  24.     LinkTopic
  25. LinkText
  26. LinkItemw
  27. LinkModeQ
  28. COLD\
  29. NONEy
  30. ProjName
  31. SystemText#
  32. FileText 
  33. UN_ID
  34. Search
  35. Check_ConflictH
  36. ActStart
  37.     ConstType
  38. TRUEP
  39. FALSE
  40. Find_SubTask
  41. Last_SubA
  42. OutlineNum
  43. SubNum
  44. SchedStart
  45. LastSub_ID
  46.     SStartSum
  47. StartSumj
  48. StartSub
  49. StartSummary
  50. index
  51.     SubOutNuma
  52. SubOutBase
  53. Last_SubID
  54. FileText_Change8
  55. FileText_LinkErrorW
  56. LinkErrk
  57. Init_Links
  58. Result
  59. Succ_Str9
  60. NextTask>
  61. SuccStr
  62. LastSub
  63. IfEndX
  64. ConflictPath
  65.     CurrentID
  66. summary
  67.     Find_Succ
  68. LastSuccc
  69. tempS
  70. Pred-
  71. checked5    
  72. beginsV
  73. alsok
  74. removes
  75.     preceding
  76.     successor
  77.     unchecked
  78. PredFinish
  79. FileTextTe]
  80. Succz
  81. Find_Next_Succ
  82. SuccID
  83.     SuccStart
  84. Log_Problem
  85. thenLog_ProblemK
  86. SuccList
  87. Find_Succ_Conflicts`
  88. Find_Succ_Conflict3
  89. temp1`
  90. temp2
  91. SummList
  92. whichE
  93. Find_SubTask_ConflictE
  94.     Procedure
  95.     SummStart
  96. SummID
  97. OutlineSummI
  98. SubStart
  99. BaseOutline
  100.     OutlineIDo
  101. Outline
  102. Done-
  103. ConflictList;
  104. LogNum!
  105. SystemText_Change
  106. List1
  107. Form_Click
  108. constraintc
  109. Actual
  110. ProbType
  111. CONSTRAINED
  112. STARTED
  113. Determine_Conflict_Typeq
  114.     SummaryIDx
  115. IDStart
  116. Start
  117. ProbID
  118. stems
  119. Strip_Text
  120. field+
  121. Command3_Click
  122. PredID<
  123. ResultText
  124. temppJ
  125. fieldasB    
  126. Strip_FileText=
  127. Hiddene
  128. Command1_Click
  129. SystemTeo
  130. SubOut
  131. Number
  132. Equals
  133. Value
  134. CheckError
  135. LinkTimeout
  136. Get_Succ_Relationships
  137. RelType
  138. LagType?
  139. Get_Successor_Relationships~
  140. bobl    
  141. date1*
  142. date2Z
  143. result2
  144. result1%
  145. total
  146. text1
  147. text2
  148. Find_Conflict
  149.     PredStartq
  150. SuccFinish
  151. LogProblem
  152. Conflict
  153. ConType
  154. Conflict_Type
  155.     Restraint
  156. Log_Poss_Prob
  157. Log_Def_Probe
  158. ResultText_ChangeQ
  159. Evaluate_Successors2
  160. SummFinish
  161.     SumOutNum*
  162. SummOutNum(
  163. Summ}    
  164.     SubFinish
  165. Get_Successors
  166. IDNum
  167. hjgjkhg
  168. SearchIDV    
  169.     SubTaskIDU
  170. ThenEvaluate_Successors
  171. ThenSuccList(
  172. ErrorHandler
  173. Selecr3
  174. MsgVal
  175. MsgTxt
  176. ActualSuccID%    
  177. DirList_Change!
  178. FileList
  179. DirlistI
  180.     ListCount
  181. ThenFileListd
  182.     Listindexc    
  183. DriveList_Change{
  184.     DriveListT
  185. Drive
  186. Form_LinkOpen@
  187. Cancel
  188.     Form_Load
  189. NewPath@
  190. FileList_Click4
  191. FileList_PathChange
  192. DirText_Change
  193. LastChange
  194. DIRTEXTCHANGE
  195. DirList_Click
  196. DIRLISTCLICK
  197. DirText
  198. FileListBox\
  199. Filename
  200. FileList_DblClick
  201. OKBtn_Click
  202. FoundIt
  203. ColonPos
  204.     BslashPosj
  205. StarPos
  206. QueryPos
  207. Bslash
  208. LastOne
  209. Pattern7
  210. DirBox
  211. SelStartV
  212.     SelLength@
  213. Visible
  214. Write_File
  215. Filenum
  216. WinprojPathC
  217. Initialize
  218. conflictingv
  219. appID
  220. msgID
  221. Get_Preferences
  222. IniFileNum 
  223. textline
  224. ListSepz
  225.     DateOrder
  226. DateForm
  227. TimeForm
  228. DateSep
  229. TimeSep
  230. AMTime
  231. PMTime
  232. AMText
  233. PMTextJ
  234. ViewName
  235. FILETEXTCHANGE-
  236. NAMETEXTCHANGE`
  237. NameText
  238. NameText_Change
  239. Change]
  240. PathForm
  241. Unhideo
  242. WindowState
  243. handler;
  244. handle
  245. Frame1_DragDrop
  246. Source
  247. ThenAMText
  248. SchedFromFinish
  249. NumTasks+
  250. getID
  251. Finish
  252. ConDate
  253. openIni
  254. Initializedd
  255. OK_Btn_Clickx
  256. masgbox7
  257. OldDriveG
  258. Label1_Click
  259.     Cancelled
  260. Valid
  261. Find_Latedate_Conflicts
  262. through
  263. tasks
  264. evaluate
  265.     conflicts
  266. cause+
  267. constraints^
  268. datesn
  269. neither
  270. relationship
  271. correct
  272. subtask
  273. exists
  274. Cleanup_and_ExitV
  275. Cleanup_and
  276. willp
  277. manuallyg
  278. Find_LateD@
  279. windir
  280. Log_Conflict
  281. ConfType
  282. DEFINITET
  283. Field1L
  284. Field2
  285. POSSIBLE
  286. Field3
  287. Field4
  288. sequence
  289. breaks
  290. LatedateForm
  291. SetListSeparator
  292. ViewFile
  293. RestoreListSeparator
  294. OK_Click
  295. Screen
  296. Width
  297. Height(
  298. Variable definitions. These are global to all procedures in the form..
  299. Task ID from the Microsoft Project message
  300. Unique ID of taskM
  301. List of Unique ID Successors to SearchID
  302. Unique ID of task in MS Project message 
  303. File handle number for LATEDATE.TXT file
  304. Result that will be written to LATEDATE.TXT
  305. Flags whether Initialize function was called
  306. Indicates a cold DDE linka
  307. Indicates a hot DDE link
  308. Indicates no restraint on task
  309. Indicates task has Actual Start date
  310. Indicates task has Constraint of MFO,MSO,FNLT,or SNETh
  311. Indicates task is a definite conflictM
  312. Indicates task may be a conflict
  313. Array of Unique Successor ID's
  314. Array of task relationship types
  315. Array of task relationship lead/lag amountso
  316. Array of task relationship lead/lag unitst
  317. Name of active project
  318. Name of active viewe
  319. Number of tasks in active projectp
  320. Find_SubTask_Conflict
  321. This subroutine looks for conflicts among the subtasks of IDNum$.e
  322. If any of these subtasks are also summary tasks, Find_SubTask_Conflict()
  323. is called recursively to check for more deeply nested conflicts.
  324. Get outline number of summary task
  325. ,Outline Number)
  326. Loop through all subtasks of IDNum$.
  327. Subtask outline number.
  328. Use the EditFind command to move to the subtask with this outlinem
  329. number. If no task exists with this outline number, the selection 
  330. does not move.
  331. EditFind .Field=[Outline Number],.Test=Equals,.Value="
  332. Get Unique ID of current selection from Microsoft Project 
  333. Selection"
  334. Get outline number of current selection 
  335. ,Outline Number)
  336. If the outline number of the selected task is the same ase
  337. SubOutNum$, then the subtask exists.
  338. Get Summary field of current taskt
  339. ,Summary)"
  340. If this is another summary task, then check subtasks of this taska
  341. Else check this task for a conflict.
  342. Restraint% flags whether the successor task has a constraint,t
  343. an Actual Start date, or neither. Conflict_Type returns 
  344. CONSTRAINED, STARTED, or NONE.
  345. Lag is specified, so log it as a possible problem
  346. Check this task for a conflict.p
  347. Convert SS of subtask to serial number
  348. ,Scheduled Start)"
  349. If the following condition is met, the task is ino
  350. conflict. Log the problem as definite.
  351. There are no more subtasks for this summary task.
  352. Find_Succ_Conflict
  353. This subroutine checks for conflicts in non-summary successor tasks
  354. to SearchID$. PredStart# and PredFinish# are the start and finish dates/times of
  355. SearchID$ (the predecessor task).F
  356. Restraint% flags whether the successor task has a constraint, an Actual Starto
  357. date, or neither. Conflict_Type returns CONSTRAINED, STARTED, or NONE.
  358. This might be a conflicting task
  359. If lag exists, then can only log
  360. task as a possible conflict.
  361. Else, check for definite conflict.
  362. Get SS of successor task and convert to serial numberl
  363. ,Scheduled Start)"
  364. Get SF of successor task and convert to serial number
  365. ,Scheduled Finish)
  366. Check for the following conditions based on the task relationship for.
  367. SuccID(n%). If the condition is true, then there is a definite conflict
  368. with this successor task, so the problem is logged. 
  369. Evaluate_Successors
  370. This subroutine gets the start and finish dates for SearchID$ and then calls
  371. other subroutines which evaluate the successors of SearchID$ to determinel
  372. which of them may cause conflicts.
  373. Convert SS of SearchID$ to a serial number
  374. ,Scheduled Start)"
  375. Convert SF of SearchID$ to a serial number
  376. ,Scheduled Finish)
  377. Loop through the SuccID() array and check for conflicts.
  378. ,Summary)"
  379. If successor is a summary task, look for conflicts among its subtaskss
  380. Else look for conflict with successor task n%.
  381. Get_Successors
  382. Evaluates each successor relationship for SearchID$ and places values for:
  383. Unique Successor ID
  384.  in  SuccID
  385. Relationship type
  386.  in  RelTypeD
  387. Lag amount
  388.  in  Lag
  389. Lag type (units)
  390.  in  LagType
  391.  <- This value is not used in this sample
  392. ) but is provided for possible 
  393. ) modifications. 
  394. Get list of successors to SearchID$ 
  395. ,Unique ID Successors)
  396. Append a comma to the end of the list (if non-empty) for parsing
  397. Loop while there are successors in the list 
  398. Save ID of first successor in list
  399. Remove first successor from the list
  400. Get successor ID only. Ignore relationship type, and lag/lead values.i
  401. Relationship type is specified
  402. Remove the ID string from Item$a
  403. Get type (SS,FS,FF,SF) from Item$e
  404. Lead/lag is specifiedS
  405. Remove type string from Item$p
  406. Get numeric lag amount
  407. What is left must be the units (d, ed, %, etc.)t
  408. Rel. type must be FS
  409. Mark end of successor array
  410. Conflict_Type
  411. This function determines whether task IDNum$ may be a source ofa
  412. conflict due to a Constraint or an Actual Start. It returns a value of
  413. CONSTRAINED or STARTED if applicable, or NONE if it is not a possiblef
  414. conflict.E
  415. Get Actual Start date of IDNum$c
  416. ,Actual Start)
  417. Task has started
  418. Get Constraint.Type of IDNum$a
  419. ,Constraint Type)"
  420. If Constraint Type is MSO, MFO, FNLT, or SNET then task is constrained
  421. Finish No Later"
  422. Start No Earlier
  423. Initialize
  424. This subroutine initializes DDE links to MS Project. It also sets required
  425. Preferences and view information, as indicated.j
  426. Use comma for DDE actions 
  427. SystemText will be the channel to the System topic in Projects
  428. Winproj|System
  429. ActiveProject"
  430. Name of project with late date conflict.
  431. ActiveView
  432. Save the current view.
  433. FileText will be the channel to the active project
  434. Winproj|
  435. Initialize necessary preferences. (Date/time formats, etc.)c
  436. Suspend error handling
  437. Error .Halt=No
  438. Turn off MS Project alert messages
  439. OptionsPreferences .DateOrder=0"
  440. OptionsPreferences .DateFormat=0
  441. OptionsPreferences .12HourTimeFormat=0
  442. OptionsPreferences .DateSeparator=/"
  443. OptionsPreferences .TimeSeparator=:"
  444. OptionsPreferences .AMText=AM"
  445. OptionsPreferences .PMText=PM"
  446. Display Task Sheet
  447. View [Task Sheet] .SinglePane=[Yes]"
  448. ActiveView
  449. Check current view
  450. Task Sheet
  451. Task Sheet does not existt
  452. This macro requires the Task Sheet to run. Please create the Task Sheet or open BACKUP.MPV and runn this macro again."
  453. Task Sheet Error
  454. Exit app
  455. Set filter to ensure all tasks are displayed
  456. Filter [All Tasks]
  457. NumLines
  458. Number of tasks in project
  459. This section opens the log file LATEDATE.TXT and logs the date and time.
  460. windir
  461. \LATEDATE.TXT"
  462. **********  
  463. mm-dd-yyyy h:mm am/pm"
  464.   **********
  465. Find_Latedate_Conflicts
  466. This is the main subroutine for this application. It gets the task ID
  467. from the user, then calls other subroutines to check possible conflicts
  468. with successors to the task.
  469. Loop until a valid ID is entered or the Cancel button is pressed
  470. in the dialog box.
  471. Get task ID# specified in "Late date..." message from user
  472. Enter ID number from Microsoft Project message:"
  473. Conflict Finder"
  474. If Cancel button was pressed, or ID# is blank, then exit program
  475. If an invalid ID# is entered, tell user and repeat InputBoxo
  476. There is no task with this ID.
  477. ID Error
  478. Move to task specified and get its Unique ID numberr
  479. EditGoto .ID="
  480. Selection"
  481. SearchID$ will be the Unique ID of the task that
  482. is being checked for successor conflicts.  It is
  483. initially the task referenced in the MS Projectt
  484. message, but may also be summary tasks thatI
  485. contain the initial task.s
  486. Get outline# of task. This will be used to identify its summary tasks.
  487. ,Outline Number)
  488. Check for self-contained conflict. If the Actual Start of the task is.
  489. in conflict with the constraint on the task, it will generate the "Late
  490. date..." message.a
  491. ,Constraint Date)"
  492. Constraint is not ASAP.
  493. Save the constraint date/time as a serial number
  494. Save the Sched Finish date/time as a serial number
  495. ,Scheduled Finish)
  496. ,Constraint Type)"
  497. If the Constraint Type is MFO or FNLT, then check for conflicting dates
  498. Must Finish"
  499. Finish No Later"
  500. If Scheduled Finish > Constaint Date then log problemF
  501. *** Task "
  502.  has an Actual Start
  503.  date that does not allow it to finish by
  504.  its constraint date."u
  505. Loop until all summary tasks of ID$ have been evaluated
  506. Set up list of successor relationships
  507. If SearchID$ has at least 1 successor, it will have been placed in the
  508. SuccID() array. If at least one successor is present, then evaluate for
  509. conflicts.
  510. SearchID$ has a summary task
  511. This loop finds the outermostD
  512. level of the outline number.
  513. This is the outline number of the summary task. 
  514. Move to first task in MS Project.s
  515. SelectBeginning"
  516. Use the EditFind command to move to the summary task
  517. EditFind .Field=[Outline Number],.Test=Equals,.Value="
  518. Unique ID of summary task becomes new SearchID$E
  519. Selection"
  520. SearchID$ has no summaries.
  521. No conflicts found."
  522. No problems were found.
  523. Log this in text file.
  524. Close log file.s
  525. Start Notepad with log file open for viewing.w
  526. windir
  527. \notepad.exe "
  528. LATEDATE.TXT
  529. Cleanup_and_Exit
  530. This subroutine resets the view and exits LATEDATE.EXE.n
  531. It can be modified to reset Preferences for date/timeE
  532. formats. 
  533. Reset user's original view
  534. View .Name=[
  535. If you want to reset the date/time preferences before exiting thes
  536. program, set the values of the following commands to the formats
  537. you want and remove the apostrophes at the beginning of the commentm
  538. lines:
  539.    SystemText.LinkExecute "OptionsPreferences .DateOrder="
  540.    SystemText.LinkExecute "OptionsPreferences .DateFormat="
  541.    SystemText.LinkExecute "OptionsPreferences .12HourTimeFormat="t
  542.    SystemText.LinkExecute "OptionsPreferences .DateSeparator="
  543.    SystemText.LinkExecute "OptionsPreferences .TimeSeparator="
  544.    SystemText.LinkExecute "OptionsPreferences .AMText="r
  545.    SystemText.LinkExecute "OptionsPreferences .PMText="r
  546.    SystemText.LinkExecute "OptionsPreferences .ListSeparator="
  547. Restore Microsoft Project list separator
  548. Remove form from memory 
  549. Log_Conflict
  550. This subroutine logs the conflict in the text file LATEDATE.TXT in the
  551. Windows directory. Definite task conflicts are prefaced with '***';m
  552. possible conflicts are not..
  553. CR/LF sequence for line breaks
  554. *** Task "
  555. Definite conflicts marked with ***
  556.  which
  557.     conflicts with the "
  558.     Task "
  559. Possible conflicts are not
  560.  which
  561.     may conflict with the 
  562. Field2=Field1 if SearchID$<>summary 
  563. SearchID$ is a summary taskr
  564. Field2 = summary task ID
  565.  is contained in summary task 
  566.     Task "
  567. ID of actual successor tasks
  568. Successor is a summary task
  569. summary task "
  570. task "
  571.  has a "
  572.  relationship with "
  573. Task is constrainedn
  574. constraint on task "
  575. Task has started
  576. Actual Start of task "
  577. Conflict caused by subtask
  578.     (a subtask of task "
  579. SetListSeparator
  580.  Copy the list separator character from Microsoft Project,
  581.  and replace it with a comma.  This is necessary so that
  582.     ' LinkRequest statements are understood by Microsoft Project.
  583.  This subroutine should be called before any LinkRequests
  584.  are performed, and should always be paired with a subsequent
  585.  call to RestoreListSeparator.
  586.  No Clipboard operations should be made between these twou
  587.  calls, since the list separator is held there. 
  588. WINPROJ|System
  589. AppExecute
  590.  Prepare MS Project to accept SendKeys
  591. {F10}op{PGDN 4}{F2}{HOME}+{RIGHT}^c{ESCAPE 2}"
  592. AppMinimize"
  593.  Minimize Microsoft Project 
  594. OptionsPreferences .ListSeparator=[,]"
  595. RestoreListSeparator
  596.  Restore the list separator character in Microsoft Project
  597.  from the Clipboard.  SetListSeparator should be called before
  598.  calling RestoreListSeparator.
  599.  See SetListSeparator for more information.l
  600. WINPROJ|System
  601. AppExecute
  602.  Prepare MS Project to accept SendKeys
  603. {F10}op{PGDN 4}{F2}{HOME}+{RIGHT}^v{ENTER 2}
  604. AppMinimize"
  605.  Minimize Microsoft Project 
  606. OK_Click
  607. The user is ready to continue and find task conflicts.
  608. Look for conflicts
  609. Form_Load
  610. This is the first subroutine to execute when LATEDATE.EXE is activated.
  611. It establishes a global error handler and calls the Initialize
  612. subroutine.h
  613. Center form horizontally
  614. Center form vertically
  615. Errors not captured elsewhere go here 
  616. No conflicts found."
  617. Log text if no conflicts are found.t
  618. Initiate DDE links and set MS Project environments
  619. Line #
  620. , Error #"
  621. Exit app
  622.