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

  1. [ver]
  2.     4
  3. [sty]
  4.     ~macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [lang]
  14.     1
  15. [desc]
  16.     Select individual pages to print.
  17.     Lotus WPD Marketing
  18.     Intermediate
  19.     Local Arrays, FilePrint
  20.     
  21.     682670581
  22.     7
  23.     679087132
  24.     156
  25.     0
  26.     0
  27.     0
  28.     0
  29.     0
  30.     
  31.     
  32.     
  33.     
  34.     
  35.     
  36.     0
  37. [fopts]
  38.     0
  39.     1
  40.     0
  41.     0
  42. [lnopts]
  43.     2
  44.     Body Text
  45.     1
  46. [docopts]
  47.     5
  48.     2
  49. [l1]
  50.     0
  51. [edoc]
  52. Macro by <+!>Charlie Pappas<-!>
  53.  
  54.  
  55. function SelectPrint()
  56.  
  57. dim pages(125)
  58.  
  59. size = 125
  60.  
  61. hourglass(1)
  62.  
  63. for i = 1 to size
  64.  
  65.     filllist(i)
  66.  
  67. next
  68.  
  69. hourglass(0)
  70.  
  71. box = dialogbox("." "selprint")
  72.  
  73. if box <<<;> 1
  74.  
  75.     return 0
  76.  
  77. endif
  78.  
  79. if getdialogfield$(11)
  80.  
  81.     firstend = getdialogfield$(8002)
  82.  
  83.     if 0 = isnumeric(firstend) or firstend << 1
  84.  
  85.         goto skip1
  86.  
  87.     endif
  88.  
  89.     for i = 1 to firstend ' set array
  90.  
  91.         pages(i) = 1
  92.  
  93.     next
  94.  
  95. endif
  96.  
  97. skip1:
  98.  
  99. if getdialogfield$(12) ' need total pages in doc
  100.  
  101.     lastpages = getdialogfield$(8003)
  102.  
  103.     if 0 = isnumeric(lastpages) or lastpages << 1
  104.  
  105.         goto skip2
  106.  
  107.     endif
  108.  
  109. '    newdisplay = display - 4096
  110.  
  111.     viewlevel = getprofilestring$("AmiPro" "ViewLevel")
  112.  
  113.     ViewPreferences(-13179, viewlevel)
  114.  
  115.     layoutmode()
  116.  
  117.     type("<[>esc]<[>esc]<[>esc]<[>ctrlend]")
  118.  
  119.     tpages = getpageno()
  120.  
  121. '    if changedisplay ' if we changed it, set it back
  122.  
  123. '        displaypreferences(display viewlevel)
  124.  
  125. '    endif
  126.  
  127.     lastend = tpages - lastpages + 1 ' calculate start last pg no
  128.  
  129.     if lastend << 1
  130.  
  131.         goto skip2 ' lastend not valid
  132.  
  133.     endif
  134.  
  135.     for i = lastend to tpages ' set array
  136.  
  137.         ck = pages(i)
  138.  
  139.         if not ck = 1
  140.  
  141.             pages(i) = 1
  142.  
  143.         endif
  144.  
  145.     next
  146.  
  147. endif
  148.  
  149. skip2:
  150.  
  151. startrange = getdialogfield$(8009)
  152.  
  153. endrange = getdialogfield$(8004)
  154.  
  155. if ((0 = isnumeric(startrange)) or (0 = isnumeric(endrange)) or (startrange << 1) or (endrange << 1))
  156.  
  157.     goto skip3
  158.  
  159. endif
  160.  
  161. for i = startrange to endrange
  162.  
  163.     ck = pages(i)
  164.  
  165.     if not ck = 1
  166.  
  167.         pages(i) = 1
  168.  
  169.     endif
  170.  
  171. next
  172.  
  173. skip3:
  174.  
  175. startrange = getdialogfield$(8005)
  176.  
  177. endrange = getdialogfield$(8006)
  178.  
  179. if ((0 = isnumeric(startrange)) or (0 = isnumeric(endrange)) or (startrange << 1) or (endrange << 1))
  180.  
  181.     goto skip4
  182.  
  183. endif
  184.  
  185. for i = startrange to endrange
  186.  
  187.     ck = pages(i)
  188.  
  189.     if not ck = 1
  190.  
  191.         pages(i) = 1
  192.  
  193.     endif
  194.  
  195. next
  196.  
  197. skip4:
  198.  
  199. addpages = getdialogfield$(8000)
  200.  
  201. i = 1
  202.  
  203. while (1)
  204.  
  205.     pg = strfield$(addpages i " ")
  206.  
  207.     if pg = -1 or pg = ""
  208.  
  209.         break
  210.  
  211.     endif
  212.  
  213.     if 0 = isnumeric(pg)
  214.  
  215.         goto skippy
  216.  
  217.     endif
  218.  
  219.     ck = pages(pg)
  220.  
  221.     if not ck = 1
  222.  
  223.         pages(pg) = 1
  224.  
  225.     endif
  226.  
  227.     skippy:
  228.  
  229.     i = i + 1
  230.  
  231. wend
  232.  
  233. start = 1
  234.  
  235. while (start <<= size)
  236.  
  237.     ck = pages(start)
  238.  
  239.     if ck = 1 then
  240.  
  241.         stop = start + 1
  242.  
  243.         while (1)
  244.  
  245.             ck = pages(stop)
  246.  
  247.             if ck <<<;> 1 then
  248.  
  249.                 stop = stop - 1
  250.  
  251. '                message("{start} - {stop}")
  252.  
  253.                 FilePrint(1 start stop 1536)
  254.  
  255.                 start = stop + 1
  256.  
  257.                 break
  258.  
  259.             endif
  260.  
  261.             stop = stop + 1
  262.  
  263.         wend
  264.  
  265.     else
  266.  
  267.         start = start + 1
  268.  
  269.     endif
  270.  
  271. wend
  272.  
  273. message("SelectPrint is done")
  274.  
  275. end function
  276.  
  277.  
  278. DIALOG selprint
  279.  
  280. -2134376448 22 96 30 172 114 "" "" "Select Pages to Print"
  281.  
  282. FONT 8 "Helv"
  283.  
  284. 6 8 28 10 1000 1342177280 "static" "&Pages:" 0 
  285.  
  286. 6 20 24 92 9000 1352728585 "listbox" "" 0 
  287.  
  288. 40 4 82 40 100 1342308359 "button" "Print" 0 
  289.  
  290. 44 14 28 10 110 1342242819 "button" "&First:" 0 
  291.  
  292. 94 16 22 10 1002 1342177280 "static" "&pages" 0 
  293.  
  294. 76 14 14 12 8002 1350631552 "edit" "" 0 
  295.  
  296. 44 28 28 10 120 1342242819 "button" "&Last:" 0 
  297.  
  298. 94 30 22 10 1003 1342177280 "static" "&pages" 0 
  299.  
  300. 76 28 14 12 8003 1350631552 "edit" "" 0 
  301.  
  302. 40 44 82 40 130 1342308359 "button" "Range" 0 
  303.  
  304. 44 56 20 10 1004 1342177280 "static" "Page:" 0 
  305.  
  306. 64 54 22 12 8009 1350631552 "edit" "" 0 
  307.  
  308. 88 56 8 10 1005 1342177280 "static" "to" 0 
  309.  
  310. 96 54 22 12 8004 1350631552 "edit" "" 0 
  311.  
  312. 44 70 20 10 1006 1342177280 "static" "Page:" 0 
  313.  
  314. 64 68 22 12 8005 1350631552 "edit" "" 0 
  315.  
  316. 88 70 8 10 1007 1342177280 "static" "to" 0 
  317.  
  318. 96 68 22 12 8006 1350631552 "edit" "" 0 
  319.  
  320. 40 86 46 8 1001 1342308352 "static" "&Other pages:" 0 
  321.  
  322. 40 96 126 12 8000 1350631552 "edit" "" 0 
  323.  
  324. 126 6 40 14 1 1342373889 "button" "OK" 0 
  325.  
  326. 126 22 40 14 2 1342373888 "button" "Cancel" 0 
  327.  
  328. END DIALOG
  329.  
  330. >
  331.  
  332. [Embedded]
  333. 00004200
  334. >
  335. [macsum] 2
  336. SelectPrint 0 0 17 2
  337. selprint 2328 0 -1 114
  338. [macse]
  339. 14 SelectPrint
  340. 5 125
  341. 21 1 [X]
  342. 5 125
  343. 8 2
  344. 0 296 1
  345. 5 1
  346. 8 3
  347. 6 2
  348. 6 3
  349. 18 2
  350. 12 00000139
  351. 10 00000164
  352. 5 1
  353. 6 3
  354. 3 0
  355. 8 3
  356. 10 00000064
  357. 0 25 "{3}"
  358. 10 00000106
  359. 0 296 0
  360. 0 26 "." "selprint"
  361. 13
  362. 8 4
  363. 6 4
  364. 5 1
  365. 18 1
  366. 11 00000244
  367. 5 0
  368. 15
  369. 9
  370. 0 27 11
  371. 13
  372. 11 00000479
  373. 0 27 8002
  374. 13
  375. 8 5
  376. 5 0
  377. 0 277 "{5}"
  378. 13
  379. 18 0
  380. 6 5
  381. 5 1
  382. 18 5
  383. 1 2
  384. 11 00000365
  385. 10 00000479
  386. 5 1
  387. 8 3
  388. 6 5
  389. 6 3
  390. 18 2
  391. 12 00000450
  392. 10 00000479
  393. 5 1
  394. 6 3
  395. 3 0
  396. 8 3
  397. 10 00000375
  398. 6 3
  399. 5 1
  400. 23 1
  401. 10 00000417
  402. 0 27 12
  403. 13
  404. 11 00000949
  405. 0 27 8003
  406. 13
  407. 8 6
  408. 5 0
  409. 0 277 "{6}"
  410. 13
  411. 18 0
  412. 6 6
  413. 5 1
  414. 18 5
  415. 1 2
  416. 11 00000600
  417. 10 00000949
  418. 0 286 "AmiPro" "ViewLevel"
  419. 13
  420. 8 7
  421. 2 206 1 -13179 "{7}"
  422. 2 210 1
  423. 0 6 "[27][27][27][16419]"
  424. 0 294
  425. 13
  426. 8 8
  427. 6 8
  428. 6 6
  429. 3 1
  430. 5 1
  431. 3 0
  432. 8 9
  433. 6 9
  434. 5 1
  435. 18 5
  436. 11 00000783
  437. 10 00000949
  438. 6 9
  439. 8 3
  440. 6 8
  441. 6 3
  442. 18 2
  443. 12 00000868
  444. 10 00000949
  445. 5 1
  446. 6 3
  447. 3 0
  448. 8 3
  449. 10 00000793
  450. 6 3
  451. 22 1
  452. 8 10
  453. 6 10
  454. 5 1
  455. 18 0
  456. 1 3
  457. 11 00000936
  458. 6 3
  459. 5 1
  460. 23 1
  461. 10 00000835
  462. 0 27 8009
  463. 13
  464. 8 11
  465. 0 27 8004
  466. 13
  467. 8 12
  468. 5 0
  469. 0 277 "{11}"
  470. 13
  471. 18 0
  472. 5 0
  473. 0 277 "{12}"
  474. 13
  475. 18 0
  476. 6 11
  477. 5 1
  478. 18 5
  479. 6 12
  480. 5 1
  481. 18 5
  482. 1 2
  483. 1 2
  484. 1 2
  485. 11 00001124
  486. 10 00001292
  487. 6 11
  488. 8 3
  489. 6 12
  490. 6 3
  491. 18 2
  492. 12 00001211
  493. 10 00001292
  494. 5 1
  495. 6 3
  496. 3 0
  497. 8 3
  498. 10 00001135
  499. 6 3
  500. 22 1
  501. 8 10
  502. 6 10
  503. 5 1
  504. 18 0
  505. 1 3
  506. 11 00001279
  507. 6 3
  508. 5 1
  509. 23 1
  510. 10 00001178
  511. 0 27 8005
  512. 13
  513. 8 11
  514. 0 27 8006
  515. 13
  516. 8 12
  517. 5 0
  518. 0 277 "{11}"
  519. 13
  520. 18 0
  521. 5 0
  522. 0 277 "{12}"
  523. 13
  524. 18 0
  525. 6 11
  526. 5 1
  527. 18 5
  528. 6 12
  529. 5 1
  530. 18 5
  531. 1 2
  532. 1 2
  533. 1 2
  534. 11 00001467
  535. 10 00001635
  536. 6 11
  537. 8 3
  538. 6 12
  539. 6 3
  540. 18 2
  541. 12 00001554
  542. 10 00001635
  543. 5 1
  544. 6 3
  545. 3 0
  546. 8 3
  547. 10 00001478
  548. 6 3
  549. 22 1
  550. 8 10
  551. 6 10
  552. 5 1
  553. 18 0
  554. 1 3
  555. 11 00001622
  556. 6 3
  557. 5 1
  558. 23 1
  559. 10 00001521
  560. 0 27 8000
  561. 13
  562. 8 13
  563. 5 1
  564. 8 3
  565. 5 1
  566. 11 00001942
  567. 0 20 "{13}" "{3}" " "
  568. 13
  569. 8 14
  570. 6 14
  571. 5 -1
  572. 18 0
  573. 6 14
  574. 7 ""
  575. 18 0
  576. 1 2
  577. 11 00001784
  578. 10 00001942
  579. 5 0
  580. 0 277 "{14}"
  581. 13
  582. 18 0
  583. 11 00001839
  584. 10 00001909
  585. 6 14
  586. 22 1
  587. 8 10
  588. 6 10
  589. 5 1
  590. 18 0
  591. 1 3
  592. 11 00001909
  593. 6 14
  594. 5 1
  595. 23 1
  596. 6 3
  597. 5 1
  598. 3 0
  599. 8 3
  600. 10 00001666
  601. 5 1
  602. 8 15
  603. 6 15
  604. 6 2
  605. 18 4
  606. 11 00002289
  607. 6 15
  608. 22 1
  609. 8 10
  610. 6 10
  611. 5 1
  612. 18 0
  613. 11 00002254
  614. 6 15
  615. 5 1
  616. 3 0
  617. 8 16
  618. 5 1
  619. 11 00002241
  620. 6 16
  621. 22 1
  622. 8 10
  623. 6 10
  624. 5 1
  625. 18 1
  626. 11 00002206
  627. 6 16
  628. 5 1
  629. 3 1
  630. 8 16
  631. 2 111 1 1 "{15}" "{16}" 1536
  632. 6 16
  633. 5 1
  634. 3 0
  635. 8 15
  636. 10 00002241
  637. 6 16
  638. 5 1
  639. 3 0
  640. 8 16
  641. 10 00002053
  642. 10 00002276
  643. 6 15
  644. 5 1
  645. 3 0
  646. 8 15
  647. 10 00001953
  648. 0 3 "SelectPrint is done"
  649. 6 0
  650. 15
  651. 9
  652. DIALOG selprint
  653. -2134376448 22 96 30 172 114 "" "" "Select Pages to Print" 
  654. FONT 8 "Helv" 
  655. 6 8 28 10 1000 1342177280 "static" "&Pages:" 0 
  656. 6 20 24 92 9000 1352728585 "listbox" "" 0 
  657. 40 4 82 40 100 1342308359 "button" "Print" 0 
  658. 44 14 28 10 110 1342242819 "button" "&First:" 0 
  659. 94 16 22 10 1002 1342177280 "static" "&pages" 0 
  660. 76 14 14 12 8002 1350631552 "edit" "" 0 
  661. 44 28 28 10 120 1342242819 "button" "&Last:" 0 
  662. 94 30 22 10 1003 1342177280 "static" "&pages" 0 
  663. 76 28 14 12 8003 1350631552 "edit" "" 0 
  664. 40 44 82 40 130 1342308359 "button" "Range" 0 
  665. 44 56 20 10 1004 1342177280 "static" "Page:" 0 
  666. 64 54 22 12 8009 1350631552 "edit" "" 0 
  667. 88 56 8 10 1005 1342177280 "static" "to" 0 
  668. 96 54 22 12 8004 1350631552 "edit" "" 0 
  669. 44 70 20 10 1006 1342177280 "static" "Page:" 0 
  670. 64 68 22 12 8005 1350631552 "edit" "" 0 
  671. 88 70 8 10 1007 1342177280 "static" "to" 0 
  672. 96 68 22 12 8006 1350631552 "edit" "" 0 
  673. 40 86 46 8 1001 1342308352 "static" "&Other pages:" 0 
  674. 40 96 126 12 8000 1350631552 "edit" "" 0 
  675. 126 6 40 14 1 1342373889 "button" "OK" 0 
  676. 126 22 40 14 2 1342373888 "button" "Cancel" 0 
  677. 00004225
  678.