-
Notifications
You must be signed in to change notification settings - Fork 1
/
D2_00_UTIL.TPW
7387 lines (7206 loc) · 286 KB
/
D2_00_UTIL.TPW
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
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#! File Name: D2UTIL.tpw
#! Purpose: Utilites to deal with dictionaries
#! Author: Copyright © 1999-2011 by Roberto Artigas Jr
#! All rights reserved world wide.
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#UTILITY (UTIL_DictionaryFiles, '2002.06.02: [DCT2SQL-UTIL] Print Dictionary Files Overview'), WIZARD
#!--------------------------------------------------------------------
#! Changes:
#! 2002.06.02 Roberto Artigas Jr
#! * Now the utility pops up a wordpad text file rather than printing
#! directly to the printer. Much nicer to preview before you print.
#!--------------------------------------------------------------------
#SHEET
#TAB ('Dictionary Print Wizard')
#DISPLAY('The Dictionary Overview Print Utility.')
#DISPLAY('Copyright 2001-2011 © by Roberto Artigas Jr.')
#DISPLAY('All Rights Reserved World Wide.')
#DISPLAY('')
#DISPLAY('This wizard will generate a report of the contents of your current dictionary.')
#DISPLAY('To specify how you want the report constructed, click on the Next button.')
#ENDTAB
#TAB ('Dictionary Print Wizard - Output File'), FINISH(1)
#DISPLAY('The dictionary report wizard creates a text file, which is then sent to your printer.')
#DISPLAY('')
#DISPLAY('You can, if you wish, have this wizard delete the file when it''s done, or you can keep the file')
#DISPLAY('for later use.')
#DISPLAY('')
#PROMPT ('What do you want to do with the file?', OPTION), %RetainFile
#PROMPT ('I don''t want it. Remove the file after printing.', RADIO)
#PROMPT ('I might need it. Keep the file around.', RADIO)
#ENDTAB
#TAB ('Dictionary Print Wizard - Output File'), WHERE(%RetainFile = 'I might need it. Keep the file around.'), FINISH(1)
#PROMPT ('What name do you want the text file to have?', OPTION), %WhatName
#PROMPT ('Use the dictionary name, with a .TXT extension.', RADIO)
#PROMPT ('Let me supply my own file name.', RADIO)
#ENABLE (%WhatName = 'Let me supply my own file name.')
#PROMPT ('Please enter the name of the text file to be generated.', @S100), %NewName
#ENDENABLE
#PROMPT ('Don''t print this report automatically. I''ll print it from the text file later.', CHECK), %DoNotPrint, AT(10)
#ENDTAB
#TAB ('Dictionary Print Wizard - Reported Files'), FINISH(1)
#DISPLAY('You can report on each file in your dictionary, or you can select individual files to report on.')
#DISPLAY('')
#PROMPT ('Report on all files in my dictionary.', CHECK), %DictionaryReportUseAllFiles, DEFAULT(1), AT(10)
#ENDTAB
#TAB ('Dictionary Print Wizard - Select Reported Files'), WHERE(~%DictionaryReportUseAllFiles), FINISH(1)
#PROMPT ('File Selection', FROM (%File)), %DictionaryReportFileSelection, INLINE, SELECTION('File Selection')
#ENDTAB
#TAB ('Dictionary Print Wizard - Finally...')
#DISPLAY ('This concludes the dictionary report wizard.')
#DISPLAY ('Click on the Finish button to generate the text file.')
#ENDTAB
#ENDSHEET
#!#BOXED('Hide')
#! #BUTTON('Processed Files'),MULTI(%DoTheseFiles, %DoFilePrefix & ' ' & %DoFileName & ' ' & %DoFile),INLINE
#! #PROMPT('File Prefix: ',@s10),%DoFilePrefix,UNIQUE,REQ
#! #PROMPT('Global Name Area: ',@s20),%DoFileName,REQ
#! #PROMPT('File Name: ',@s30),%DoFile,REQ
#! #ENDBUTTON
#!#ENDBOXED
#!--------------------------------------------------------------------
#DECLARE(%OutputFile)
#DECLARE(%ReportedFiles),UNIQUE
#DECLARE(%WorkString)
#DECLARE(%CountFiles)
#DECLARE(%DoTheseFiles),UNIQUE
#DECLARE(%DoFilePrefix,%DoTheseFiles)
#DECLARE(%DoFileName,%DoTheseFiles)
#DECLARE(%DoFile,%DoTheseFiles)
#DECLARE(%DoFileDescription,%DoTheseFiles) #! RAS.2003.07.22
#!--------------------------------------------------------------------
#IF (%WhatName = 'Use the dictionary name, with a .TXT extension.')
#SET (%OutputFile, SUB(%DictionaryFile, 1, LEN(%DictionaryFile) - 3) & 'TXT')
#ELSE
#SET (%OutputFile, %NewName)
#ENDIF
#!--------------------------------------------------------------------
#IF (%DictionaryReportUseAllFiles)
#FOR (%File)
#ADD (%ReportedFiles, %File)
#ENDFOR
#ELSE
#FOR (%DictionaryReportFileSelection)
#ADD (%ReportedFiles, %DictionaryReportFileSelection)
#ENDFOR
#ENDIF
#!--------------------------------------------------------------------
#SET(%CountFiles,0)
#FOR (%ReportedFiles)
#FIX(%File,%ReportedFiles)
#SET(%CountFiles,%CountFiles + 1)
#ADD(%DoTheseFiles, %CountFiles)
#SET(%DoFilePrefix, %FilePrefix)
#SET(%DoFileName, %FileName)
#SET(%DoFile, %File)
#!SET(%DoFileDescription, '[' & %FileDriver & '] ' & %FileDescription) #! RAS.2003.07.22
#SET(%DoFileDescription, %FileDescription) #! RAS.2019.07.14
#ENDFOR
#!--------------------------------------------------------------------
#EQUATE (%DoSort,1)
#EQUATE (%I,0)
#EQUATE (%W1FilePrefix,'')
#EQUATE (%W1FileName,'')
#EQUATE (%W1File,'')
#EQUATE (%W1FileDescription,'') #! RAS.2003.07.22
#EQUATE (%W2FilePrefix,'')
#EQUATE (%W2FileName,'')
#EQUATE (%W2File,'')
#EQUATE (%W2FileDescription,'') #! RAS.2003.07.22
#LOOP,WHILE(%DoSort)
#SET(%DoSort,0)
#LOOP,FOR(%I,2,ITEMS(%DoTheseFiles))
#SELECT(%DoTheseFiles,%I-1)
#SET(%W1FilePrefix,%DoFilePrefix)
#SET(%W1FileName,%DoFileName)
#SET(%W1File,%DoFile)
#SET(%W1FileDescription,%DoFileDescription) #! RAS.2003.07.22
#SELECT(%DoTheseFiles,%I)
#SET(%W2FilePrefix,%DoFilePrefix)
#SET(%W2FileName,%DoFileName)
#SET(%W2File,%DoFile)
#SET(%W2FileDescription,%DoFileDescription) #! RAS.2003.07.22
#IF(%W1FilePrefix > %W2FilePrefix)
#SET(%DoSort,1)
#SET(%DoFilePrefix,%W1FilePrefix)
#SET(%DoFileName,%W1FileName)
#SET(%DoFile,%W1File)
#SET(%DoFileDescription,%W1FileDescription) #! RAS.2003.07.22
#SELECT(%DoTheseFiles,%I-1)
#SET(%DoFilePrefix,%W2FilePrefix)
#SET(%DoFileName,%W2FileName)
#SET(%DoFile,%W2File)
#SET(%DoFileDescription,%W2FileDescription) #! RAS.2003.07.22
#ENDIF
#ENDLOOP
#ENDLOOP
#!--------------------------------------------------------------------
#CREATE (%OutputFile)
#SET(%WorkString,'Dictionary Files Report')
%[54]WorkString Date: %@D010@(TODAY())
%[54]DictionaryFile Time: %@T04@(CLOCK())
#!#INSERT(%DictionaryFilesHeader)
#!--------------------------------------------------------------------
#SET(%CountFiles,0)
#FOR(%DoTheseFiles)
#FIX(%File,%DoFileName)
#IF((%CountFiles % 20) = 0)
#INSERT(%DictionaryFilesHeader)
#ENDIF
#SET(%CountFiles,%CountFiles + 1)
%@N03@(%CountFiles) %[8]DoFilePrefix %[50]DoFileName %[50]DoFile %DoFileDescription
#ENDFOR
#!--------------------------------------------------------------------
#INSERT(%DictionaryFilesHeader)
#CLOSE (%OutputFile)
#!--------------------------------------------------------------------
#IF (~%DoNotPrint)
#RUN('NOTEPAD.EXE "' & %OutputFile & '"')
#ENDIF
#IF (%RetainFile = 'I don''t want it. Remove the file after printing.')
#REMOVE (%OutputFile)
#ENDIF
#!--------------------------------------------------------------------
#GROUP(%DictionaryFilesHeader),AUTO
#EQUATE(%HFilePrefix,'PREFIX')
#EQUATE(%HFileName,'GLOBAL AREA')
#EQUATE(%HFile,'FILE NAME')
#EQUATE(%HFileDescription, 'DESCRIPTION')
SEQ %[8]HFilePrefix %[50]HFileName %[50]HFile %HFileDescription
#GROUP(%DictionaryFilesHeaderEnd)
#!--------------------------------------------------------------------
#GROUP(%UTILDictionaryFilesEnd)
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#UTILITY (UTIL_FieldTableXref, '2002.10.27: [DCT2SQL-UTIL] Print Fields to Table XREF')
#!--------------------------------------------------------------------
#! Changes:
#! 2002.10.27 Roberto Artigas Jr
#! * Now outputing field picture and field type.
#! * Set in between divider between columns prompt now suported.
#! 2002.08.27 Roberto Artigas Jr
#! * Added the field picture to the field name to make it easier to deal
#! with checking dictionary fields matching for types.
#!--------------------------------------------------------------------
#SHEET,HSCROLL
#TAB('General')
#BOXED('')
#DISPLAY('The Field to Table XREF Utility.')
#DISPLAY('Copyright 2001-2011 © by Roberto Artigas Jr.')
#DISPLAY('All Rights Reserved World Wide.')
#DISPLAY('')
#PROMPT('Output: ',@S80),%OutputFile,AT(50,,130),DEFAULT(SUB(%DictionaryFile,1,LEN(%DictionaryFile)-4) & '.fxf')
#DISPLAY('')
#PROMPT('Set in between column divider at: ',@n4),%AtColPos,AT(150,,30),DEFAULT(40)
#ENDBOXED
#ENDTAB
#ENDSHEET
#!--------------------------------------------------------------------
#DECLARE(%FieldTableList),MULTI,UNIQUE
#!
#DECLARE(%CountFiles ,LONG) #! File Counter
#DECLARE(%nLoc1 ,LONG) #! Location 1
#DECLARE(%nLoc2 ,LONG) #! Location 2
#DECLARE(%WorkString) #! Working String
#DECLARE(%WorkLine) #! Formated String
#DECLARE(%NFieldName) #! Field name
#!
#DECLARE(%NFileUser) #! File user options [RASQL]
#DECLARE(%NFileOpt1) #! File option 1 [NO]
#DECLARE(%NFileOpt2) #! File option 2 [ISAM|MYISAM|HEAP|MERGE|DBD|GEMINI|INNODB|MRG_MYISAM]
#DECLARE(%NFileOpt3) #! File option 3 [DEFAULT|DYNAMIC|STATIC|COMPRESSED]
#DECLARE(%NFileOpt4) #! File option 4
#!
#DECLARE(%NFieldUser) #! Field user options [RASQL]
#DECLARE(%NFieldOpt1) #! Field option 1 [NO]
#DECLARE(%NFieldOpt2) #! Field option 2 [<Field Type>]
#DECLARE(%NFieldOpt3) #! Field option 3 [PKEYA+AUTO+NOTNULL]
#DECLARE(%NFieldOpt4) #! Field option 4
#!--------------------------------------------------------------------
#CREATE(%OutputFile)
#MESSAGE('The Field to Table XREF Utility',0)
#MESSAGE('Creating: ' & %OutputFile,1)
#!---------------------------------------------------------------------
#FOR(%File)
#!----------------------------------------------------------------!
#! RAS.2001.12.01 - Ignore file place marker definitions. !
#! These are files that are defined but that contain no fields. !
#!----------------------------------------------------------------!
#IF(NOT ITEMS(%Field)) #! RAS.2001.12.01
#CYCLE #! RAS.2001.12.01
#ENDIF #! RAS.2001.12.01
#SET(%nLoc1,INSTRING('RASQL(',%FileUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FileUserOptions,1,%nLoc1))
#SET(%nFileUser,UPPER(SUB(%FileUserOptions,%nLoc1,%nLoc2)))
#SET(%NFileOpt1,EXTRACT(%NFileUser,'RASQL',1))
#SET(%NFileOpt2,EXTRACT(%NFileUser,'RASQL',2))
#SET(%NFileOpt3,EXTRACT(%NFileUser,'RASQL',3))
#SET(%NFileOpt4,EXTRACT(%NFileUser,'RASQL',4))
#!-------------------------------------------------------------!
#! The first option RASQL(NO) controls if a file is processed. !
#!-------------------------------------------------------------!
#IF(SUB(%NFileOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#CASE(%FileType)
#OF ('VIEW')
#OROF('ALIAS')
#CYCLE
#ENDCASE
#!
#CASE(%FileDriver)
#OF('ASCII')
#OROF('BASIC')
#OROF('DOS')
#CYCLE
#ENDCASE
#!
#MESSAGE('Table of: ' & %File,2) #! RAS.2001.12.15
#!
#FOR(%Field)
#SET(%nLoc1,INSTRING('RASQL(',%FieldUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FieldUserOptions,1,%nLoc1))
#SET(%nFieldUser,UPPER(SUB(%FieldUserOptions,%nLoc1,%nLoc2)))
#SET(%NFieldOpt1,EXTRACT(%NFieldUser,'RASQL',1))
#SET(%NFieldOpt2,EXTRACT(%NFieldUser,'RASQL',2))
#SET(%NFieldOpt3,EXTRACT(%NFieldUser,'RASQL',3))
#SET(%NFieldOpt4,EXTRACT(%NFieldUser,'RASQL',4))
#IF(SUB(%NFieldOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#IF(%FieldType='GROUP')
#CYCLE
#ENDIF
#!
#IF(%FieldType='END')
#CYCLE
#ENDIF
#!
#SET(%NFieldName, %FieldID)
#SET(%NFieldName, %NFieldName & ' (' & %FieldPicture & ',' & %FieldType & ')')
#SET(%WorkLine, %NFieldName & ALL(' ', %AtColPos - LEN(%NFieldName)) & ' ==> ' & %File)
#ADD(%FieldTableList, %WorkLine)
#ENDFOR
#ENDFOR
#!---------------------------------------------------------------------
#SET(%WorkString,'Field to Table Cross Reference')
%[54]WorkString Date: %@D010@(TODAY())
%[54]DictionaryFile Time: %@T04@(CLOCK())
#SET(%CountFiles,0)
#FOR(%FieldTableList)
#IF((%CountFiles % 20) = 0)
#INSERT(%FieldTableXrefHeader)
#ENDIF
#SET(%CountFiles,%CountFiles + 1)
%@N4@(%CountFiles) %FieldTableList
#ENDFOR
#INSERT(%FieldTableXrefHeader)
#!---------------------------------------------------------------------
#CLOSE(%OutputFile)
#RUN('NOTEPAD.EXE "' & %OutputFile & '"')
#!--------------------------------------------------------------------
#GROUP(%FieldTableXrefHeader),AUTO
#EQUATE(%HKeyField,'FIELD NAME')
#EQUATE(%HFileName,'TABLE NAME')
ITEM %[%AtColPos]HKeyField ==> %[30]HFileName
#GROUP(%FieldTableXrefHeaderEnd)
#!--------------------------------------------------------------------
#GROUP(%UTILFieldTableXrefEnd)
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#UTILITY (UTIL_KeyFieldTableXref, '2002.10.27: [DCT2SQL-UTIL] Print Key Fields to Table XREF')
#!--------------------------------------------------------------------
#! Changes:
#! 2002.10.27 Roberto Artigas Jr
#! * Now outputing field picture and field type.
#! * Set in between divider between columns prompt now suported.
#! 2002.08.27 Roberto Artigas Jr
#! * Added the field picture to the field name to make it easier to deal
#! with checking dictionary primary key and foreign keys being longs.
#!--------------------------------------------------------------------
#SHEET,HSCROLL
#TAB('General')
#BOXED('')
#DISPLAY('The Key Field to Table XREF Utility.')
#DISPLAY('Copyright 2001-2011 © by Roberto Artigas Jr.')
#DISPLAY('All Rights Reserved World Wide.')
#DISPLAY('')
#PROMPT('Output: ',@S80),%OutputFile,AT(50,,130),DEFAULT(SUB(%DictionaryFile,1,LEN(%DictionaryFile)-4) & '.kxf')
#DISPLAY('')
#PROMPT('Set in between column divider at: ',@n4),%AtColPos,AT(150,,30),DEFAULT(40)
#DISPLAY('')
#ENDBOXED
#ENDTAB
#ENDSHEET
#!--------------------------------------------------------------------
#DECLARE(%FieldTableList),MULTI,UNIQUE
#!
#DECLARE(%CountFiles ,LONG) #! File Counter
#DECLARE(%nLoc1 ,LONG) #! Location 1
#DECLARE(%nLoc2 ,LONG) #! Location 2
#DECLARE(%WorkString) #! Working String
#DECLARE(%WorkLine) #! Formated String
#DECLARE(%NKeyName) #! Key name
#DECLARE(%NKeyField) #! Key field current
#!
#DECLARE(%NFileUser) #! File user options [RASQL]
#DECLARE(%NFileOpt1) #! File option 1 [NO]
#DECLARE(%NFileOpt2) #! File option 2 [ISAM|MYISAM|HEAP|MERGE|DBD|GEMINI|INNODB|MRG_MYISAM]
#DECLARE(%NFileOpt3) #! File option 3 [DEFAULT|DYNAMIC|STATIC|COMPRESSED]
#DECLARE(%NFileOpt4) #! File option 4
#!
#DECLARE(%NKeyUser) #! Key user options [RASQL]
#DECLARE(%NKeyOpt1) #! Key option 1 [NO]
#DECLARE(%NKeyOpt2) #! Key option 2 [PKEYA|SKEYA]
#DECLARE(%NKeyOpt3) #! Key option 3
#DECLARE(%NKeyOpt4) #! Key option 4
#!--------------------------------------------------------------------
#CREATE(%OutputFile)
#MESSAGE('The Key Field to Table XREF Utility',0)
#MESSAGE('Creating: ' & %OutputFile,1)
#!---------------------------------------------------------------------
#FOR(%File)
#!----------------------------------------------------------------!
#! RAS.2001.12.01 - Ignore file place marker definitions. !
#! These are files that are defined but that contain no fields. !
#!----------------------------------------------------------------!
#IF(NOT ITEMS(%Field)) #! RAS.2001.12.01
#CYCLE #! RAS.2001.12.01
#ENDIF #! RAS.2001.12.01
#SET(%nLoc1,INSTRING('RASQL(',%FileUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FileUserOptions,1,%nLoc1))
#SET(%nFileUser,UPPER(SUB(%FileUserOptions,%nLoc1,%nLoc2)))
#SET(%NFileOpt1,EXTRACT(%NFileUser,'RASQL',1))
#SET(%NFileOpt2,EXTRACT(%NFileUser,'RASQL',2))
#SET(%NFileOpt3,EXTRACT(%NFileUser,'RASQL',3))
#SET(%NFileOpt4,EXTRACT(%NFileUser,'RASQL',4))
#!-------------------------------------------------------------!
#! The first option RASQL(NO) controls if a file is processed. !
#!-------------------------------------------------------------!
#IF(SUB(%NFileOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#CASE(%FileType)
#OF ('VIEW')
#OROF('ALIAS')
#CYCLE
#ENDCASE
#!
#CASE(%FileDriver)
#OF('ASCII')
#OROF('BASIC')
#OROF('DOS')
#CYCLE
#ENDCASE
#!
#MESSAGE('Table of: ' & %File,2) #! RAS.2001.12.15
#!
#IF(ITEMS(%Key))
#FOR(%Key)
#IF(NOT ITEMS(%KeyField)) #! Key has fields? No!
#CYCLE #! Then go to the next
#ENDIF #! key to be processed
#!
#SET(%nLoc1,INSTRING('RASQL(',%KeyUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%KeyUserOptions,1,%nLoc1))
#SET(%nKeyUser,UPPER(SUB(%KeyUserOptions,%nLoc1,%nLoc2)))
#SET(%NKeyOpt1,EXTRACT(%NKeyUser,'RASQL',1))
#SET(%NKeyOpt2,EXTRACT(%NKeyUser,'RASQL',2))
#SET(%NKeyOpt3,EXTRACT(%NKeyUser,'RASQL',3))
#SET(%NKeyOpt4,EXTRACT(%NKeyUser,'RASQL',4))
#!------------------------------------------------------------!
#! The first option RASQL(NO) controls if a key is processed. !
#!------------------------------------------------------------!
#IF(SUB(%NKeyOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#SET(%NKeyName,%KeyID)
#FOR(%KeyField)
#SET(%NKeyField, SUB(%KeyField, INSTRING(':',%KeyField,1,1) + 1 , 50))
#FIX(%Field,%KeyField)
#SET(%NKeyField, %NKeyField & ' (' & %FieldPicture & ',' & %FieldType & ')')
#!ADD(%FieldTableList, %NKeyField & ' ==> ' & %File)
#SET(%WorkLine, %NKeyField & ALL(' ', %AtColPos - LEN(%NKeyField)) & ' ==> ' & %File)
#ADD(%FieldTableList, %WorkLine)
#ENDFOR
#ENDFOR
#ENDIF
#ENDFOR
#!---------------------------------------------------------------------
#SET(%WorkString,'Key Field to Table Cross Reference')
%[54]WorkString Date: %@D010@(TODAY())
%[54]DictionaryFile Time: %@T04@(CLOCK())
#SET(%CountFiles,0)
#FOR(%FieldTableList)
#IF((%CountFiles % 20) = 0)
#INSERT(%KeyFieldTableXrefHeader)
#ENDIF
#SET(%CountFiles,%CountFiles + 1)
%@N4@(%CountFiles) %FieldTableList
#ENDFOR
#INSERT(%KeyFieldTableXrefHeader)
#!---------------------------------------------------------------------
#CLOSE(%OutputFile)
#RUN('NOTEPAD.EXE "' & %OutputFile & '"')
#!--------------------------------------------------------------------
#GROUP(%KeyFieldTableXrefHeader),AUTO
#EQUATE(%HKeyField,'KEY FIELD')
#EQUATE(%HFileName,'TABLE NAME')
ITEM %[%AtColPos]HKeyField ==> %[30]HFileName
#GROUP(%KeyFieldTableXrefHeaderEnd)
#!--------------------------------------------------------------------
#GROUP(%UTILKeyFieldTableXrefEnd)
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#!--------------------------------------------------------------------
#UTILITY (UTIL_PK_Auto_Exists, '2007.04.19: [DCT2SQL-UTIL] Does a Primary Key Auto-Increment exist? ')
#!--------------------------------------------------------------------
#! Changes:
#! RA.2007.04.19 Roberto Artigas
#! * Added RAWEB(NO) option so certain files can be ignore by this utility.
#! RA.2007.04.04 Roberto Artigas
#! * Error message added if primary key has more than one field
#!--------------------------------------------------------------------
#SHEET,HSCROLL
#TAB('General')
#BOXED('')
#DISPLAY('Auto-Increment Primary Key LONG checker.')
#DISPLAY('Copyright 2001-2011 © by Roberto Artigas Jr.')
#DISPLAY('All Rights Reserved World Wide.')
#DISPLAY('')
#PROMPT('Output: ',@S80),%OutputFile,AT(50,,130),DEFAULT(SUB(%DictionaryFile,1,LEN(%DictionaryFile)-4) & '.pkx')
#DISPLAY('')
#PROMPT('Set in between column divider at: ',@n4),%AtColPos,AT(150,,30),DEFAULT(30)
#DISPLAY('')
#ENDBOXED
#ENDTAB
#ENDSHEET
#!--------------------------------------------------------------------
#DECLARE(%FieldTableList),MULTI,UNIQUE
#!
#DECLARE(%CountFiles ,LONG) #! File Counter
#DECLARE(%nLoc1 ,LONG) #! Location 1
#DECLARE(%nLoc2 ,LONG) #! Location 2
#DECLARE(%WorkString) #! Working String
#DECLARE(%WorkLine) #! Formated String
#DECLARE(%NKeyName) #! Key name
#DECLARE(%NKeyField) #! Key field current
#DECLARE(%NKeyAuto) #! Auto Increment field
#DECLARE(%nFindPK) #! Found a primary key
#DECLARE(%nCntFlds) #! Count fields in primary key
#!
#DECLARE(%NFileUser) #! File user options [RASQL]
#DECLARE(%NFileOpt1) #! File option 1 [NO]
#DECLARE(%NFileOpt2) #! File option 2 [ISAM|MYISAM|HEAP|MERGE|DBD|GEMINI|INNODB|MRG_MYISAM]
#DECLARE(%NFileOpt3) #! File option 3 [DEFAULT|DYNAMIC|STATIC|COMPRESSED]
#DECLARE(%NFileOpt4) #! File option 4
#!
#DECLARE(%NKeyUser) #! Key user options [RASQL]
#DECLARE(%NKeyOpt1) #! Key option 1 [NO]
#DECLARE(%NKeyOpt2) #! Key option 2 [PKEYA|SKEYA]
#DECLARE(%NKeyOpt3) #! Key option 3
#DECLARE(%NKeyOpt4) #! Key option 4
#!
#EQUATE (%ErrFileNoFields ,'File has no fields')
#EQUATE (%ErrFileType ,'File is of a file type = ')
#EQUATE (%ErrFileDriver ,'File is of a driver type = ')
#EQUATE (%ErrFileNoKeys ,'File has no keys')
#EQUATE (%ErrFileNoPK ,'File has no primary key')
#EQUATE (%ErrKeyOnePlus ,'Primary Key has more than one field')
#!--------------------------------------------------------------------
#CREATE(%OutputFile)
#MESSAGE('Does a Primary Key Auto-Increment exist?',0)
#MESSAGE('Creating: ' & %OutputFile,1)
#!---------------------------------------------------------------------
#FOR(%File)
#MESSAGE('Table of: ' & %File,2) #! RAS.2001.12.15
#! #ERROR(%File)
#! #ERROR(LEN(%File))
#!
#SET(%nLoc1,INSTRING('RAWEB(',%FileUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FileUserOptions,1,%nLoc1))
#SET(%nFileUser,UPPER(SUB(%FileUserOptions,%nLoc1,%nLoc2)))
#SET(%NFileOpt1,EXTRACT(%NFileUser,'RAWEB',1))
#SET(%NFileOpt2,EXTRACT(%NFileUser,'RAWEB',2))
#SET(%NFileOpt3,EXTRACT(%NFileUser,'RAWEB',3))
#SET(%NFileOpt4,EXTRACT(%NFileUser,'RAWEB',4))
#!-------------------------------------------------------------!
#! The first option RAWEB(NO) controls if a file is processed. !
#!-------------------------------------------------------------!
#IF(SUB(%NFileOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#CASE(%FileType)
#OF ('VIEW')
#OROF('ALIAS')
#! File has wrong file type
#! #SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrFileType & %FileType)
#! #ADD(%FieldTableList, %WorkLine)
#CYCLE
#ENDCASE
#!
#CASE(%FileDriver)
#OF('ASCII')
#OROF('BASIC')
#OROF('DOS')
#! File has wrong driver
#! #SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrFileDriver & %FileDriver)
#! #ADD(%FieldTableList, %WorkLine)
#CYCLE
#ENDCASE
#!
#!----------------------------------------------------------------!
#! RAS.2001.12.01 - Ignore file place marker definitions. !
#! These are files that are defined but that contain no fields. !
#!----------------------------------------------------------------!
#IF(NOT ITEMS(%Field)) #! RAS.2001.12.01
#! File has no fields
#SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrFileNoFields)
#ADD(%FieldTableList, %WorkLine)
#CYCLE #! RAS.2001.12.01
#ENDIF #! RAS.2001.12.01
#!
#SET(%nFindPK,0) #! No Primary Key Yet
#IF(ITEMS(%Key))
#FOR(%Key)
#SET(%NKeyName,%KeyID)
#SET(%nCntFlds,0) #! Count fields
#!
#FOR(%KeyField)
#IF(%KeyPrimary)
#SET(%nFindPk,1) #! Found Primary Key (YES!)
#SET(%nCntFlds,%nCntFlds+1) #! Increment field count
#SET(%NKeyField, SUB(%KeyField, INSTRING(':',%KeyField,1,1) + 1 , 150))
#SET(%NKeyAuto, SUB(%KeyAuto, INSTRING(':',%KeyAuto ,1,1) + 1 , 150))
#FIX(%Field,%KeyField)
#SET(%NKeyField, '[' & %NKeyAuto & ']' & %NKeyField & ' (' & %FieldPicture & ',' & %FieldType & ') ' & %NKeyName)
#!ADD(%FieldTableList, %NKeyField & ' ==> ' & %File)
#SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %NKeyField)
#ADD(%FieldTableList, %WorkLine)
#ENDIF
#ENDFOR
#ENDFOR
#ELSE
#! File has no keys
#SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrFileNoKeys)
#ADD(%FieldTableList, %WorkLine)
#CYCLE
#ENDIF
#IF(NOT %nFindPK)
#! No primary key found
#SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrFileNoPK)
#ADD(%FieldTableList, %WorkLine)
#ENDIF
#IF(%nCntFlds > 1)
#! Primary Key has more than one field
#SET(%WorkLine, %File & ALL(' ', %AtColPos - LEN(%File)) & ' ==> ' & %ErrKeyOnePlus)
#ADD(%FieldTableList, %WorkLine)
#ENDIF
#ENDFOR
#!---------------------------------------------------------------------
#SET(%WorkString,'Does a Primary Key Auto-Increment exist?')
%[54]WorkString Date: %@D010@(TODAY())
%[54]DictionaryFile Time: %@T04@(CLOCK())
#SET(%CountFiles,0)
#FOR(%FieldTableList)
#IF((%CountFiles % 20) = 0)
#INSERT(%UTILPKAutoExistsHeader)
#ENDIF
#SET(%CountFiles,%CountFiles + 1)
%@N4@(%CountFiles) %FieldTableList
#ENDFOR
#INSERT(%UTILPKAutoExistsHeader)
#!---------------------------------------------------------------------
#CLOSE(%OutputFile)
#RUN('NOTEPAD.EXE "' & %OutputFile & '"')
#!--------------------------------------------------------------------
#GROUP(%UTILPKAutoExistsHeader),AUTO
#EQUATE(%HKeyField,'TABLE-NAME')
#EQUATE(%HFileName,'[AUTO-FIELD] KEY-FIELD (PICTURE,TYPE) KEY-NAME')
ITEM %[%AtColPos]HKeyField ==> %[30]HFileName
#GROUP(%UTILPKAutoExistsHeaderEnd)
#!--------------------------------------------------------------------
#GROUP(%UTILPKAutoExistsEnd)
#!--------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#!---------------------------------------------------------------------
#UTILITY (UTIL_DictionaryFiles2, '2010.11.11: [DCT2SQL-UTIL] Print Dictionary Files-Fields NetTalk-Checkover'), WIZARD
#!--------------------------------------------------------------------
#! Changes:
#! 2010.11.11 Roberto Artigas
#! * ADded check in BOOLEAN for empty TRUE/FALSE values.
#! 2007.04.19 Roberto Artigas
#! * Added RAWEB(NO) option so certain files can be ignore by this utility.
#! 2007.04.04 Roberto Artigas
#! * Check for single quotes in hell tooltip and help message
#! * Do not process ALIAS'es
#! 2007.03.23 Roberto Artigas
#! * Added checking for missing HELP stuff.
#! * Make checking of HELP stuff optional.
#! 2007.03.20 Roberto Artigas
#! * Make checking of TABs optional
#! 2007.03.10 Roberto Artigas
#! * Added #PREPARE section to sort the tables when being selected
#! 2002.06.02 Roberto Artigas
#! * Now the utility pops up a wordpad text file rather than printing
#! directly to the printer. Much nicer to preview before you print.
#!--------------------------------------------------------------------
#PREPARE
#DECLARE(%appTables),UNIQUE
#!
#DECLARE(%nLoc1 ,LONG) #! Location 1
#DECLARE(%nLoc2 ,LONG) #! Location 2
#DECLARE(%NFileUser) #! File user options [RAWEB]
#DECLARE(%NFileOpt1) #! File option 1 [NO]
#DECLARE(%NFileOpt2) #! File option 2
#DECLARE(%NFileOpt3) #! File option 3
#DECLARE(%NFileOpt4) #! File option 4
#!
#FOR(%File)
#!----------------------------------------------------------------!
#! RAS.2001.12.01 - Ignore file place marker definitions. !
#! These are files that are defined but that contain no fields. !
#!----------------------------------------------------------------!
#IF(NOT ITEMS(%Field))
#CYCLE
#ENDIF
#SET(%nLoc1,INSTRING('RAWEB(',%FileUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FileUserOptions,1,%nLoc1))
#SET(%nFileUser,UPPER(SUB(%FileUserOptions,%nLoc1,%nLoc2)))
#SET(%NFileOpt1,EXTRACT(%NFileUser,'RAWEB',1))
#SET(%NFileOpt2,EXTRACT(%NFileUser,'RAWEB',2))
#SET(%NFileOpt3,EXTRACT(%NFileUser,'RAWEB',3))
#SET(%NFileOpt4,EXTRACT(%NFileUser,'RAWEB',4))
#!-------------------------------------------------------------!
#! The first option RAWEB(NO) controls if a file is processed. !
#!-------------------------------------------------------------!
#IF(SUB(%NFileOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#CASE(%FileType)
#OF ('VIEW')
#OROF('ALIAS')
#CYCLE
#ENDCASE
#!
#CASE(%FileDriver)
#OF('ASCII')
#OROF('BASIC')
#OROF('DOS')
#CYCLE
#ENDCASE
#!
#ADD(%appTables, %File)
#ENDFOR
#ENDPREPARE
#SHEET
#TAB ('Dictionary Print Wizard')
#DISPLAY('The Dictionary Overview Print Utility.')
#DISPLAY('Copyright 2001-2011 © by Roberto Artigas Jr.')
#DISPLAY('All Rights Reserved World Wide.')
#DISPLAY('')
#DISPLAY('This wizard will generate a report of the contents of your current dictionary.')
#DISPLAY('To specify how you want the report constructed, click on the Next button.')
#ENDTAB
#TAB ('Dictionary Print Wizard - Output File'), FINISH(1)
#DISPLAY('The dictionary report wizard creates a text file, which is then sent to your printer.')
#DISPLAY('')
#DISPLAY('You can, if you wish, have this wizard delete the file when it''s done, or you can keep the file')
#DISPLAY('for later use.')
#DISPLAY('')
#PROMPT ('What do you want to do with the file?', OPTION), %RetainFile
#PROMPT ('I don''t want it. Remove the file after printing.', RADIO)
#PROMPT ('I might need it. Keep the file around.', RADIO)
#ENDTAB
#TAB ('Dictionary Print Wizard - Output File'), WHERE(%RetainFile = 'I might need it. Keep the file around.'), FINISH(1)
#PROMPT ('What name do you want the text file to have?', OPTION), %WhatName
#PROMPT ('Use the dictionary name, with a .TXT extension.', RADIO)
#PROMPT ('Let me supply my own file name.', RADIO)
#ENABLE (%WhatName = 'Let me supply my own file name.')
#PROMPT ('Please enter the name of the text file to be generated.', @S100), %NewName
#ENDENABLE
#PROMPT ('Don''t print this report automatically. I''ll print it from the text file later.', CHECK), %DoNotPrint, AT(10)
#ENDTAB
#TAB ('Dictionary Print Wizard - Reported Files'), FINISH(1)
#DISPLAY('You can report on each file in your dictionary, or you can select individual files to report on.')
#DISPLAY('')
#PROMPT ('Report on all files in my dictionary.', CHECK), %DictionaryReportUseAllFiles, DEFAULT(1), AT(10)
#ENDTAB
#TAB ('Dictionary Print Wizard - Select Reported Files'), WHERE(~%DictionaryReportUseAllFiles), FINISH(1)
#PROMPT ('File Selection', FROM (%appTables)), %DictionaryReportFileSelection, INLINE, SELECTION('File Selection')
#ENDTAB
#TAB ('Dictionary Print Wizard - Finally...')
#DISPLAY ('This concludes the dictionary report wizard.')
#DISPLAY
#PROMPT ('Check TAB existence?', CHECK), %OptCheckTabs, DEFAULT(1), AT(10)
#PROMPT ('Check HELP ID existence?', CHECK), %OptCheckHelpID, DEFAULT(1), AT(10)
#PROMPT ('Check HELP TOOL TIP existence?', CHECK), %OptCheckHelpTip, DEFAULT(1), AT(10)
#PROMPT ('Check HELP MESSAGE existence?', CHECK), %OptCheckHelpMsg, DEFAULT(1), AT(10)
#DISPLAY
#PROMPT ('Show Choices, Values, and Initial Values?', CHECK), %OptShowINLIST, DEFAULT(0), AT(10)
#DISPLAY
#DISPLAY
#DISPLAY ('Click on the Finish button to generate the text file.')
#ENDTAB
#ENDSHEET
#!#BOXED('Hide')
#! #BUTTON('Processed Files'),MULTI(%DoTheseFiles, %DoFilePrefix & ' ' & %DoFileName & ' ' & %DoFile),INLINE
#! #PROMPT('File Prefix: ',@s10),%DoFilePrefix,UNIQUE,REQ
#! #PROMPT('Global Name Area: ',@s20),%DoFileName,REQ
#! #PROMPT('File Name: ',@s30),%DoFile,REQ
#! #ENDBUTTON
#!#ENDBOXED
#!--------------------------------------------------------------------
#DECLARE(%OutputFile)
#DECLARE(%TabName)
#DECLARE(%ReportedFiles),UNIQUE
#DECLARE(%WorkString)
#DECLARE(%CountFiles)
#DECLARE(%DoTheseFiles),UNIQUE
#DECLARE(%DoFilePrefix,%DoTheseFiles)
#DECLARE(%DoFileName,%DoTheseFiles)
#DECLARE(%DoFile,%DoTheseFiles)
#DECLARE(%DoFileDescription,%DoTheseFiles) #! RAS.2003.07.22
#DECLARE(%RasFieldType)
#DECLARE(%RasPrompt)
#DECLARE(%RasHeader)
#DECLARE(%RasHelp)
#DECLARE(%RasMessage)
#DECLARE(%RasTooltip)
#DECLARE(%ChoiceLine)
#DECLARE(%ChoiceComma)
#DECLARE(%ValueLine)
#DECLARE(%ValueComma)
#!
#DECLARE(%nLoc1 ,LONG) #! Location 1
#DECLARE(%nLoc2 ,LONG) #! Location 2
#DECLARE(%NFileUser) #! File user options [RAWEB]
#DECLARE(%NFileOpt1) #! File option 1 [NO]
#DECLARE(%NFileOpt2) #! File option 2
#DECLARE(%NFileOpt3) #! File option 3
#DECLARE(%NFileOpt4) #! File option 4
#!--------------------------------------------------------------------
#IF (%WhatName = 'Use the dictionary name, with a .TXT extension.')
#SET (%OutputFile, SUB(%DictionaryFile, 1, LEN(%DictionaryFile) - 3) & 'TXT')
#ELSE
#SET (%OutputFile, %NewName)
#ENDIF
#!--------------------------------------------------------------------
#IF (%DictionaryReportUseAllFiles)
#FOR (%File)
#!----------------------------------------------------------------!
#! RAS.2001.12.01 - Ignore file place marker definitions. !
#! These are files that are defined but that contain no fields. !
#!----------------------------------------------------------------!
#IF(NOT ITEMS(%Field))
#CYCLE
#ENDIF
#!
#SET(%nLoc1,INSTRING('RAWEB(',%FileUserOptions,1,1))
#SET(%nLoc2,INSTRING(')',%FileUserOptions,1,%nLoc1))
#SET(%nFileUser,UPPER(SUB(%FileUserOptions,%nLoc1,%nLoc2)))
#SET(%NFileOpt1,EXTRACT(%NFileUser,'RAWEB',1))
#SET(%NFileOpt2,EXTRACT(%NFileUser,'RAWEB',2))
#SET(%NFileOpt3,EXTRACT(%NFileUser,'RAWEB',3))
#SET(%NFileOpt4,EXTRACT(%NFileUser,'RAWEB',4))
#!-------------------------------------------------------------!
#! The first option RAWEB(NO) controls if a file is processed. !
#!-------------------------------------------------------------!
#IF(SUB(%NFileOpt1,1,1)='N')
#CYCLE
#ENDIF
#!
#CASE(%FileType)
#OF ('VIEW')
#OROF('ALIAS')
#CYCLE
#ENDCASE
#!
#CASE(%FileDriver)
#OF('ASCII')
#OROF('BASIC')
#OROF('DOS')
#CYCLE
#ENDCASE
#!
#ADD (%ReportedFiles, %File)
#ENDFOR
#ELSE
#FOR (%DictionaryReportFileSelection)
#ADD (%ReportedFiles, %DictionaryReportFileSelection)
#ENDFOR
#ENDIF
#!--------------------------------------------------------------------
#SET(%CountFiles,0)
#FOR (%ReportedFiles)
#FIX(%File,%ReportedFiles)
#SET(%CountFiles,%CountFiles + 1)
#ADD(%DoTheseFiles, %CountFiles)
#SET(%DoFilePrefix, %FilePrefix)
#SET(%DoFileName, %FileName)
#SET(%DoFile, %File)
#SET(%DoFileDescription, FORMAT(ITEMS(%Field),@n03) & ' - ' & %FileDescription) #! RAS.2003.07.22
#ENDFOR
#!--------------------------------------------------------------------
#EQUATE (%DoSort,1)
#EQUATE (%I,0)
#EQUATE (%W1FilePrefix,'')
#EQUATE (%W1FileName,'')
#EQUATE (%W1File,'')
#EQUATE (%W1FileDescription,'') #! RAS.2003.07.22
#EQUATE (%W2FilePrefix,'')
#EQUATE (%W2FileName,'')
#EQUATE (%W2File,'')
#EQUATE (%W2FileDescription,'') #! RAS.2003.07.22
#LOOP,WHILE(%DoSort)
#SET(%DoSort,0)
#LOOP,FOR(%I,2,ITEMS(%DoTheseFiles))
#SELECT(%DoTheseFiles,%I-1)
#SET(%W1FilePrefix,%DoFilePrefix)
#SET(%W1FileName,%DoFileName)
#SET(%W1File,%DoFile)
#SET(%W1FileDescription,%DoFileDescription) #! RAS.2003.07.22
#SELECT(%DoTheseFiles,%I)
#SET(%W2FilePrefix,%DoFilePrefix)
#SET(%W2FileName,%DoFileName)
#SET(%W2File,%DoFile)
#SET(%W2FileDescription,%DoFileDescription) #! RAS.2003.07.22
#IF(%W1FilePrefix > %W2FilePrefix)
#SET(%DoSort,1)
#SET(%DoFilePrefix,%W1FilePrefix)
#SET(%DoFileName,%W1FileName)
#SET(%DoFile,%W1File)
#SET(%DoFileDescription,%W1FileDescription) #! RAS.2003.07.22
#SELECT(%DoTheseFiles,%I-1)
#SET(%DoFilePrefix,%W2FilePrefix)
#SET(%DoFileName,%W2FileName)
#SET(%DoFile,%W2File)
#SET(%DoFileDescription,%W2FileDescription) #! RAS.2003.07.22
#ENDIF
#ENDLOOP
#ENDLOOP
#!--------------------------------------------------------------------
#CREATE (%OutputFile)
#SET(%WorkString,'Dictionary Files Report')
%[54]WorkString Date: %@D010@(TODAY())
%[54]DictionaryFile Time: %@T04@(CLOCK())
#!#INSERT(%DictionaryFilesHeader)
#!--------------------------------------------------------------------
#SET(%CountFiles,0)
#FOR(%DoTheseFiles)
#IF((%CountFiles % 20) = 0)
#INSERT(%DictionaryFilesHeader2)
#ENDIF
#SET(%CountFiles,%CountFiles + 1)
%@N3@(%CountFiles) %[8]DoFilePrefix %[20]DoFileName %[30]DoFile %DoFileDescription
#FIX(%File,%DoFile)
#FOR(%Field)
#IF(%FieldType='GROUP')
#CYCLE
#ENDIF
#IF(%FieldType='END')
#CYCLE
#ENDIF
#IF(%FieldDimension1 > 0)
#CYCLE
#ENDIF
#IF(INSTRING('NOPOPULATE',%FieldQuickOptions,1,1)<>0)
#CYCLE
#ENDIF
#IF(%OptCheckTabs)
#SET(%TabName,EXTRACT(%FieldQuickOptions,'TAB',1))
#IF(~%TabName)
%[24]Field - Field has ---NO--- form tab description
#ENDIF
#ENDIF
#CASE(%FieldValidation)
#OF ('NONZERO')
#OF ('INRANGE')
#OF ('BOOLEAN')
#!------------------------------------------!
#! RA.2010.11.11 - Check for blank choices. !
#!------------------------------------------!
#IF(%FieldTrueValue = '')
%[24]Field - BOOLEAN choices exist, but there is no value for TRUE
#ENDIF
#IF(%FieldFalseValue = '')
%[24]Field - BOOLEAN choices exist, but there is no value for FALSE
#ENDIF
#OF ('INLIST')
#IF(ITEMS(%FieldChoices) AND ~ITEMS(%FieldValues))
%[24]Field - Validation field choices exist, but there are no field values
#ENDIF
#IF(ITEMS(%FieldChoices) AND ~%FieldInitial)
%[24]Field - Validation field choices exist, but there is no initial default value
#ENDIF
#IF(ITEMS(%FieldChoices) AND %OptShowINLIST)
#SET(%ChoiceLine, '')
#SET(%ChoiceComma,ITEMS(%FieldChoices) - 1)
#FOR(%FieldChoices)
#SET(%ChoiceLine,%ChoiceLine & '' & %FieldChoices & '')
#IF(%ChoiceComma > 0)
#SET(%ChoiceLine,%ChoiceLine & '|')
#SET(%ChoiceComma,%ChoiceComma - 1)
#ENDIF
#ENDFOR
#SET(%ValueLine, '')
#SET(%ValueComma,ITEMS(%FieldValues) - 1)
#FOR(%FieldValues)
#SET(%ValueLine,%ValueLine & '' & %FieldValues & '')
#IF(%ValueComma > 0)
#SET(%ValueLine,%ValueLine & '|')
#SET(%ValueComma,%ValueComma - 1)
#ENDIF
#ENDFOR
%[24]Field - CHOICES: %ChoiceLine
%[24]Field - VALUES : %ValueLine
%[24]Field - INITIAL: %FieldInitial
#ENDIF
#! #IF(ITEMS(%FieldChoices))
#! #FOR(%FieldChoices)