home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 18 / 18.iso / w / w252 / 4.ddi / MACROS.CMZ / DBASVIEW.SMM < prev    next >
Encoding:
INI File  |  1991-08-13  |  8.2 KB  |  582 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     ~macro.sty
  5. [files]
  6. [revisions]
  7.     0
  8. [prn]
  9.     PostScript Printer
  10. [lang]
  11.     1
  12. [desc]
  13.     Reads dBase files and provides field information.  Creates an Ami Pro description file needed for mail merging.
  14.     Lotus WPD Technical Support
  15.     Advanced
  16.     fopen, fread, Arrays
  17.     
  18.     682119372
  19.     25
  20.     676574628
  21.     581
  22.     2
  23.     0
  24.     0
  25.     0
  26.     0
  27.     Fread, Arrays, 
  28.     
  29.     
  30.     
  31.     
  32.     
  33.     0
  34. [fopts]
  35.     0
  36.     1
  37.     0
  38.     0
  39. [lnopts]
  40.     2
  41.     Body Text
  42.     1
  43. [docopts]
  44.     5
  45.     2
  46. [lay]
  47.     Standard
  48.     513
  49.     [rght]
  50.         15840
  51.         12240
  52.         1
  53.         1440
  54.         1440
  55.         1
  56.         1440
  57.         1440
  58.         2
  59.         1
  60.         0
  61.         1
  62.         1
  63.         2
  64.         1
  65.         1440
  66.         10800
  67.         5
  68.         1
  69.         720
  70.         1
  71.         1440
  72.         1
  73.         2880
  74.         1
  75.         4320
  76.         1
  77.         5760
  78.     [hrght]
  79.     [lyfrm]
  80.         1
  81.         11200
  82.         0
  83.         0
  84.         12240
  85.         1440
  86.         0
  87.         1
  88.         3
  89.         1 0 0 0 0 0 0
  90.         0
  91.         0
  92.         1
  93.     [frmlay]
  94.         1440
  95.         12240
  96.         1
  97.         1440
  98.         0
  99.         1
  100.         270
  101.         1440
  102.         0
  103.         1
  104.         0
  105.         1
  106.         1
  107.         0
  108.         1
  109.         1440
  110.         10800
  111.         0
  112.     [txt]
  113.  
  114. <+B>Peyton McManus
  115.  
  116. <+B>DataGet
  117.  
  118. <+B>Page <:P10,0,>
  119.  
  120. >
  121.     [frght]
  122.     [lyfrm]
  123.         1
  124.         13248
  125.         0
  126.         14400
  127.         12240
  128.         15840
  129.         0
  130.         1
  131.         3
  132.         1 0 0 0 0 0 0
  133.         0
  134.         0
  135.         2
  136.     [frmlay]
  137.         15840
  138.         12240
  139.         1
  140.         1440
  141.         360
  142.         1
  143.         14472
  144.         1440
  145.         0
  146.         1
  147.         0
  148.         1
  149.         1
  150.         0
  151.         1
  152.         1440
  153.         10800
  154.         0
  155.     [txt]
  156. >
  157. [elay]
  158. [l1]
  159.     0
  160. [edoc]
  161. <:#606,9360>' This macro will read dbase file header info and return the name and nubmer of fields.  It is also '  capable of returning any info stored in header. ie, field defin. field length, # records Etc
  162.  
  163. <:#202,9360>
  164.  
  165. <:#202,9360>Function Multiple()
  166.  
  167. <:#202,9360>dim a(40)
  168.  
  169. <:#202,9360>doc=getdocpath$()
  170.  
  171. <:#202,9360>Filledit(9001,"{doc}*.dbf")
  172.  
  173. <:#202,9360>Box=dialogbox(".","import")
  174.  
  175. <:#202,9360>if Box<<<;>1
  176.  
  177. <:#202,9360>    Exit Function
  178.  
  179. <:#202,9360>Endif
  180.  
  181. <:#202,9360>Files=getdialogfield$(9001)
  182.  
  183. <:#202,9360>Hourglass(on)
  184.  
  185. <:#202,9360>StatusBarMsg("Please Wait...Reading dBase file info ......")
  186.  
  187. <:#202,9360>dir=getcurrentdir$()
  188.  
  189. <:#202,9360>'Singlestep(on)
  190.  
  191. <:#202,9360>Handle=Fopen("{dir}{files}","r")
  192.  
  193. <:#202,9360>for t=1 to 32
  194.  
  195. <:#202,9360>    Byte=Fread(handle,1)
  196.  
  197. <:#202,9360>    char=asc(byte)
  198.  
  199. <:#202,9360>    a(t)="{char}"
  200.  
  201. <:#202,9360>next
  202.  
  203. <:#202,9360>Day=a(4)
  204.  
  205. <:#202,9360>Month=a(3)
  206.  
  207. <:#202,9360>Year=a(2)
  208.  
  209. <:#202,9360>Records=a(5)+(256*a(6))       
  210.  
  211. <:#202,9360>Bytes_Header=a(9)+(256*a(10)) 
  212.  
  213. <:#202,9360>Bytes_record=a(11)+(256*a(12))
  214.  
  215. <:#202,9360>Num_Fields = ((Bytes_Header - 32) / 32)
  216.  
  217. <:#202,9360>
  218.  
  219. <:#202,9360>Num_Fields=FormatNum$("","",0,Num_Fields)
  220.  
  221. <:#202,9360>Dim Name_Field(Num_fields)
  222.  
  223. <:#202,9360>Dim Combine(Num_Fields)
  224.  
  225. <:#202,9360>Filledit(1001,"{Files}")
  226.  
  227. <:#202,9360>Filledit(1003,"{Month}/{Day}/{Year}")
  228.  
  229. <:#202,9360>Filledit(1005,Records)
  230.  
  231. <:#202,9360>Filledit(1006,"{Num_Fields} Fields")
  232.  
  233. <:#202,9360>FOR V = 1 TO Num_Fields
  234.  
  235. <:#202,9360>    Name_field(v)= FREAD(Handle,11)
  236.  
  237. <:#202,9360>     charType = FREAD(Handle,1)
  238.  
  239. <:#202,9360>     fda = FREAD(Handle,4)
  240.  
  241. <:#202,9360>     length = ASC(FREAD(Handle,1))
  242.  
  243. <:#202,9360>     numdec = ASC(FREAD(Handle,1))
  244.  
  245. <:#202,9360>    reserve = FREAD(Handle,13)
  246.  
  247. <:#202,9360>    odhterm = FREAD(Handle,1)
  248.  
  249. <:#202,9360>    Filledit(9000,Name_Field(v))
  250.  
  251. <:#202,9360>    Combine(v)="{Name_Field(v)}^{CharType}^{Length}" 
  252.  
  253. <:#202,9360>name=Name_Field(v)
  254.  
  255. <:#202,9360>View=combine(v)
  256.  
  257. <:#202,9360>'Message("{v} {name} {View}")
  258.  
  259. <:#202,9360>NEXT
  260.  
  261. <:#202,9360>Hourglass(off)
  262.  
  263. <:#202,9360>Fclose(Handle)
  264.  
  265. <:#202,9360>StatusBarMsg("")
  266.  
  267. <:#202,9360>Box=dialogbox(".","Dbasefun")
  268.  
  269. <:#202,9360>If Box=3
  270.  
  271. <:#202,9360>    New("~default.sty",Nocontents,0)
  272.  
  273. <:#202,9360>    Type ("dBase<[>Enter]")
  274.  
  275. <:#202,9360>    for F=1 to Num_fields
  276.  
  277. <:#202,9360>        Name=Name_Field(F)
  278.  
  279. <:#202,9360>    Type ("{Name}<[>Enter]")
  280.  
  281. <:#202,9360>    Next
  282.  
  283. <:#202,9360>Endif
  284.  
  285. l1="Here is a dBase description file.  To use this in a merge, "
  286.  
  287. l2="save the untitled as a file. For additional help, see the Ami "
  288.  
  289. l3="Pro chapter on Merging Text and Data."
  290.  
  291. Message("{l1}{l2}{l3}") 
  292.  
  293. <:#202,9360>
  294.  
  295. <:#202,9360>END FUNCTION
  296.  
  297. <:#202,9360>
  298.  
  299. <:#202,9360>
  300.  
  301. <:#202,9360>DIALOG Import
  302.  
  303. <:#202,9360>-2134376448 5 94 40 128 90 "" "" "Read dBase File"
  304.  
  305. <:#202,9360>FONT 6 "HELV"
  306.  
  307. <:#202,9360>6 28 64 56 9001 1352728579 "listbox" "" 0 
  308.  
  309. <:#202,9360>6 16 40 10 1000 1342308352 "static" "dBase files:" 0 
  310.  
  311. <:#202,9360>8 4 60 10 7999 1342177280 "static" "" 0 
  312.  
  313. <:#202,9360>82 4 40 14 1 1342373889 "button" "OK" 0 
  314.  
  315. <:#202,9360>82 20 40 14 2 1342373888 "button" "Cancel" 0 
  316.  
  317. <:#202,9360>END DIALOG
  318.  
  319. <:#202,9360>
  320.  
  321. <:#202,9360>
  322.  
  323. <:#202,9360>DIALOG Dbasefun
  324.  
  325. <:#202,9360>-2134376448 13 76 42 162 122 "" "" "dBase File Info"
  326.  
  327. <:#202,9360>FONT 6 "HELV"
  328.  
  329. <:#202,9360>8 6 46 10 1000 1342177280 "static" "dBase file:" 0 
  330.  
  331. <:#202,9360>60 6 50 10 1001 1342177280 "static" " " 0 
  332.  
  333. <:#202,9360>8 18 46 10 1002 1342177280 "static" "Last edited:" 0 
  334.  
  335. <:#202,9360>60 18 50 10 1003 1342177280 "static" " " 0 
  336.  
  337. <:#202,9360>8 30 50 10 1004 1342177280 "static" "Total records:" 0 
  338.  
  339. <:#202,9360>60 30 50 10 1005 1342177280 "static" " " 0 
  340.  
  341. <:#202,9360>60 42 50 10 1006 1342177280 "static" "" 0 
  342.  
  343. <:#202,9360>58 54 96 48 9000 1352663041 "listbox" "" 0 
  344.  
  345. <:#202,9360>8 42 50 10 1007 1342177280 "static" "Num. of fields:" 0 
  346.  
  347. <:#202,9360>8 54 48 10 1008 1342177280 "static" "Field names:" 0 
  348.  
  349. <:#202,9360>6 104 80 14 3 1342373888 "button" "Create Description File" 0 
  350.  
  351. <:#202,9360>114 4 40 14 1 1342373889 "button" "OK" 0 
  352.  
  353. <:#202,9360>114 20 40 14 2 1342373888 "button" "Cancel" 0 
  354.  
  355. <:#202,9360>END DIALOG
  356.  
  357. >
  358.  
  359. [Embedded]
  360. 00005512
  361. >
  362. [macsum] 3
  363. Multiple 0 0 33 2
  364. Import 1718 0 -1 70
  365. Dbasefun 2032 0 -1 81
  366. [macse]
  367. 14 Multiple
  368. 5 40
  369. 21 1 [X]
  370. 0 268
  371. 13
  372. 8 2
  373. 0 31 9001 "{2}*.dbf"
  374. 0 26 "." "import"
  375. 13
  376. 8 3
  377. 6 3
  378. 5 1
  379. 18 1
  380. 11 00000136
  381. 6 0
  382. 15
  383. 9
  384. 0 27 9001
  385. 13
  386. 8 4
  387. 0 296 1
  388. 0 789 "Please Wait...Reading dBase file info ......"
  389. 0 290
  390. 13
  391. 8 5
  392. 0 259 "{5}{4}" "r"
  393. 13
  394. 8 6
  395. 5 1
  396. 8 7
  397. 5 32
  398. 6 7
  399. 18 2
  400. 12 00000350
  401. 10 00000428
  402. 5 1
  403. 6 7
  404. 3 0
  405. 8 7
  406. 10 00000274
  407. 0 782 "{6}" 1
  408. 13
  409. 8 8
  410. 0 40 "{8}"
  411. 13
  412. 8 9
  413. 6 7
  414. 7 "{9}"
  415. 23 1
  416. 10 00000317
  417. 5 4
  418. 22 1
  419. 8 10
  420. 5 3
  421. 22 1
  422. 8 11
  423. 5 2
  424. 22 1
  425. 8 12
  426. 5 5
  427. 22 1
  428. 5 256
  429. 5 6
  430. 22 1
  431. 4 0
  432. 3 0
  433. 8 13
  434. 5 9
  435. 22 1
  436. 5 256
  437. 5 10
  438. 22 1
  439. 4 0
  440. 3 0
  441. 8 14
  442. 5 11
  443. 22 1
  444. 5 256
  445. 5 12
  446. 22 1
  447. 4 0
  448. 3 0
  449. 8 15
  450. 6 14
  451. 5 32
  452. 3 1
  453. 5 32
  454. 4 1
  455. 8 16
  456. 0 19 "" "" 0 "{16}"
  457. 13
  458. 8 16
  459. 6 16
  460. 21 17 [X]
  461. 6 16
  462. 21 18 [X]
  463. 0 31 1001 "{4}"
  464. 0 31 1003 "{11}/{10}/{12}"
  465. 0 31 1005 "{13}"
  466. 0 31 1006 "{16} Fields"
  467. 5 1
  468. 8 19
  469. 6 16
  470. 6 19
  471. 18 2
  472. 12 00000894
  473. 10 00001218
  474. 5 1
  475. 6 19
  476. 3 0
  477. 8 19
  478. 10 00000815
  479. 6 19
  480. 0 782 "{6}" 11
  481. 13
  482. 23 17
  483. 0 782 "{6}" 1
  484. 13
  485. 8 20
  486. 0 782 "{6}" 4
  487. 13
  488. 8 21
  489. 0 782 "{6}" 1
  490. 13
  491. 0 40 [X]
  492. 13
  493. 8 22
  494. 0 782 "{6}" 1
  495. 13
  496. 0 40 [X]
  497. 13
  498. 8 23
  499. 0 782 "{6}" 13
  500. 13
  501. 8 24
  502. 0 782 "{6}" 1
  503. 13
  504. 8 25
  505. 6 19
  506. 22 17
  507. 0 31 9000 [X]
  508. 6 19
  509. 7 "{26}^{20}^{22}"
  510. 23 18
  511. 6 19
  512. 22 17
  513. 8 27
  514. 6 19
  515. 22 18
  516. 8 28
  517. 10 00000859
  518. 0 296 0
  519. 0 260 "{6}"
  520. 0 789 ""
  521. 0 26 "." "Dbasefun"
  522. 13
  523. 8 3
  524. 6 3
  525. 5 3
  526. 18 0
  527. 11 00001492
  528. 2 101 1 "~default.sty" 0 0
  529. 0 6 "dBase[13]"
  530. 5 1
  531. 8 29
  532. 6 16
  533. 6 29
  534. 18 2
  535. 12 00001444
  536. 10 00001492
  537. 5 1
  538. 6 29
  539. 3 0
  540. 8 29
  541. 10 00001365
  542. 6 29
  543. 22 17
  544. 8 27
  545. 0 6 "{27}[13]"
  546. 10 00001409
  547. 7 "Here is a dBase description file.  To use this in a merge, "
  548. 8 30
  549. 7 "save the untitled as a file. For additional help, see the Ami "
  550. 8 31
  551. 7 "Pro chapter on Merging Text and Data."
  552. 8 32
  553. 0 3 "{30}{31}{32}"
  554. 6 0
  555. 15
  556. 9
  557. DIALOG Import
  558. -2134376448 5 94 40 128 90 "" "" "Read dBase File" 
  559. FONT 6 "HELV" 
  560. 6 28 64 56 9001 1352728579 "listbox" "" 0 
  561. 6 16 40 10 1000 1342308352 "static" "dBase files:" 0 
  562. 8 4 60 10 7999 1342177280 "static" "" 0 
  563. 82 4 40 14 1 1342373889 "button" "OK" 0 
  564. 82 20 40 14 2 1342373888 "button" "Cancel" 0 
  565. DIALOG Dbasefun
  566. -2134376448 13 76 42 162 122 "" "" "dBase File Info" 
  567. FONT 6 "HELV" 
  568. 8 6 46 10 1000 1342177280 "static" "dBase file:" 0 
  569. 60 6 50 10 1001 1342177280 "static" " " 0 
  570. 8 18 46 10 1002 1342177280 "static" "Last edited:" 0 
  571. 60 18 50 10 1003 1342177280 "static" " " 0 
  572. 8 30 50 10 1004 1342177280 "static" "Total records:" 0 
  573. 60 30 50 10 1005 1342177280 "static" " " 0 
  574. 60 42 50 10 1006 1342177280 "static" "" 0 
  575. 58 54 96 48 9000 1352663041 "listbox" "" 0 
  576. 8 42 50 10 1007 1342177280 "static" "Num. of fields:" 0 
  577. 8 54 48 10 1008 1342177280 "static" "Field names:" 0 
  578. 6 104 80 14 3 1342373888 "button" "Create Description File" 0 
  579. 114 4 40 14 1 1342373889 "button" "OK" 0 
  580. 114 20 40 14 2 1342373888 "button" "Cancel" 0 
  581. 00005537
  582.