-
Notifications
You must be signed in to change notification settings - Fork 7
/
genmenux.prg
6379 lines (5882 loc) · 195 KB
/
genmenux.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
* Program...........: GENMENUX.PRG
* Author............: Andrew Ross MacNeill
* Version...........: 3.0a
*} Project...........: GENMENUX
* Created...........: 07/04/93
* Copyright.........: (None - Placed in Public Domain)
*) Description.......: Pre/Post Compiler for Menus
*) Provides lots of features for MENU directives
*) Based on original piece by Steven Black
*) and GENSCRNX by Ken Levy of JPL
*] Dependencies......:
* Calling Samples...:
* Parameter List....:
* Returns...........:
* Major change list.:
*{ 08/19/93 Addition of Clauses for *:MESSAGE to force messages
*{ TO appear IN the MESSAGE clause (useful FOR DOS MENUS)
*{ This is called BY HAVING A LINE IN the comments BOX starting WITH
*{ *:MESSAGE AND then the MESSAGE clause AS it would appear including
*{ quotes, etc.
*{ 08/20/93 Addition of Clauses for *:DELETE
*{ This allows you TO remove items FROM the MENU during compilation TIME
*{ Useful FOR taking out features until ready.
*{ Simply place *:DELETE IN the Comments BOX
*{ 08/20/93 Addition of Reordering Procedure that reorganizes the menu
*{ AFTER GENMENUX has done its thing such AS removing OR changing items
*{ The MENU must GET renumbered IN ORDER TO appear correctly. This now
*{ takes place AFTER ALL OF the pre -processing has been completed.
*{ 08/20/93 Support for Two Driver Levels
*{ First LEVEL is FOR complete pre -processing
*{ IF you want the MENU TO actually be generated OR IF you want
*{ simply TO RUN A PROGRAM FOR A specific MENU
*{ 08/25/93 Removed references to INTL and SMB as per request by SMB
*{ 08/25/93 Fixed problem in standard directives that only allowed
*{ MESSAGE AND COLOR settings TO be IN the first LINE OF the
*{ Comments snippet
*{ Bug FROM SMB
*{ 08/25/93 Fixed bug with m.prompt under Windows
*{ Bug FROM SMB
*{ 08/25/93 Added support for PADCOLOR which sets the default color of
*{ MENU pads throughout the SYSTEM
*{ 08/26/93 Added support for CONFIG.FP. All MNX and MPR drivers may be
*{ defined IN the CONFIG.FP FILE BY USING the _MNXDRV OR _MPRDRV
*{ setting. IF any drivers are NOT available, A WAIT WINDOW
*{ is displayed AND times out AFTER 3 seconds.
*{ Request FROM SMB
*{ 08/26/93 Finished support for DEFAULT setting which makes the menu
*{ become the DEFAULT MENU BY USE OF the SET SYSMENU SAVE COMMAND
*{ being processed RIGHT AT the END OF the file.
*{ 08/26/93 Added support to force all *: statements to be changed to
*{ *-: WHEN processed.
*{ Request FROM SMB
*{ 08/26/93 Added support for *:NOAUTO directive in setup statement
*{ which removes the SET SYSMENU AUTOMATIC statement FROM
*{ the created SPR file.
*{ This was an ER FROM Andy Neil OF MM.
*{ 08/27/93 Added support for *:AUTOHOT directive in setup or _AUTOHOT=ON
*{ IN CONFIG.FP. This will automatically ADD A Hotkey TO A MENU PAD
*{ WHEN it is created. This is useful IF you sometimes forget TO
*{ CREATE hotkeys FOR your menus. BY DEFAULT, it uses the first
*{ letter OF the MENU Pad. IF it is already being USED BY one OF
*{ the other MENU pads, it will proceed TO the NEXT letter, AND so on.
*{ 08/27/93 Fix Bug in Reordering Menu procedure that caused problems
*{ WITH MENU items that had NOT been defined.
*{ 08/27/93 Added *:POPFILES directive for EARLY testing. This directive
*{ should be placed ON the FIRST BAR IN A submenu IN ORDER TO make
*{ the entire submenu INTO A dynamic POPUP PROMPT FILES LIKE *. *
*{ COMMAND line. This would allow you TO provide ACCESS ONLY TO
*{ specific files. Please DO NOT USE THIS FUNCTION YET.
*{ IN ORDER FOR it TO FUNCTION properly, you need TO place A
*{ *:POPCOMMAND directive that defines what is done ON the
*{ ON SELECTION POPUP. This directive must be A VALID FOXPRO
*{ function.
*{ 09/07/93 Fixed AUTOHOT option.
*{ 09/07/93 _GENMENUX setting in CONFIG.FP is overriden by MNXDRV5 driver.
*{ 09/07/93 Added support for AUTORUN in CONFIG.FP, runtime and setup code
*{ 09/14/93 Added support for *:IF which will add RELEASE PADs in the clean up code
*{ 09/14/93 Enlarged Thermometer to overlay on top of standard Menu thermometer
*{ 09/17/93 Added support for *:GENIF (Compile-time IF statement that DELETES
*{ the PAD OR BAR IF A variable is true during build.
*{ 09/25/93 Support for the whole clause of POPFILES has now been added.
*{ 09/26/93 Support for POPFIELD directive added.
*{ 09/28/93 Fixed Bugs from Steve Black
*{ 09/28/93 Changed All LOCATE FOR SETUPTYPE=1 TO GO TOP based on a
*{ suggestion from Barry Chertov (MM). MM don't usually put
*{ setup code and SETUPTYPE=1 is only valid for those menus
*{ where the setup is filled in.
*{ 09/29/93 Ensured that MPRDRVs existed by forcing a PRG extension
*{ if it was forgotten.
*{ 10/04/93 Recovered from Crash! Added support for WORDSEARCH() by
*{ Ken Levy (JPL) to better support directives.
*{ 10/05/93 Ensured that ON SELECTION POPUP command was placed directly
*{ after the POPUP definition to avoid any problems in the
*{ clean up code. From Suggestion by SS
*{ 10/05/93 Added NOXGEN directive to tell GENMENUX NOT to process anything
*{ 10/07/93 Added support for {{}} statement via Ken Levy's evlTxt function.
*{ This updating of {{}} statements is done after the first
*{ MPR driver and BEFORE the second.
*{ 10/07/93 Problem with NOGEN fixed.
*{ 10/10/93 Fixed MENUNAME.
*{
*{***************************
*{ RELEASE OF VERSION 1.0
*{***************************
*{
*{ 10/12/93 Added *:SYSPOP option that wraps Procedure with PUSH/POP SET SYSMENU
*{ SYSPOP is a CONFIG.FP, Setup and Procedure Directive.
*{ 10/12/93 Allowed all MNX Drivers and GENMENUX to be memvars with _ during compilation.
*{ These will not override menu defaults but act as additional
*{ substitutes.
*{ 10/12/93 Created BARHOT directive that creates hot keys for Menu Bar items.
*{ This directive can be called for a single Menu Bar or for every
*{ single item. It will only work if the menu bar is for a
*{ Command/Procedure or Bar #. It will not work for submenus.
*{ However, if you place BARHOT at the top pad of a menu, it will
*{ ensure that BARHOT is active for all bars in that menu.
*{ This allows you to only use BARHOT on certain Menu Popups
*{ 10/12/93 Fixed an option with AUTOHOT that didn't check for duplicates
*{ when creating the menu bar hot keys.
*{ 10/14/93 Started working on Menu Template options using directives
*{ INSBAR and DEFBAR.
*{ 10/15/93 Added HIDE directive that hides the menu bar while it's being
*{ generated. If you use the HIDE directive, GENMENUX automatically
*{ calls the NOAUTO directive to properly hide the menu.
*{ 10/19/93 Added support for InsObj and defObj directive. These directives
*{ provide complete menu copy/paste handling across menu template files.
*{ 10/19/93 Added AUTOWIN directive that will create a window and place the
*{ the menu inside the window and activate the window, etc - all automatically
*{ This is an ER from SB instead of having to call *:WINDOW and define
*{ the Window yourself. AUTOWIN allows you to place and size the Window
*{ during Menu Generation.
*{ 10/19/93 Added AUTOPOS directive that will allow the user to click on the
*{ desired location of the Menu during generation. Perhaps the name
*{ of this directive will change in the near future.
*{ 10/19/93 When using the MENUNAME directive, you need to activate the menu
*{ after DEFINing it since SET SYSMENU AUTOMATIC won't do it. Instead
*{ of automatically doing it, use the directive AUTOACT. This directive
*{ will also automatically ACTIVATE _MSYSMENU if used.
*{ 10/19/93 Added FOUNDATION directive that creates a Foundation read
*{ clause at the bottom of the menu file. This foundation read
*{ will perform a VALID clause based on the directive's clause.
*{ If there is no directive clause, the FOUNDATION READ is performed
*{ on whether the Prompt is "EXIT" or "QUIT"
*{ 10/19/93 Added *:PADPOS and POPPOS directives that places Pads at Row and Column
*{ specified by PadPOS.
*{ 10/19/93 Added *:SELECTPAD directive that forces you to actively press
*{ Enter when highlighting a PAD to see the Popup.
*{ When using the SELECT directives, you should place positions
*{ on the Popups to work properly.
*{ 10/19/93 Added *:VERTICAL directive that makes the menu a vertical menu
*{ instead of the standard horizontal menu
*{ VERTICAL has two parameters the line to begin at and the lines
*{ to skip between the two.
*{ 10/19/93 Added *:SELECTBAR directive that forces you to actively press
*{ Enter when highlighting a BAR to see the Popup.
*{ When using the SELECT directives, you should place positions
*{ on the Popups to work properly.
*{ 10/19/93 Added *:POPTITLE as a popup directive that places a title
*{ on a popup.
*{ 10/20/93 Added directive to make definition of PAD and/or popup optional
*{ by verifying existence of PAD before Defining Popup.
*{ Since the actual DEFINE POPUP takes time, the IF statement
*{ will make the calling of the menu quicker. Currently it's called
*{ *:POPME and can be called in the submenu popup or passed the
*{ parameter of the popup to Quick Pop
*{ This directive is based on a driver by MicroMega
*{ 10/20/93 New Directive that allows you to define the menu as one of the
*{ four options (Append,Replace,Before,After) *:LOCATION
*{ This directive takes one of the above statements as a parameter
*{ In addition BEFORE and AFTER take the name of the menu pad
*{ or menu name to replace as a parameter.
*{ If it knows the PAD NAME based on the parameter, it uses it
*{ otherwise it defaults to the passed parameter
*{ 10/20/93 Directive to identify PADNAME *:PADNAME and POPUP Name *:POPNAME
*{ 10/20/93 Added support for *:TRNTXT directive.
*{ 10/20/93 Fixed problem that occurs under Windows where the project file
*{ contains double backslashes and it shouldn't.
*{ 10/21/93 Added new wordSearch by Ken Levy (JPL) from GENSCRNX 1.7a
*{ 10/22/93 Addition of qualFile from Steve Sawyer to fix bug with relative paths
*{ While Steve's fix didn't completely work, this has been fixed
*{ using stuff found in GENMENU.
*{ 10/22/93 Creation of *:ARRAY directive that will place a Loop for the
*{ the length of the array to create menu items.
*{ 10/23/93 Renamed all TEMPLATE objects into GENSCRNX Style directives.
*{ Removed INSBAR and DEFBAR directives. Doing this changes
*{ the structure of the FOXMNX file slightly.
*{ WHILE GENMENUX will support INSOBJ and DEFOBJ, it doesn't
*{ yet support BASOBJ and its work.
*{ 10/23/93 Added support for DELOBJ which deletes an Object AFTER
*{ menu pre-processing has been done (ie After MNXDRV2)
*{ 10/23/93 Added support for COLOR PAIR with *:COLOR and COLOR SET with *:COLORSET
*{ 10/23/93 Added support for AUTOWIN to allow users to DEFINE WINDOW
*{ with additional clauses by themselves.
*{ 10/23/93 Made POPME accept a clause so the user can define the
*{ IF condition.
*{ 10/24/93 Addition of NOCOMMENT directive that removes all comments
*{ from the generated MPR file. NOCOMMENT is a
*{ CONFIG.FP and Setup directive.
*{ 10/24/93 Addition of INSCX directive (from a suggestion by Mike Feltman)
*{ this directive places the DO MPR clause in the SCX file
*{ specified. If specified with a SAVE option, INSCX will add
*{ PUSH MENU _MSYSMENU to the Code.
*{ 10/25/93 Changes Header notes so that "*** By GENMENUX" only appears once.
*{ Based on an ER by Steve Black (10/25/93)
*{ 10/25/93 Allowed GENMENUX Setup Directives to be called in the top level Menu
*{ Procedure file.
*{ 10/25/93 Removed the AUTOWIN option and added its directives to the WINDOW
*{ directive.
*{ 10/25/93 Cleaned up cleanup code to ensure that jctProjExt would be closed
*{ when it was erased. Bug note by Ken Levy (JPL)
*{ 10/26/93 Turned off Cursor when running application
*{ 10/25/93 GENMENUX now respects the TMPFILES setting in the CONFIG.FP so
*{ Temporary files will be created in the appropriate directories.
*{ 10/26/93 Fixed bug in *:WINDOW that was automatically trying to define the
*{ WINDOW when the directive was used.
*{ 10/26/93 Updated EVLTXT with GENSCRNX 1.7a Version.
*{ 10/27/93 GENMENUX now calls CLEANUP to ensure files are closed and removed properly.
*{ 10/27/93 Fixed temporary project to correctly reference temporary menu file
*{ 10/28/93 Ensures variables are defined as PRIVATE or #DEFINEd
*{ 10/30/93 The following changes are all due to ERs from Ken Levy (JPL)
*{ All PUBLIC Statements have been removed from GENMENUX.
*{ GENMENUX now uses uniqueFlnm to come up with Unique File Names
*{ A Mismatched IF...ENDIF was cleaned up. Wasn't causing problems.
*{ A new directive *:NOTHERM causes GENMENUX to use FoxPro's
*{ normal looking Thermometer instead of the advanced thermometer.
*{ GENMENUX no longer includes my name as part of the comment.
*{ 10/30/93 Cleaned up Thermometer for messages.
*{ 11/01/93 Fixed problem with AUTOHOT that was sometimes making a non
*{ alpha character the hot key.
*{ 11/01/93 Implementation of the POPPRECOMMAND which allows you to
*{ run a command before a popup is defined.
*{ 11/01/93 Cleaned up the calling of the POP Commands to work if called
*{ from within a top level menu.
*{***************************
*{ RELEASE OF VERSION 1.1
*{***************************
*{ 11/12/93 On Line 443, changed code so jcOutFile wouldn't get changed.
*{ 11/12/93 Updated ERRHNDLR to reflect Ken Levy's changes.
*{ 11/16/93 Ensured that directives were CASE-INSENSITIVE
*{ 11/16/93 Added NOACT directive that removes the ACTIVATE MENU option
*{ automatically performed by GENMENUX.
*{ 11/19/93 Updated Re-ordering routine to accomodate popups with similar
*{ or same names.
*{ 11/19/93 Fixed problem with SELECTBAR that was causing invalid syntax
*{ in the MPR file.
*{ 11/19/93 Enhanced IF processing to speed it up (thanks to MS)
*{ 11/20/93 Added the support of Keywords to be used in the *:IF statement
*{ at present (to be expanded later) that allows GENMENUX to put
*{ in the names of the PROMPTS, levels, barnames, and numbers
*{ when highlighted with * as in *PROMPT*
*{ 11/20/93 Enhanced support for the FOUNDATION directive so that any clauses
*{ you add to it are added to the READ.
*{ 11/20/93 Enhanced support for the {{}} clauses by performing an EVLTXT
*{ on the CONFIG.FP, Setup Snippet, Procedure Snippet and each
*{ Comment Snippet before reordering.
*{ 11/20/93 Provided better support for Escape during menu generation.
*{***************************
*{ RELEASE OF VERSION 1.1a
*{***************************
*{ 11/27/93 Put in code that verified type of driver being run ie if MNXDRV2 acted
*{ like a Full MNX driver, then it wouldn't be rerun over and over.
*{ Also message was placed on thermometer for MNXDRV2.
*{ 11/27/93 Verified UPDTHERM procedures so thermometer messages were properly wiped out
*{ under Windows. Previously, they weren't being completely cleared.
*{ 12/6/93 Addition of MNXDRV0 which copies genmenu to a temporary file and
*{ appends functions into it.
*{ 1/5/94 Updates from GENSCRNX to make GENMENUX more environment aware
*{ ER From KL
*{ 1/6/94 Updates from GENSCRNX for better warnings, etc
*{ ER from SMB
*{ 1/28/94 Fixed Problem with Environment Reset (wasn't resetting environment)
*{ 1/28/94 Inserted insRec, and dupRec records from GENSCRNX 1.8 b2
*{ This is cautious because the USER is responsible for making any changes
*{ to the Menu Number, etc.
*{ INSREC is not included because the nature of GENMENU is slightly
*{ different than the nature of GENSCRN.
*{ 1/28/94 Added support for MENUCOLOR directive that adds the COLOR line to the DEFINE
*{ Menu command. This is also supported by the MENUSCHEME directive which provides
*{ SCHEME Support.
*{ 3/19/94 Changed *:ARRAY to not force you to implement the ON SELECTION BAR statement.
*{ Previously, you had to place the action in the array itself.
*{ 03/23/94 Added ccNoPad to comment out the DEFINE PAD statement that overlaps badly when
*{ using the *:IF statement with menu pads.
*{ 04/02/94 Various fixed from ERs and bug reports from Colin Keeler concerning
*{ various syntax errors (whoops! <g>) and using GENMENUX Exclusively
*{ 04/02/94 Fix for *:IF that was only putting the *:IF clause at the very end of the Procedure even if
*{ a return clause was there. Thanks for Eldor for pointing this one out!
*{ 04/02/94 Another fix for *:IF that puts parentheses around the whole *:IF statement to ensure that
*{ the entire clause is used with the IF NOT statement. Thanks for Randy P. for pointing this out!
*{ 04/02/94 Fix by Paul Bienick regarding use of quotations with the POPCOMMAND statement (thanks Paul)
*{ 04/02/94 Laid in basics for a new directive *:CASE that will create a CASE statement for all of the DEFINE
*{ statements for each specific item. If a CASE statement is used, it will create a specific menu
*{ file
*{ 04/02/94 The CASE directive will place all of the items without a CASE statement
*{ at the bottom of the CASE statement so they are used regardless of the logical statement.
*{ 04/04/94 Updated any messages to being calls to the GENSCRNX Warning function
*{ ER from SMB.
*{ 04/06/94 Fixed CASE statement to work properly with Popups and ON PAD statements.
*{ Moved final CASE statement to after the regular menu setups.
*{ 04/06/94 Added *:BEFORE and *:AFTER pads for popups and bars
*{ This directive may be passed with either a numeric or character
*{ (for Bars and Pads respectively) to reorder the appropriate placement
*{ of the menu pads. This is especially useful when using the
*{ CASE statement for individual items
*{ 04/06/94 Added clauses to *:COLOR directives that allow users to identify
*{ the special color settings for Windows.
*{ The clauses are RED, AQUA, GREY, MAROON, GREEN, ROYAL BLUE,
*{ BURGUNDY, LIGHT GREEN, BABY BLUE, BLUE, VIOLET, YELLOW,
*{ DARK GREY
*{ 04/08/94 Added WORDSTUFF, ERROR_HND and ESC_CHECK FROM GENSCRNX 2.0
*{ 04/14/94 Added REFPRG setup directive. This directive will create a separate program
*{ that will refresh any of the menu options with the *:CASE statements
*{ without having to recall the MPR file.
*{ This is done by identifying the BAR where the menu pad is.
*{ This directive makes it easier to refresh the menu bar. A good place
*{ to put it is inside the Foundation Read loop
*{ 04/14/94 Fixed error handler to display proper table name
*{ 04/15/94 Started Beta Testing
*{ 04/16/94 Changed Version No to 2.0 to match with all other GENX Products. Request from SB
*{ 04/21/94 Added New wordsearch and wordstuff functions from GENSCRNX
*{ 04/21/94 Changed all prompts for GENSCRNX to GENMENUX
*{ 04/21/94 Fixed bug with NOXGEN directive
*{ 04/21/94 Allowed IGNORE to properly ignore additional directives
*{ 04/21/94 Sped up *:CASE directive processing
*{ 04/23/94 Added new dfltfld required for wordsearch
*{ 04/23/94 Changed path directives to be more Mac friendly
*{ 04/30/94 Allowed multiple drivers to be called at each level
*{ 04/30/94 Improved ARRAY directive's handling of arrays
*{ 05/03/94 Fixed problem with multiple drivers at MPRlevel 1 and 2
*{ 05/03/94 CASE statement no longer bombs if only one case statement
*{ 05/03/94 PUKE Color statement revised to Khaki (Puke still works tho)
*{ 05/06/94 *:COLOR Keywords now only works with Windows
*{ 05/07/94 Changed DupRec and InsBlank to work properly
*{***************************
*{ RELEASE OF VERSION 2.0
*{***************************
*{ 07/27/94 Fixes for CASE statement to work properly with menus
*{ 07/27/94 Fixes to support EXCLUSIVE setting turned on when dealing with menus
*{ 07/27/94 Fixes to deal with empty menus
*{ 09/01/94 Fixes to allow CONFIG.FP drivers to work properly
*{ 09/15/94 Fix to provide warning if the file m.genmenu is not present
*{ 09/15/94 Created directive called *:VARIABLE which allows menu bar/pad
*{ to be variable driven. Gets called near the end of the process
*{ Thanks to Andy Neil asking for it!
*{***************************
*{ RELEASE OF VERSION 2.0a
*{***************************
*{ 10/28/94 Support for new GENMENU code that supports color scheme
*{ 12/08/94 Cleaned up TMPFILES support
*{ **************************
*{ BETA PERIOD FOR VFP 3.0
*{ **************************
*{ 05/13/95 Fixed bug because of project manager
*{ 05/13/95 Added *:FONT clauses to Comment snippets
*{ to support additional calls by Foxpro
*{ 05/13/95 Added *:CLAUSE directive to support any new calls FoxPro adds on
*{ These are added to the end of the DEFINE xxx statement.
*{ 05/13/95 Added *:SKIP_REDIRECT directive to Setup snippets
*{ This moves the SKIP FOR statements into a special program
*{ that can be called via a DO <procName> IN MPR file
*{ This speeds up menu generation (Thanks Lisa! (hugs <s>)
*{ 05/13/95 In order to accomodate different procedures, GENMENUX will use a
*{ Code Holder cursor to hold the various procedures that it may be
*{ creating while running. SKIP REDIRECT is an example of such a code
*{ holder.
*{ Functions include: UPDCODE and STORECODE
*{ 05/13/95 Removal of GENMENU's LOCFILE statement
*{ This is controlled by the *:NOLOC setup or comment or CONFIG.FP directive
*{ 05/13/95 Inclusion of the SKIP_AUTO directive in the Setup will
*{ force the DO <lcSkipProc> function to be called in the menu cleanup
*{ to handle any SET SKIP statements found in the *:SKIP_REDIR statements
*{ 05/13/95 The directive *:PREDEF allows the user to run a program that returns
*{ text or issue a command right before the DEFINE BAR command
*{ is issued for a particular item
*{ This is useful for setting up variables, etc.
*{ This process is run twice. Once during the first pass through
*{ the next during the last pass through allowing for
*{ other statements to be dropped in.
*{ 05/13/95 GENMENUX is now more open to different Platforms
*{ The directives *:KEYWIN, *:KEYMAC, *:KEYDOS and *:KEYUNIX
*{ all allow the user identify different key labels depending on the
*{ PLATFORM the user is on.
*{ This is done in the first pass so that tools such as AUTOHOT are useful!
*{ To activate this function, place *:XPLATKEYS in the Setup of the menu
*{ of the CONFIG.FP file.
*{ 05/13/95 Version Control directive : *:AUTO_VER
*{ This directive (originally conceived by Matt Peirse) will turn a menu
*{ into a simply command.
*{ If this directive is in the Setup snippet then GENMENU is NEVER called
*{ instead the output goes to the MPR file and it updates a version number
*{ To make use of it in a program, the procedure file should include a
*{ << >> identifier such as
*{ WAIT WINDOW "The version number is "+LTRIM(STR(<<prompt>>))
*{ 05/13/95 DEFCOMMAND is a new Setup directive that allows you to PREDEFINE
*{ global command statements for use within GENMENUX.
*{ It comes in two flavours DEFCOMMAND_ALWAYS and DEFCOMMAND_INCLUDE
*{ ALWAYS replaces existing code
*{ INCLUDE only does it to undefined code
*{ 05/13/95 Directive BASEHDR allows users to identify a program that contains
*{ all of their standard settings for a header.
*{ They can specify this in the CONFIG.FP file
*{ 05/15/95 AUTOVER now works properly and if there is any text in the comment snippet
*{ It will attempt to run it.
*{ Also if in the comment snippet the code called resets the variable _UpdateVersion
*{ to .F., the version number will not be updated
*{ 07/06/95 KEYLAB will update the KEY LABEL statement to a variable as the
*{ menu building does not allow you to do this on your own.
*{***************************
*{ RELEASE OF VERSION 3.0
*{***************************
*{ 09/05/95 Fixes in Reordering menu to account for mixed case menu levels.
*{ Noted by Toni Taylor
PARAMETERS tcProjDbf, tnProjRecno
PRIVATE ALL LIKE j*, l*
*] Definition of Directives
#DEFINE ccDelete "*:DELETE"
#DEFINE ccDelObj "*:DELOBJ"
#DEFINE ccMessage "*:MESSAGE"
#DEFINE ccIgnore "*:IGNORE"
#DEFINE ccMNXDRV1 "*:MNXDRV1"
#DEFINE ccMNXDRV2 "*:MNXDRV2"
#DEFINE ccMNXDRV3 "*:MNXDRV3"
#DEFINE ccMNXDRV4 "*:MNXDRV4"
#DEFINE ccMNXDRV5 "*:MNXDRV5"
#DEFINE ccMPRDRV1 "*:MPRDRV1"
#DEFINE ccMPRDRV2 "*:MPRDRV2"
#DEFINE ccMNXDRV0 "*:MNXDRV0"
#DEFINE ccMMNXDRV0 "_MNXDRV0"
#DEFINE ccmMnxDRV1 "_MNXDRV1"
#DEFINE ccmMnxDRV2 "_MNXDRV2"
#DEFINE ccmMnxDRV3 "_MNXDRV3"
#DEFINE ccmMnxDRV4 "_MNXDRV4"
#DEFINE ccmMnxDRV5 "_MNXDRV5"
#DEFINE ccmMPRDRV1 "_MPRDRV1"
#DEFINE ccmMPRDRV2 "_MPRDRV2"
#DEFINE ccColorSet "*:COLORSET"
#DEFINE ccColor "*:COLOR"
#DEFINE ccMenuName "*:MENUNAME"
#DEFINE ccDefault "*:SYSDEFAULT"
#DEFINE ccRowofStars "******************************************"
#DEFINE ccCaseHdr ccRowOfStars+CHR(13)+[** Menu CASE Statement (GENMENUX 3.0a ]+CHR(13)
#DEFINE ccMenuxHdr CHR(13)+"** Menu Builder Enhancements by GENMENUX 3.0a **"+CHR(13)
#DEFINE ccMenuxNote CHR(13)+"** This file has been modified using "
#DEFINE ccMenuXFtr CHR(13)+"** GENMENUX 3.0a - FoxPro Menu Processor **"+CHR(13)
#DEFINE ccMNXTItle "GENMENUX - FoxPro Menu Processor"
#DEFINE ccMNXVer "Version 3.0a "
#DEFINE ccNoShadow "*:NOSHADOW"
#DEFINE ccNoMargin "*:NOMARGIN"
#DEFINE ccPopColor "*:POPCOLOR"
#DEFINE ccPadColor "*:PADCOLOR"
#DEFINE ccNoPadCol "*:NOPADCOLOR"
#DEFINE ccNoPopCol "*:NOPOPCOLOR"
#DEFINE ccMenuColor "*:MENUCOLOR"
#DEFINE ccMenuScheme "*:MENUSCHEME"
#DEFINE ccNoAuto "*:NOAUTO"
#DEFINE ccAutoHot "*:AUTOHOT"
#DEFINE ccNoPad "*:NOPAD"
#DEFINE ccPopFiles "*:POPFILES"
#DEFINE ccPopField "*:POPFIELD"
#DEFINE ccPopCommand "*:POPCOMMAND"
#DEFINE ccAutoRun "*:AUTORUN ON"
#DEFINE ccNoGen "*:NOGEN"
#DEFINE ccNoxGen "*:NOXGEN"
#DEFINE ccIFDir "*:IF"
#DEFINE ccGenIf "*:GENIF"
#DEFINE ccSysPop "*:SYSPOP"
#DEFINE ccmSysPop "_SYSPOP"
#DEFINE ccPopSys "POP MENU _MSYSMENU"
#DEFINE ccPushSys "PUSH MENU _MSYSMENU"
#DEFINE ccSetSys "SET SYSMENU TO DEFAULT"
#DEFINE ccBarHot "*:BARHOT"
#DEFINE ccMBarHot "_BARHOT"
#DEFINE ccHideMenu "*:HIDE"
#DEFINE ccMHideMenu "_HIDE"
#DEFINE ccAutoAct "*:AUTOACT"
#DEFINE ccMAutoAct "_AUTOACT"
#DEFINE ccFoundation "*:FOUNDATION"
#DEFINE ccMFoundation "_FOUNDATION"
#DEFINE ccPadPos "*:PADPOS"
#DEFINE ccPOPPOS "*:POPPOS"
#DEFINE ccSelectPad "*:SELECTPAD"
#DEFINE ccMSelectPad "_SELECTPAD"
#DEFINE ccVertical "*:VERTICAL"
#DEFINE ccMVertical "_VERTICAL"
#DEFINE ccSelectBar "*:SELECTBAR"
#DEFINE ccMSelectBar "_SELECTBAR"
#DEFINE ccPopTitle "*:POPTITLE"
#DEFINE ccPadName "*:PADNAME"
#DEFINE ccPopName "*:POPNAME"
#DEFINE ccTrnTxt "*:TRNTXT"
#DEFINE ccArray "*:ARRAY"
#DEFINE ccVariable "*:VARIABLE"
#DEFINE ccNoComment "*:NOCOMMENT"
#DEFINE ccMNoComment "_NOCOMMENT"
#DEFINE ccInScx "*:INSCX"
#DEFINE ccPopPreCommand "*:POPPRECOMMAND"
#DEFINE ccPopPreComm "*:POPPRECOMMAND"
#DEFINE ccNoAct "*:NOACT"
#DEFINE ccmNoAct "_NOACT"
#DEFINE ccCase "*:CASE"
#DEFINE ccBefore "*:BEFORE"
#DEFINE ccAfter "*:AFTER"
#DEFINE ccRefPrg "*:REFPRG"
#DEFINE ccMRefPrg "_REFPRG"
#DEFINE ccFont "*:FONT"
#DEFINE ccClause "*:CLAUSE"
#DEFINE ccSkipRedir "*:SKIP_REDIRECT"
#DEFINE ccSkipAuto "*:SKIP_AUTO"
#DEFINE ccNoLoc "*:NOLOC"
#DEFINE ccMNoLoc "_NOLOC"
#DEFINE ccPreDef "*:PREDEF"
#DEFINE ccWinKey "*:KEYWIN"
#DEFINE ccMacKey "*:KEYMAC"
#DEFINE ccUnixKey "*:KEYUNIX"
#DEFINE ccDosKey "*:KEYDOS"
#DEFINE ccWinPrompt
#DEFINE ccDosPrompt
#DEFINE ccUnixPrompt
#DEFINE ccMacPrompt
#DEFINE ccXplatKeys "*:XPLATKEYS"
#DEFINE ccMXPlatKeys "_XPLATKEYS"
#DEFINE ccAutoVer "*:AUTOVERSION"
#DEFINE ccCommAll "*:DEFCOMMAND_ALWAYS"
#DEFINE ccCommInc "*:DEFCOMMAND_INCLUDE"
#DEFINE ccMCommAll "_DEFCOMMAND_ALWAYS"
#DEFINE ccMCommInc "_DEFCOMMAND_INCLUDE"
#DEFINE ccMBaseHdr "_BASEHDR"
#DEFINE ccKeyLab "*:KEYLAB"
*] Menu Template Directives
#DEFINE ccDefLib "*:DEFLIB"
#DEFINE ccMDefLib "_DEFLIB"
#DEFINE ccBasLib "*:BASLIB"
#DEFINE ccMBasLib "_BASLIB"
#DEFINE ccIncLib "*:INCLIB"
#DEFINE ccmIncLib "_INCLIB"
#DEFINE ccInsObj "*:INSOBJ"
#DEFINE ccdefObj "*:DEFOBJ"
#DEFINE ccAutoWin "*:AUTOWIN"
#DEFINE ccAutoPos "*:AUTOPOS"
#DEFINE ccQuickDef "*:DEFPOPIF"
#DEFINE ccLocation "*:LOCATION"
#DEFINE ccNoXTherm "*:NOXTHERM"
#DEFINE ccMNoxTherm "_NOXTHERM"
** Note that these next two are interdependent
** You have to have BAR in order to have a LINE
#DEFINE ccLine "*:LINE"
#DEFINE ccNoBar "*:NOBAR"
#DEFINE ccWindow "*:WINDOW"
*] Menu Object Definitions
#DEFINE ccMenuPad 77
#DEFINE ccMenuComm 67
#DEFINE ccMenuFile 1
#DEFINE ccMenuPopup 2
#DEFINE ccMenuItem 3
#DEFINE ccMenuSubMenu 77
#DEFINE ccMenuProc 80
#DEFINE ccMenuBar 78
*] Default Menu Insertions
#DEFINE ccPadHotKey "ALT+"
#DEFINE ccBarHotKey "CTRL+"
*] Definition of Various objCode Settings
#DEFINE ccSubMenu 77
#DEFINE ccCommand 67
#DEFINE ccProc 80
#DEFINE ccBar 78
*] ASCII Definitions
#DEFINE ccReturn CHR(13)
#DEFINE ccTab CHR(9)
#DEFINE ccNull CHR(0)
#DEFINE ccLineFeed CHR(10 )
#DEFINE ccNewLine ccReturn+ccLineFeed
*] Standard GENMENU Definitions
#DEFINE c_ui_whereisLOC "WHERE is"
*] Definition of Standard statements
#DEFINE ccReadFound "READ "
#DEFINE ccFxColSet "COLOR SCHEME "
#DEFINE ccFxColPair "COLOR "
#DEFINE ccEndIf "ENDIF"+ccReturn + ccReturn
#DEFINE ccIf ccReturn+"IF "
*} Definition of Menu Template File
#DEFINE ccFoxMNX "*:FOXMNX"
#DEFINE ccMFoxMNX "_FOXMNX"
*] Keyword Definitions
#DEFINE ccKeyPrompt "*PROMPT*"
#DEFINE ccKeyName "*NAME*"
#DEFINE ccKeyLevel "*LEVEL*"
#DEFINE ccKeyItem "*ITEMNUM*"
PRIVATE ALL LIKE last*
*{ 1/5/94 - Update from KL
m.lastselect=SELECT()
m.lastsetpath=SET('PATH')
m.lastpoint=SET('POINT')
SET POINT TO '.'
m.lastsetcomp=SET('COMPATIBLE')
SET COMPATIBLE OFF
m.lastsetexac=SET('EXACT')
SET EXACT OFF
m.lastsetsfty=SET('SAFETY')
SET SAFETY OFF
m.lastsetdel=SET('DELETED')
SET DELETED OFF
m.lastsetcry=SET('CARRY')
SET CARRY OFF
m.lastsetnear=SET('NEAR')
SET NEAR OFF
m.lastsetdec=SET('DECIMALS')
SET DECIMALS TO 9
m.lastsetexcl=SET('EXCLUSIVE')
SET EXCLUSIVE OFF
m.lastsetudfp=SET('UDFPARMS')
SET UDFPARMS TO VALUE
m.lastmemow=SET('MEMOWIDTH')
SET MEMOWIDTH TO 255
SET ESCAPE OFF
PRIVATE jgStatus, jWarnings, jPathFox
jgStatus=0
m.jWarnings=0
jPathFox=SYS(2004)
** Some generic variables
lcSkipProc = [SETSKIP]
** Save last message on SayTherm so we can use it to our advantage
PRIVATE lcLastSay
lcLastSay=[]
*] Private of thermometer Variables
PRIVATE gx_graphic,gx_thermWidth
IF _WINDOWS OR _MAC
gx_graphic =.T.
m.gx_thermWidth = 56.269
ELSE
gx_graphic = .F.
m.gx_thermWidth = 55
ENDIF
*] Define Post GENMENU Driver Defaults
lMprDrv1=' '
lMprDrv2=' '
*] Define Refresh Program File
lcRefPrg=[REFMENU.PRG]
jcCurrErr=ON("ERROR")
ON ERROR DO errorhnd WITH ERROR(),MESSAGE(),PROGRAM(),LINENO(),MESSAGE(1)
DIMENSION ja_file_ext(4)
ja_file_ext(1)='.EXE'
ja_file_ext(2)='.APP'
ja_file_ext(3)='.PRG'
ja_file_ext(4)='.FXP'
jfConfigFp=SYS(2019)
IF FILE(jfConfigFp)
jnConfArea=SELECT()
SELECT 0
CREATE CURSOR CONFIGFP (FP M)
INSERT BLANK
APPEND MEMO FP FROM (jfConfigFp) OVERWRITE
REPLACE FP WITH evltxt(FP)
SELECT (jnConfArea)
ELSE
jfConfigFp=''
ENDIF
PRIVATE m.genmenux, m.genmenu, m.autoRun, m.fConfigFp
m.genmenux=IIF(TYPE('_GENMENUX')=='C',UPPER(_GENMENUX),configfp('GENMENUX','ON'))
m.genmenu=add_fext(configfp('_GENMENUX',jPathFox+'GENMENU.PRG'))
m.autorun=IIF(TYPE('_AUTORUN')=='C',UPPER(_AUTORUN),;
configfp('AUTORUN','OFF'))
IF configfp(ccMNoXTherm,"OFF")="ON"
llNoXTherm=.T.
ELSE
llNoXTherm=.F.
ENDIF
*-- We should be in the pjxbase here
*-- Pointing at a menu file
*-- ... but to be safe
SELECT 0
USE ( m.tcProjDbf) ALIAS pjxbase AGAIN SHARED
jcprojpath = SUBSTR(m.tcprojdbf,1,RAT("\",m.tcprojdbf))
lcProjPath= jcProjPath
lcProjFile=TRIM(name)
GOTO tnProjRecNo
jnOldAlias = SELECT()
jcProjAlias = ALIAS()
jnProjRec = RECNO()
*-- A few things we need a lot of....
jcOutfile = ALLTRIM( SUBSTR(outfile,1 ,AT(ccnull,outfile)-1))
jcOutfile = FULLPATH(jcoutfile, jcprojpath)
jcResultFile = STRTRAN( UPPER( jcOutfile), ".MPR", ".MPX")
IF [3.0]$ VERSION()
lcMenuName = STRTRAN( UPPER( TRIM( TRIMPATH ( name))) , [.MNX] )
lcMenuName = UPPER( LEFT( lcMenuName, LEN( lcMenuName) -1 ))
lcOutMain = TRIM( outFile)
lcOutMain = UPPER( LEFT( lcOutMain, LEN( lcOutMain) -1 ))
lcOutMain = ALLTRIM(SUBSTR(outfile,1, AT( ccnull , outfile)-1))
lcOutMain = FULLPATH( lcOutMain, lcProjPath)
IF _MAC AND RIGHT( lcOutMain ,1) = ":"
lcOutMain = lcOutMain + justfname(SUBSTR(outfile,1, AT( ccnull,outfile)-1))
ENDIF
lcMenuName = FULLPATH(ALLTRIM(name), lcProjPath)
IF _MAC AND RIGHT(lcMenuName,1) = ":"
lcMenuName = lcMenuName + justfname(name)
ENDIF
lcMenuBase = basename( lcMenuName )
ELSE
lcMenuName = STRTRAN( UPPER( TRIM( TRIMPATH ( name))) , [.MNX] )
lcMenuName = UPPER( LEFT( lcMenuName, LEN( lcMenuName) -1 ))
lcOutMain = TRIM( TRIMPATH (outFile))
lcOutMain = UPPER( LEFT( lcOutMain, LEN( lcOutMain) -1 ))
lcMenuBase = basename( lcMenuName )
ENDIF
IF '\\'$jcOutFile
jcOutFile=STRTRAN(jcOutFile,'\\','\')
ENDIF
** IF LEN(jcOutFile)>50
** jcOutFile=LEFT(jcOutFile,50)+"..."
** ENDIF
jcWait = "GENMENUX : Menu " + IIF(LEN(jcOutFile)>50,'...'+RIGHT(jcOutfile,41),jcOutFile)
jcCursor=SET("CURSOR")
SET CURSOR OFF
DO actTherm WITH jcWait
DO updTherm WITH 10
*-- Create a temporary project
jcTProj = uniqueFlnm()
jcTProjExt = jcTProj + ".PJX"
** Find out TEMPFILES setting in CONFIG.FP
jcTmpDir=configfp("TMPFILES")
*! Ignoring Mac because this has caused some problems
IF NOT EMPTY(jcTmpDir) AND NOT _MAC
jcTProjExt=jcTmpDir+IIF(RIGHT(jcTmpDir,1)=[\],[],[\])+jcTProjExt
ENDIF
COPY TO ( jcTProjExt) FOR TYPE = "H"
*-- Replace the pointer
GOTO jnProjRec
*-- Copy the menu file to a temp
DO sayTherm WITH "Creating Temporary Files "
jcMaster = TRIM( pjxbase.Name)
IF '\\'$jcMaster
jcMaster=STRTRAN(jcMaster,'\\','\')
ENDIF
IF NOT FILE(jcMaster)
jcMaster= FULLPATH(ALLTRIM(pjxBase.name), lcProjFile)
ENDIF
m.lcMNX_Name=JUSTFNAME(ALLTRIM(pjxBase.name))
jcTName = uniqueFlnm()
jcTNameExt = jcTname + ".MNX"
IF NOT EMPTY(jcTmpDir) AND NOT _MAC
jcTNameExt=jcTmpDir+"\"+jcTNameExt
ENDIF
*{ 1/6/94
** IF NOT FILE(jcMaster) AND FILE(FULLPATH(jcMaster))
** jcMaster=FULLPATH(jcMaster)
** ENDIF
*}
jcMaster=FULLPATH(jcMaster)
** g_mnxfile[1] = FULLPATH(ALLTRIM(name), m.g_projpath)
jcMaster=FULLPATH(jcMaster, m.lcProjPath)
IF '\\'$jcMaster
IF SUBSTR(jcMaster,2,1)==':'
jcMaster=LEFT(jcMaster,2)+'\'+trimpath(jcMaster)
ELSE
jcMaster='\'+trimpath(jcMaster)
ENDIF
ENDIF
*{ 05/13/95 ARMACNEILL
*{ Check in VFP to see if we can restore errors here.
jcErr=ON("ERROR")
ON ERROR notOpened=.T.
notOpened=.F.
SELECT 0
USE (jcMaster) SHARED AGAIN
IF notOpened
USE (FULLPATH(TRIMPATH(jcMaster),CURDIR())) AGAIN SHARED
ENDIF
ON ERROR &jcErr
COPY TO ( jcTNameExt)
USE ( jcTNameExt)
*] Preliminary Setup Directives
GO TOP
** Defaults
IF NOT EMPTY(configfp( ccMBaseHdr,""))
jcText=configfp(ccMBaseHdr)
IF FILE(jcText)
APPEND MEMO setup FROM (jcText )
ENDIF
ENDIF
IF ccAutoVer$ UPPER (setup) OR ccAutoVer $ UPPER (procedure)
** This is the automatic version numbering routine
DO sayTherm WITH "Building build number menu..."
** Let's use it!!!!
SET TEXTMERGE TO (jcOutFile) NOSHOW
SET TEXTMERGE ON
notOpened=.F.
jcErr=ON("ERROR")
ON ERROR notOpened=.T.
SELECT 0
USE (jcMaster) SHARED AGAIN
IF notOpened
USE (FULLPATH(TRIMPATH(jcMaster),CURDIR())) AGAIN SHARED
ENDIF
ON ERROR &jcErr
LOCATE FOR objtype = ccMenuItem
** REPLACE Prompt WITH LTRIM(STR(1 + VAL(prompt)))
_UpdateVersion=.T.
** _UpdateVersion=.T.
*&* >L< change
*&* notice that I am not REPLACing Prompt up-top
IF .F. && Andrew
** run code identified in comment snippet
FOR jni=1 TO MEMLINES(comment)
jcLine=MLINE(comment,jni)
&jcLine
ENDFOR
ELSE && >L< version
IF NOT EMPTY(comment)
* you can add additional stuff to do in here!!
PRIVATE m.proc, m.olderr
m.proc = SYS(3)+".PRG"
DO WHILE FILE(m.proc)
*&* highly unlikely, but <g>...
m.proc = SYS(3)+".PRG"
ENDDO
COPY MEMO comment TO (m.proc)
m.olderr = ON("ERROR")
ON ERROR WAIT WINDOW "Custom Build Error!" NOWAIT
DO (m.proc)
IF FILE(STRTRAN(m.proc,"PRG", "ERR"))
ERASE (STRTRAN(m.proc,"PRG", "ERR"))
WAIT WINDOW "Custom Build procedure had errors!"
*&* yes, there are other ways for the
*&* procedure to fail, but the proc itself
*&* can and should handle its own errors...
ENDIF
ERASE (m.proc)
ERASE (STRTRAN(m.proc,"PRG","FXP"))
ON ERROR &olderr
REPLACE Prompt WITH Prompt
*&* just to make sure it updates with
*&* every build, even if your prg in Comment
*&* forgets to change the MNX directly
*&* and still sets _UpdateVersion to .F.
*&* for some off-the-wall reason...
*&* -- the point here is that we want
*&* AUTO_VER regenerated *on every build*,
*&* that's the guaranteed effect, no matter
*&* what else you figure out to have the Comment do.
*&* I've had it scan through the project and do
*&* tasks completely unrelated to versioning!!
ENDIF
ENDIF
*&*
IF _UpdateVersion
*&* didn't get reset in the Comments procedure
REPLACE Prompt WITH LTRIM(STR(1 + VAL(prompt)))
ENDIF
\ <<procedure>>
\
\<<procedure>>
\
SET TEXTMERGE TO
SET TEXTMERGE OFF
USE
DO cleanup
COMPILE (jcOutFile)
RETURN 0
ENDIF
** Set up CASE Statement variable
llCase=.F.
** llNoXGen contains True/False depending on what is to be updated.
llNoGen=.F.
IF ccNoXGen$setup OR ccNoXGen$PROCEDURE
IF ccNoGen$Setup OR ccNoGen$PROCEDURE
llNoGen=.T.
ELSE
llNoGen=.F.
ENDIF
llnoxGen=.T.
ELSE
llNoXGen=.F.
ENDIF
IF llNoXGen
jcTProj = tcProjDbf
jcTProjExt = tcProjDbf
ENDIF
IF ccNoXTherm$setup OR ccNoXTherm$PROCEDURE
llNoXTherm=.T.
ELSE
IF configfp(ccMNoXTherm,"OFF")="ON"
llNoXTherm=.T.
ELSE
llNoXTherm=.F.
ENDIF
ENDIF
IF ccXplatKeys$ UPPER( setup) OR ccXplatKeys$ UPPER( procedure )
llXPlatKeys=.T.
ELSE
IF configfp(ccMXPlatKeys,"OFF")="ON"
llXPlatKeys =.T.
ELSE
llXPlatKeys =.F.
ENDIF
ENDIF
IF ccRefPrg$setup OR ccRefPrg$PROCEDURE
DO CASE
CASE ccRefPrg$setup
lcRefPrg=wordSearch(ccRefPrg,[setup])
CASE ccRefPrg$Procedure
lcRefPrg=wordSearch(ccRefPrg,[procedure])
ENDCASE
IF lcRefPrg=ccNull OR EMPTY(lcRefPrg)
lcRefPrg=[REFMENU.PRG]
ENDIF
llRefPrg=.T.
ELSE
lcRefPrg=configfp(ccMRefPrg,"OFF")
IF lcRefPrg=[OFF] OR lcRefPrg=ccNull OR EMPTY(lcRefPrg)
llRefPrg=.F.
ELSE
llRefPrg=.T.
ENDIF
ENDIF
IF llRefPrg
IF ATC(".",lcRefPrg)=0
lcRefPrg=FORCEEXT(lcRefPrg,"PRG")
ENDIF
IF FILE(lcRefPrg)
=WARNING([Refresh Menu Program exists. GENMENUX will delete!])
IF FILE(lcRefPrg)