home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a106 / 2.ddi / TRANSPRT.PR_ / TRANSPRT.bin
Encoding:
Text File  |  1994-04-28  |  335.1 KB  |  9,693 lines

  1. *:*****************************************************************************
  2. *:
  3. *: Procedure file: C:\FOXPROW\TRANSPRT.PRG
  4. *:         System: FoxPro 2.5 Transporter
  5. *:         Author: Microsoft Corp.
  6. *:      Copyright (c) 1993,
  7. *:  Last modified: 1/4/93 at 15:57:18
  8. *:
  9. *:  Procs & Fncts: SETALL
  10. *:               : ERRORHANDLER
  11. *:               : STRIPPATH()
  12. *:               : CLEANUP
  13. *:               : SETVERSION
  14. *:               : GETOLDREPORTTYPE()
  15. *:               : DOUPDATE()
  16. *:               : CVRT102FRX()
  17. *:               : CVRTFBPRPT()
  18. *:               : OPENDBF()
  19. *:               : STARTTHERM
  20. *:               : CONVERTER
  21. *:               : UPDTHERM
  22. *:               : IMPORT
  23. *:               : SYNCHTIME
  24. *:               : CONVERTTYPE()
  25. *:               : MAKECURSOR
  26. *:               : GRAPHICTOCHAR
  27. *:               : CHARTOGRAPHIC
  28. *:               : UPDATESCREEN
  29. *:               : CONVERTPROJECT
  30. *:               : UPDATEREPORT
  31. *:               : NEWCHARTOGRAPHIC
  32. *:               : NEWGRAPHICTOCHAR
  33. *:               : NEWBANDS
  34. *:               : ALLGRAPHICTOCHAR
  35. *:               : ALLCHARTOGRAPHIC
  36. *:               : INITBANDS
  37. *:               : BLDBREAKEXP
  38. *:               : BLDBREAKS
  39. *:               : BLDDETAIL
  40. *:               : ADDTOTAL
  41. *:               : LITEXIST()
  42. *:               : GETLITEXPR()
  43. *:               : MAKEBAND
  44. *:               : MAKETEXT
  45. *:               : MAKEFIELD
  46. *:               : GETHEADING()
  47. *:               : LINESFORHEADING()
  48. *:               : HOWMANYHEADINGS()
  49. *:               : FLD_HEAD_EXIST()
  50. *:               : TOTALS_EXIST()
  51. *:               : CENTER_COL()
  52. *:               : EVALIMPORTEXPR
  53. *:               : MAPBUTTON()
  54. *:               : SCATTERBUTTONS
  55. *:               : FINDLIKEVPOS
  56. *:               : FINDLIKEHPOS
  57. *:               : MAKECHARFIT
  58. *:               : ALLENVIRONS
  59. *:               : ALLOTHERS
  60. *:               : FILLININFO
  61. *:               : ADJRPTFLOAT
  62. *:               : ADJRPTSUPPRESS
  63. *:               : ADJRPTRESET
  64. *:               : GETCHARSUPPRESS()
  65. *:               : SUPPRESSBLANKLINES
  66. *:               : ALLGROUPS
  67. *:               : RPTCONVERT
  68. *:               : RPTOBJCONVERT
  69. *:               : GETBANDINDEX
  70. *:               : BANDINFO()
  71. *:               : CLONEBAND
  72. *:               : RESIZEBAND
  73. *:               : BANDPOS()
  74. *:               : EMPTYBAND()
  75. *:               : GETBANDCODE()
  76. *:               : CVTREPORTVERTICAL()
  77. *:               : CVTREPORTHORIZONTAL()
  78. *:               : CVTRPTLINES()
  79. *:               : MERGELABELOBJECTS
  80. *:               : LABELOBJMERGE
  81. *:               : ADDLABELBLANKS
  82. *:               : LINESBETWEEN
  83. *:               : LABELBANDS
  84. *:               : LABELLINES
  85. *:               : CALCPOSITIONS
  86. *:               : CALCWINDOWDIMENSIONS
  87. *:               : FINDWIDEROBJECTS
  88. *:               : ADJHPOS
  89. *:               : SGN()
  90. *:               : REPOOBJECTS
  91. *:               : ADJITEMSINBOXES
  92. *:               : ITEMSINBOXES
  93. *:               : FINDOTHERSONLINE()
  94. *:               : ADJINVBTNS
  95. *:               : ADJPOSTINV
  96. *:               : FINDALIGNEND()
  97. *:               : STRETCHLINESTOBORDERS
  98. *:               : JOINLINES
  99. *:               : JOINHORIZONTAL
  100. *:               : JOINVERTICAL
  101. *:               : MEETBOXCHAR
  102. *:               : ZAPBOXCHAR
  103. *:               : ADDJOIN
  104. *:               : REJOINBOXES
  105. *:               : JOINLINEWIDTH()
  106. *:               : GETLASTOBJECTLINE()
  107. *:               : ADJOBJCODE
  108. *:               : GETWINDFONT
  109. *:               : ADJHEIGHTANDWIDTH
  110. *:               : COLUMNAR()
  111. *:               : DOSSIZE()
  112. *:               : ADJBITMAPCTRL
  113. *:               : ADJCOLOR
  114. *:               : RGBTOX()
  115. *:               : ADJPEN
  116. *:               : ADJFONT
  117. *:               : CONVERTCOLORPAIR
  118. *:               : GETCOLOR()
  119. *:               : WHATSTYLE()
  120. *:               : ADJTEXT
  121. *:               : ADJBOX
  122. *:               : GETLINEWIDTH()
  123. *:               : HORIZBUTTON()
  124. *:               : MAXBTNWIDTH()
  125. *:               : GETOBJWIDTH()
  126. *:               : GETOBJHEIGHT()
  127. *:               : GETRIGHTMOST
  128. *:               : GETLOWEST
  129. *:               : DOCREATE
  130. *:               : ADDGRAPHICALLABELGROUPS
  131. *:               : UPDATELABELDATA
  132. *:               : PLATFORMDEFAULTS
  133. *:               : UPDATEVERSION
  134. *:               : STAMPVAL()
  135. *:               : SHIFTL()
  136. *:               : SHIFTR()
  137. *:               : EMPTYPLATFORM()
  138. *:               : STRUCTDIALOG()
  139. *:               : CURPOS()
  140. *:               : SCXFRXDIALOG()
  141. *:               : TRANSPRMPT()
  142. *:               : RDVALID()
  143. *:               : DEACCLAU()
  144. *:               : SHOWCLAU()
  145. *:               : SCRNCTRL()
  146. *:               : ENABLEPROC()
  147. *:               : PVALID()
  148. *:               : ACTTHERM
  149. *:               : DEACTTHERM
  150. *:               : CLEANWIND
  151. *:               : ESCHANDLER
  152. *:               : ERRSHOW
  153. *:               : JUSTSTEM()
  154. *:               : WRITERESULT
  155. *:               : ISOBJECT()
  156. *:               : ISREPTOBJECT()
  157. *:               : ISGRAPHOBJ()
  158. *:               : HASRECORDS()
  159. *:               : ASKFONT()
  160. *:               : IS20SCX()
  161. *:               : IS20FRX()
  162. *:               : IS20LBX()
  163. *:               : GETSNIPFLAG()
  164. *:               : MATCH()
  165. *:               : WORDNUM()
  166. *:               : ADDBS()
  167. *:               : JUSTFNAME()
  168. *:               : JUSTPATH()
  169. *:               : FORCEEXT()
  170. *:               : CVTLONG()
  171. *:               : CVTSHORT()
  172. *:               : CVTBYTE()
  173. *:               : OBJ2BASEFONT()
  174. *:               : VERSIONCAP()
  175. *:               : BLACKBOX()
  176. *:               : SELECTOBJ
  177. *:               : INITSEL
  178. *:               : ADDSEL
  179. *:               : ISSELECTED()
  180. *:               : ASSEMBLE()
  181. *:               : TYPE2NAME()
  182. *:               : CLEANPICT()
  183. *:               : TPSELECT
  184. *:               : TOGGLE()
  185. *:               : OKVALID()
  186. *:               : WREADDEAC()
  187. *:
  188. *:          Calls: SETALL             (procedure in TRANSPRT.PRG)
  189. *:               : ERRORHANDLER       (procedure in TRANSPRT.PRG)
  190. *:               : STRIPPATH()        (function  in TRANSPRT.PRG)
  191. *:               : CLEANUP            (procedure in TRANSPRT.PRG)
  192. *:               : SETVERSION         (procedure in TRANSPRT.PRG)
  193. *:               : GETOLDREPORTTYPE() (function  in TRANSPRT.PRG)
  194. *:               : DOUPDATE()         (function  in TRANSPRT.PRG)
  195. *:               : CVRT102FRX()       (function  in TRANSPRT.PRG)
  196. *:               : CVRTFBPRPT         (procedure in TRANSPRT.PRG)
  197. *:               : OPENDBF()          (function  in TRANSPRT.PRG)
  198. *:               : STARTTHERM         (procedure in TRANSPRT.PRG)
  199. *:               : CONVERTER          (procedure in TRANSPRT.PRG)
  200. *:               : UPDTHERM           (procedure in TRANSPRT.PRG)
  201. *:               : IMPORT             (procedure in TRANSPRT.PRG)
  202. *:               : SYNCHTIME          (procedure in TRANSPRT.PRG)
  203. *:               : CONVERTTYPE()      (function  in TRANSPRT.PRG)
  204. *:               : MAKECURSOR         (procedure in TRANSPRT.PRG)
  205. *:
  206. *:      Documented              FoxDoc version 3.00a
  207. *:*****************************************************************************
  208. *
  209. * TRANSPORT - FoxPro screen, report and label conversion utility.
  210. *
  211. *:*****************************************************************************
  212. * Copyright (c) 1993 Microsoft Corp.
  213. * One Microsoft Way
  214. * Redmond, WA 98052
  215. *
  216. * Notes:
  217. * In this program, for clarity/readability reasons, we use variable
  218. * names that are longer than 10 characters.  Note, however, that only
  219. * the first 10 characters are significant.
  220. *
  221. *
  222. * Revision History:
  223. * First written by Matt Pohle, John Beaver and Walt Kennamer for FoxPro 2.5
  224. *
  225.  
  226. PROCEDURE transprt
  227. PARAMETER m.g_scrndbf, m.tp_filetype, m.dummy
  228. * "g_crndbf" is the name of the file to transport.  It will usually be in some sort
  229. * of database format (e.g., SCX/PJX/MNX) but might also be a FoxBASE+ or FoxPro 1.02
  230. * report or label file, which is not a database.
  231. *
  232. * "tp_filetype" specifies what kind of file "g_scrndbf" is.  Allowable values are
  233. * found in the #DEFINE constants immediately below.  Note that the Transporter usually
  234. * does not use this value and instead figures out what kind of file it is being
  235. * presented with by counting the fields in the database.  For FoxBASE+ and FoxPro 1.02 files,
  236. * however, the Transporter does use this parameter to convert the report or label
  237. * data into 2.0 database format before transporting to Windows.  Note that the FoxBASE+
  238. * types are never actually passed in m.tp_filetype.  They are inferred in GetOldReportType
  239. * and GetOldLabelTypefrom the ID byte in the report/label files.
  240.  
  241. * The "dummy" parameter is not used.  At one point in the developement of the Transporter,
  242. * another parameter was passed.
  243.  
  244. *
  245. * Define Global Constants
  246. *
  247. * Filetype constants for FoxPro 2.0 and FoxPro 2.5 formats
  248. #DEFINE c_20pjxtype        1
  249. #DEFINE c_25scxtype       12
  250. #DEFINE c_20scxtype        2
  251. #DEFINE c_25frxtype       13
  252. #DEFINE c_20frxtype        3
  253. #DEFINE c_25lbxtype       14
  254. #DEFINE c_20lbxtype        4
  255. * FoxPro 1.02 and FoxBASE+ formats.  Note that the FoxBASE+ types are never
  256. * actually passed in m.tp_filetype.  They are inferred in GetOldReportType and
  257. * GetOldLabelTypefrom the ID byte in the report/label files.  The suffix tells
  258. * us how the file was called, by REPORT FORM ... or by MODIFY REPORT ...
  259. #DEFINE c_frx102repo      23
  260. #DEFINE c_frx102modi      33
  261. #DEFINE c_fbprptrepo      43
  262. #DEFINE c_fbprptmodi      53
  263. #DEFINE c_lbx102repo      24
  264. #DEFINE c_lbx102modi      34
  265. #DEFINE c_fbplblrepo      44
  266. #DEFINE c_fbplblmodi      54
  267.  
  268. * Definitions for Objtype fields in screens/reports/labels
  269. #DEFINE c_otheader         1
  270. #DEFINE c_otworkar         2
  271. #DEFINE c_otindex          3
  272. #DEFINE c_otrel            4
  273. #DEFINE c_ottext           5
  274. #DEFINE c_otline           6
  275. #DEFINE c_otbox            7
  276. #DEFINE c_otrepfld         8
  277. #DEFINE c_otband           9
  278. #DEFINE c_otgroup         10
  279. #DEFINE c_otlist          11
  280. #DEFINE c_ottxtbut        12
  281. #DEFINE c_otradbut        13
  282. #DEFINE c_otchkbox        14
  283. #DEFINE c_otfield         15
  284. #DEFINE c_otpopup         16
  285. #DEFINE c_otpicture       17
  286. #DEFINE c_otrepvar        18
  287. #DEFINE c_ot20lbxobj      19
  288. #DEFINE c_otinvbut        20
  289. #DEFINE c_otpdset         21
  290. #DEFINE c_otspinner       22
  291. #DEFINE c_otfontdata      23
  292.  
  293. * Window types
  294. #DEFINE c_user             1
  295. #DEFINE c_system           2
  296. #DEFINE c_dialog           3
  297. #DEFINE c_alert            4
  298.  
  299. * ObjCode definitions
  300. #DEFINE c_sgsay            0
  301. #DEFINE c_sgget            1
  302. #DEFINE c_sgedit           2
  303. #DEFINE c_sgfrom           3
  304. #DEFINE c_sgbox            4
  305. #DEFINE c_sgboxd           5
  306. #DEFINE c_sgboxp           6
  307. #DEFINE c_sgboxc           7
  308.  
  309. #DEFINE c_lnvertical       0
  310. #DEFINE c_lnhorizontal     1
  311.  
  312. #DEFINE c_ocboxgrp         1
  313.  
  314. * Attempt to preserve colors of text, lines and boxes when transporting to DOS?
  315. #DEFINE c_maptextcolor     .T.
  316.  
  317. * Field counts
  318. #DEFINE c_20scxfld        57
  319. #DEFINE c_scxfld          79
  320. #DEFINE c_20frxfld        36
  321. #DEFINE c_frxfld          74
  322. #DEFINE c_ot20label       30
  323. #DEFINE c_20lbxfld        17
  324. #DEFINE c_20pjxfld        33
  325. #DEFINE c_pjxfld          31
  326.  
  327. * Metrics for various objects, report bands, etc.
  328. #DEFINE c_pophght      1.231
  329. #DEFINE c_radhght      1.308
  330. #DEFINE c_chkhght      1.308
  331. #DEFINE c_listht       1.000
  332. #DEFINE c_adjfld       0.125
  333. #DEFINE c_adjlist      0.125
  334. #DEFINE c_adjtbtn      0.769
  335. #DEFINE c_adjrbtn      0.308
  336. #DEFINE c_vchkbox      0.154
  337. #DEFINE c_vradbtn      0.154
  338. #DEFINE c_vpopup       0.906
  339. #DEFINE c_vlist        0.500
  340. #DEFINE c_hpopup       1.000
  341. #DEFINE c_adjbox       0.500
  342. #DEFINE c_chkpixel        12
  343.  
  344. #DEFINE c_pixelsize       96
  345. #DEFINE c_bandheight   ((19/96) * 10000)
  346. #DEFINE c_bandfudge    4350
  347.  
  348. #DEFINE c_charrptheight   66
  349. #DEFINE c_charrptwidth    80
  350. #DEFINE c_linesperinch    (66/11)
  351. #DEFINE c_charsperinch    13.71
  352.  
  353. * Version codes, put into Objcode fields in the header record
  354. #DEFINE c_25scx           63
  355. #DEFINE c_25frx           53
  356.  
  357. * Major file types
  358. #DEFINE c_report           0
  359. #DEFINE c_screen           1
  360. #DEFINE c_label            2
  361. #DEFINE c_project          3
  362.  
  363. * Error codes
  364. #DEFINE c_error1   "Minor"
  365. #DEFINE c_error2   "Serious"
  366. #DEFINE c_error3   "Fatal"
  367.  
  368. * Font style for Transporter dialogs
  369. #DEFINE c_dlgface   "MS Sans Serif"
  370. #DEFINE c_dlgsize   8.000
  371. #DEFINE c_dlgstyle  "BT"
  372. #DEFINE c_dlgsty1   "BO"
  373.  
  374. * Return values
  375. #DEFINE c_yes              1
  376. #DEFINE c_no               0
  377. #DEFINE c_cancel          -1
  378.  
  379. * Codepage translation
  380. #DEFINE c_cptrans       .T.    && do special CP translation for FoxBASE+ and FoxPro 1.02?
  381. #DEFINE c_doscp          437   && default DOS code page
  382. #DEFINE c_wincp         1252   && default Windows code page
  383. #DEFINE c_maccp            0
  384. #DEFINE c_unixcp           0
  385.  
  386. * bands[] array indexes
  387. #DEFINE c_tobandvpos       1
  388. #DEFINE c_tobandheight     2
  389. #DEFINE c_fmbandvpos       3
  390. #DEFINE c_fmbandheight     4
  391.  
  392. * Defines used in converting FoxBASE+ reports
  393. #DEFINE maxliterals    55
  394. #DEFINE litpoolsize    1452
  395. #DEFINE maxrepflds    24
  396. #DEFINE h_page    1
  397. #DEFINE h_break 3
  398. #DEFINE l_item    4
  399. #DEFINE f_break 5
  400. #DEFINE f_page    7
  401. #DEFINE f_rpt    8
  402.  
  403. PRIVATE ALL
  404.  
  405. IF SET("TALK") = "ON"
  406.    SET TALK OFF
  407.    m.talkset = "ON"
  408. ELSE
  409.    m.talkset = "OFF"
  410. ENDIF
  411. m.pcount = PARAMETERS()
  412. PUSH KEY
  413.  
  414. *
  415. * Declare Environment Variables so that they are visible throughout the program
  416. *
  417. STORE "" TO m.cursor, m.consol, m.bell, m.exact, m.escape, m.onescape, m.safety, ;
  418.    m.fixed, m.print, m.unqset, m.udfparms, m.exclusive, m.onerror, ;
  419.    m.trbetween, m.comp, m.device, m.status, m.g_fromplatform, m.choice, ;
  420.    m.g_fromobjonlyalias, m.g_boxeditemsalias, m.g_tempalias, m.mtopic, m.rbord, m.mcollate
  421. STORE 0 TO m.deci, m.memowidth, m.currarea
  422.  
  423. DO setall
  424.  
  425. * Set default typeface for reports
  426. m.g_rptfface            = "Courier"
  427. m.g_rptfstyle           = 0
  428. m.g_rpttxtfontstyle     = ""
  429. m.g_rptfsize            = 8
  430. IF _MAC OR _WINDOWS
  431.    m.g_rptlinesize      = (FONTMETRIC(1, m.g_rptfface, m.g_rptfsize, m.g_rpttxtfontstyle) / c_pixelsize) * 10000
  432.    m.g_rptcharsize      = (FONTMETRIC(6, m.g_rptfface, m.g_rptfsize, m.g_rpttxtfontstyle) / c_pixelsize) * 10000
  433. ENDIF
  434.  
  435. * Font selections for fields/text in the SCX/FRX itself.  May be overridden by user.
  436. m.g_fontface         = "MS Sans Serif"
  437. m.g_fontsize         = 8
  438. m.g_fontstyle        = "B"
  439.  
  440. * Font selections for controls in the SCX/FRX.  Not overrideable.
  441. m.g_cfontface        = "MS Sans Serif"
  442. m.g_cfontsize        = 8
  443.  
  444. m.g_foxfont          = "Foxfont"
  445. m.g_normstyle        = 0
  446. m.g_boldstyle        = 1
  447.  
  448. m.g_filetype         = " "
  449. m.g_fromplatform     = " "
  450. m.g_toplatform       = " "
  451. m.g_windheight       = 1
  452. m.g_windwidth        = 1
  453. m.g_thermwidth       = 0
  454. m.g_mercury          = 0
  455. m.g_20alias          = ""
  456. m.g_status           = 0
  457. m.g_energize         = .F.
  458. m.g_norepeat         = .F.
  459.  
  460. m.g_allobjects       = .T.
  461. m.g_newobjects       = .T.
  462. m.g_snippets         = .T.
  463. m.g_scrnalias        = ""
  464. m.g_updenviron       = .F.  && have we transported the environment records?
  465. m.g_tpselcnt         = 0    && number of entries in the tparray selection array
  466.  
  467. ***** CGC MYF *****
  468.  
  469. m.g_boxstrg = [8,8,'│','│','┌','┐','└','┘',8,8,'│','│','┌','┐','└','┘']
  470. ***** CGC MYF *****
  471.  
  472. m.g_returncode       = c_cancel
  473.  
  474. m.g_tocodepage       = 0
  475. m.g_fromcodepage     = 0
  476.  
  477. * Dimension the array of records to be transported.  This is the picklist of new and
  478. * updated objects.
  479. DIMENSION tparray[1,2]
  480.  
  481. DIMENSION g_lastobjectline[2]
  482. g_lastobjectline = 0
  483. m.g_tempindex = "S" + SUBSTR(LOWER(SYS(3)),2,8) + ".cdx"
  484.  
  485. m.onerror = ON("ERROR")
  486. ON ERROR DO errorhandler WITH MESSAGE(), LINENO(), c_error3
  487.  
  488. IF m.pcount < 2
  489.    DO ErrorHandler WITH "Invalid number of parameters",LINENO(),c_error3
  490. ENDIF
  491.  
  492. *
  493. * Make sure we have a file name we can deal with.  Prompt if the file cannot be found.
  494. *
  495. IF TYPE("m.g_scrndbf") != "C"
  496.    m.g_scrndbf = ""
  497. ENDIF
  498. m.g_scrndbf = UPPER(ALLTRIM(m.g_scrndbf))
  499. DO CASE
  500. CASE SUBSTR(m.g_scrndbf, RAT(".", m.g_scrndbf)+1, 3) = "SCX"
  501.    IF !FILE(m.g_scrndbf)
  502.       m.g_scrndbf = GETFILE("SCX", "Where is "+strippath(m.g_scrndbf))
  503.    ENDIF
  504. CASE SUBSTR(m.g_scrndbf, RAT(".", m.g_scrndbf)+1, 3) = "FRX"
  505.    IF !FILE(m.g_scrndbf)
  506.       m.g_scrndbf = GETFILE("FRX", "Where is "+strippath(m.g_scrndbf))
  507.    ENDIF
  508. CASE SUBSTR(m.g_scrndbf, RAT(".", m.g_scrndbf)+1, 3) = "LBX"
  509.    IF !FILE(m.g_scrndbf)
  510.       m.g_scrndbf = GETFILE("LBX", "Where is "+strippath(m.g_scrndbf))
  511.    ENDIF
  512. CASE SUBSTR(m.g_scrndbf, RAT(".", m.g_scrndbf)+1, 3) = "PJX"
  513.    IF !FILE(m.g_scrndbf)
  514.       m.g_scrndbf = GETFILE("PJX", "Where is "+strippath(m.g_scrndbf))
  515.    ENDIF
  516. OTHERWISE
  517.    IF !FILE(m.g_scrndbf)
  518.       m.g_scrndbf = GETFILE("SCX|FRX|LBX|PJX", "Select the file to transport", "Transport")
  519.    ENDIF
  520. ENDCASE
  521.  
  522. IF !FILE(m.g_scrndbf) OR EMPTY(m.g_scrndbf)
  523.    DO cleanup
  524.    RETURN .F.
  525. ENDIF
  526.  
  527. DO putwinmsg WITH "FoxPro Transporter: " + LOWER(strippath(m.g_scrndbf))
  528.  
  529. DO setversion
  530.  
  531. * If we've been passed an old format report or label form, see if it is a FoxPro 1.02
  532. * form, a FoxBASE+ form, or an unknown form. 
  533. * Convert FoxPro 1.02 or FoxBASE+ DOS reports into 2.5 DOS reports
  534. IF INLIST(m.tp_filetype,c_frx102modi,c_frx102repo,c_lbx102modi, c_lbx102repo)
  535.    IF INLIST(m.tp_filetype,c_frx102modi,c_frx102repo)
  536.       m.tp_filetype = getoldreporttype()   && FoxPro 1.02 or FoxBASE+ report?
  537.    ELSE
  538.       m.tp_filetype = getoldlabeltype()    && FoxPro 1.02 or FoxBASE+ label?
  539.    ENDIF
  540.    
  541.    m.g_fromcodepage = c_doscp
  542.      
  543.    IF doupdate()           && prompt to convert to 2.5 format; sets m.g_filetype
  544.       DO CASE
  545.       CASE INLIST(m.tp_filetype,c_frx102modi,c_frx102repo)
  546.          * FoxPro 1.02 report
  547.          m.g_scrndbf = cvrt102frx(m.g_scrndbf, m.tp_filetype)
  548.       CASE INLIST(m.tp_filetype,c_fbprptmodi,c_fbprptrepo)
  549.          * FoxBASE+ report
  550.          m.g_scrndbf = cvrtfbprpt(m.g_scrndbf, m.tp_filetype)
  551.       CASE INLIST(m.tp_filetype,c_lbx102modi,c_lbx102repo)
  552.          * FoxPro 1.02 label
  553.          m.g_scrndbf = cvrt102lbx(m.g_scrndbf, m.tp_filetype)
  554.       CASE INLIST(m.tp_filetype,c_fbplblmodi,c_fbplblrepo)
  555.          * FoxBASE+ label
  556.          m.g_scrndbf = cvrtfbplbl(m.g_scrndbf, m.tp_filetype)
  557.       OTHERWISE
  558.          DO errorhandler WITH "Unknown report format",LINENO(),c_error3
  559.       ENDCASE
  560.    ELSE
  561.       DO cleanup
  562.       RETURN c_cancel
  563.    ENDIF
  564. ENDIF
  565.  
  566. * Open the screen/report/label/project file
  567. IF !opendbf(m.g_scrndbf)
  568.    m.g_returncode = c_cancel
  569. ENDIF
  570.  
  571. *
  572. * We have three basic conversion cases.  These are transporting a 2.0 file to a 
  573. * graphical 2.5 platform (structure change and conversion), converting a 2.0 file 
  574. * to a character 2.5 platform (structure change) and transporting a 2.5 platform 
  575. * to another 2.5 platform (character/graphical conversion).  This case statement
  576. * calls the appropriate dialog routines and makes sure we have done all the 
  577. * preparation (like creating the cursor we actually work with.)
  578. *
  579. * The 1.02 and FoxBASE+ reports/labels are handled in basically the same way.  
  580. * They get their own cases in this construct since we don't want to prompt the 
  581. * user twice for conversion.  Almost all of the actual conversion of these files 
  582. * has already taken place, in the "cvrt102frx" procedure (and related procedures) 
  583. * called above.
  584. *
  585. * Conversion of 2.0 project files is handled in its own case also.
  586. *
  587. DO CASE
  588. CASE INLIST(m.tp_filetype,c_frx102repo,c_fbprptrepo,c_lbx102repo,c_fbplblrepo) ;
  589.        AND (_WINDOWS OR _MAC)
  590.    * FoxPro 1.02 or FoxBASE+ report/label opened via REPORT/LABEL FORM.  At this point, 
  591.    * we've already converted the old format form into FoxPro 2.5 DOS format.
  592.    * Finish conversion, but don't transport it to Windows.
  593.    m.g_fromplatform = "DOS"
  594.    DO getcodepage
  595.    m.g_returncode = c_yes
  596.    DO starttherm WITH "Converting",g_filetype
  597.    DO putwinmsg WITH "Converting " + LOWER(strippath(m.g_scrndbf))
  598.    DO converter
  599.    DO updtherm WITH 100
  600.    
  601. CASE INLIST(m.tp_filetype,c_frx102modi,c_fbprptmodi,c_lbx102modi,c_fbplblmodi) ;
  602.        AND (_WINDOWS OR _MAC)
  603.    * FoxPro 1.02 or FoxBASE+ report/label opened via MODIFY REPORT/LABEL. At this point,
  604.    *  we've already converted the old format form into FoxPro 2.5 DOS format.
  605.    * Finish conversion, and then transport it to Windows.
  606.    m.g_fromplatform = "DOS"
  607.    DO getcodepage
  608.    m.g_returncode = c_yes
  609.    DO putwinmsg WITH "Converting " + LOWER(strippath(m.g_scrndbf))
  610.    DO converter
  611.    DO putwinmsg WITH "Transporting " + LOWER(strippath(m.g_scrndbf))
  612.    DO import
  613.    DO synchtime WITH m.g_toplatform, m.g_fromplatform
  614.    DO updtherm WITH 100
  615.    
  616. CASE ((FCOUNT() = c_20scxfld OR FCOUNT() = c_20frxfld OR FCOUNT() = c_20lbxfld);
  617.       AND (_DOS OR _UNIX))
  618.    * Convert it to a DOS report, but don't transport it to Windows
  619.    DO CASE
  620.    CASE !doupdate()  && displays dialog and sets g_toPlatform
  621.       m.g_returncode = c_cancel
  622.    OTHERWISE
  623.       m.g_fromplatform = "DOS"
  624.       DO getcodepage
  625.       m.g_returncode = c_yes
  626.       DO starttherm WITH "Converting",g_filetype
  627.       DO converter
  628.       DO updtherm WITH 100
  629.    ENDCASE
  630.    
  631. CASE (FCOUNT() = c_20scxfld OR FCOUNT() = c_20frxfld ;
  632.       OR FCOUNT() = c_20lbxfld) AND (_WINDOWS OR _MAC)
  633.    
  634.    * Convert it to DOS and then transport it to Windows
  635.    m.choice = converttype(.T.)
  636.    DO getcodepage
  637.       
  638.    DO CASE
  639.    CASE m.choice = c_yes
  640.       m.g_returncode = c_yes
  641.       DO converter
  642.       DO import
  643.       DO synchtime WITH m.g_toplatform, m.g_fromplatform
  644.       DO updtherm WITH 100
  645.    CASE m.choice = c_no
  646.       m.g_returncode = c_no
  647.       
  648.    OTHERWISE
  649.       m.g_returncode = c_cancel
  650.    ENDCASE
  651.    
  652. CASE FCOUNT() = c_scxfld OR FCOUNT() = c_frxfld
  653.    m.choice = converttype(.F.)
  654.    DO CASE
  655.    CASE m.choice = c_yes
  656.       m.g_returncode = c_yes
  657.       DO makecursor
  658.       DO import
  659.       IF m.g_returncode <> c_cancel
  660.          * This might happen if the user picked "Cancel" on the screen that lets
  661.          * him/her uncheck specific items.
  662.          SELECT (m.g_scrnalias)
  663.          DO synchtime WITH m.g_toplatform, m.g_fromplatform
  664.          DO updtherm WITH 100
  665.       ENDIF
  666.    CASE m.choice = c_no
  667.       m.g_returncode = c_no
  668.       
  669.    OTHERWISE
  670.       m.g_returncode = c_cancel
  671.    ENDCASE
  672. CASE FCOUNT() = c_20pjxfld
  673.    IF versnum() > "2.5"
  674.       * Identify fields that contain binary data.  These should not be codepage-translated.
  675.       * Note that files opened via low level routines (e.g., FoxPro 1.02 reports) will not 
  676.       * be codepage-translated automatically.  Strings in those files that require codepage
  677.       * translation will be codepage translated explicitly below.
  678.       SET NOCPTRANS TO arranged, object, symbols, devinfo
  679.    ENDIF
  680.  
  681.    * Converting a 2.0 project to 2.5 format
  682.    IF !doupdate()                 && displays dialog and sets g_toPlatform
  683.       m.g_returncode = c_cancel
  684.    ELSE
  685.       m.g_fromplatform = "DOS"
  686.       DO getcodepage
  687.       m.g_returncode = c_yes
  688.       DO putwinmsg WITH "Converting " + LOWER(strippath(m.g_scrndbf))
  689.       DO starttherm WITH "Converting",g_filetype
  690.       DO converter
  691.       DO updtherm WITH 100
  692.    ENDIF
  693. CASE FCOUNT() = c_pjxfld
  694.    * 2.5 project passed to us by mistake--shouldn't ever happen.
  695.    WAIT WINDOW "The transporter has nothing to do." NOWAIT
  696.    m.g_returncode = c_cancel
  697. OTHERWISE
  698.    DO errorhandler WITH "Unknown or invalid file format", LINENO(), c_error3
  699.    m.g_returncode = c_cancel
  700. ENDCASE
  701.  
  702. DO cleanup
  703. RETURN m.g_returncode
  704.  
  705. *!*****************************************************************************
  706. *!
  707. *!       Function: OPENDBF
  708. *!
  709. *!      Called by: TRANSPRT.PRG                      
  710. *!
  711. *!*****************************************************************************
  712. FUNCTION opendbf
  713. PARAMETER fname
  714. m.g_scrnalias = "S"+SUBSTR(LOWER(SYS(3)),2,8)
  715. SELECT 0
  716. USE (m.fname) AGAIN ALIAS (m.g_scrnalias)
  717. IF RECCOUNT() = 0
  718.    WAIT WINDOW "No records to transport" NOWAIT
  719.    RETURN .F.
  720. ENDIF
  721. RETURN .T.
  722.  
  723. *
  724. * doupdate - Ask the user if a 2.0 screen/report/label should be updated to 2.5 format.
  725. *
  726. *!*****************************************************************************
  727. *!
  728. *!       Function: DOUPDATE
  729. *!
  730. *!      Called by: TRANSPRT.PRG                      
  731. *!
  732. *!          Calls: STRUCTDIALOG()     (function  in TRANSPRT.PRG)
  733. *!
  734. *!*****************************************************************************
  735. FUNCTION doupdate
  736. PRIVATE m.result
  737.  
  738. DO CASE
  739. CASE INLIST(m.tp_filetype,c_frx102modi, c_frx102repo)
  740.    m.g_filetype = c_report
  741.    m.result = structdialog("Convert 1.02 report file to 2.5 format?")
  742.    
  743. CASE INLIST(m.tp_filetype,c_fbprptmodi, c_fbprptrepo)
  744.    m.g_filetype = c_report
  745.    m.result = structdialog("Convert FoxBASE+ report file to FoxPro 2.5 format?")
  746.    
  747. CASE INLIST(m.tp_filetype,c_lbx102modi, c_lbx102repo)
  748.    m.g_filetype = c_label
  749.    m.result = structdialog("Convert 1.02 label file to 2.5 format?")
  750.    
  751. CASE INLIST(m.tp_filetype,c_fbplblmodi, c_fbplblrepo)
  752.    m.g_filetype = c_label
  753.    m.result = structdialog("Convert FoxBASE+ label file to FoxPro 2.5 format?")
  754.    
  755. CASE FCOUNT() = c_20scxfld
  756.    m.g_filetype = c_screen
  757.    m.result = structdialog("Convert 2.0 screen file to 2.5 format?")
  758.    
  759. CASE FCOUNT() = c_20frxfld
  760.    m.g_filetype = c_report
  761.    m.result = structdialog("Convert 2.0 report file to 2.5 format?")
  762.    
  763. CASE FCOUNT() = c_20lbxfld
  764.    RETURN .F.
  765.    
  766. CASE FCOUNT() = c_20pjxfld
  767.    m.g_filetype = c_project
  768.    m.result = structdialog("Convert 2.0 project file to 2.5 format?")
  769. ENDCASE
  770. RETURN m.result
  771.  
  772. *
  773. * converttype - Display the dialog used when converting between 2.5 platforms
  774. *
  775. *!*****************************************************************************
  776. *!
  777. *!       Function: CONVERTTYPE
  778. *!
  779. *!      Called by: TRANSPRT.PRG                      
  780. *!
  781. *!          Calls: CLEANUP            (procedure in TRANSPRT.PRG)
  782. *!               : SCXFRXDIALOG()     (function  in TRANSPRT.PRG)
  783. *!
  784. *!           Uses: M.G_SCRNALIAS      
  785. *!
  786. *!*****************************************************************************
  787. FUNCTION converttype
  788. PARAMETER m.twooh
  789. PRIVATE m.i, m.pcount, m.nplatforms
  790.  
  791. IF m.twooh  && If it's a 2.0 file, there is only one platform to convert from.
  792.    DIMENSION platforms[1]
  793.    platforms[1] = "FoxPro for MS-DOS"
  794.    
  795.    DO CASE                           && Remember the type of file we are converting
  796.    CASE INLIST(m.tp_filetype,c_frx102modi,c_frx102repo,c_fbprptmodi,c_fbprptrepo)
  797.       m.g_filetype = c_report
  798.       
  799.    CASE FCOUNT() = c_20scxfld
  800.       m.g_filetype = c_screen
  801.       
  802.    CASE FCOUNT() = c_20frxfld
  803.       m.g_filetype = c_report
  804.       
  805.    CASE FCOUNT() = c_20lbxfld
  806.       m.g_filetype = c_label
  807.       
  808.    CASE FCOUNT() = c_20pjxfld
  809.       m.g_filetype = c_project
  810.    ENDCASE
  811. ELSE
  812.    IF FCOUNT() = c_scxfld                && Remember the type of file we are converting
  813.       m.g_filetype = c_screen
  814.    ELSE
  815.       IF UPPER(RIGHT(m.g_scrndbf, 4)) = ".LBX"
  816.          LOCATE FOR objtype = c_ot20label OR ;
  817.             ((platform = "WINDOWS" OR platform = "MAC") AND ;
  818.             objtype = c_otheader AND BOTTOM)
  819.          IF FOUND()
  820.             m.g_filetype = c_label
  821.          ELSE
  822.             m.g_filetype = c_report
  823.          ENDIF
  824.       ELSE
  825.          m.g_filetype = c_report
  826.       ENDIF
  827.    ENDIF
  828.    
  829.    * Get a list of the platforms in this file.
  830.    SELECT DISTINCT platform ;
  831.       FROM (m.g_scrnalias) ;
  832.       WHERE !DELETED() ;
  833.       INTO ARRAY availplatforms
  834.    m.nplatforms = _TALLY
  835.    
  836.    m.g_fromplatform = availplatforms[1]
  837.    m.pcount = 0
  838.    
  839.    FOR i = 1 TO m.nplatforms            && Get a list of available platforms excluding the current one.
  840.       DO CASE
  841.       CASE ATC('DOS',availplatforms[m.i]) > 0 AND !_DOS
  842.          m.pcount = m.pcount + 1
  843.          DIMENSION platforms[m.pcount]
  844.          platforms[m.pcount] = 'FoxPro for MS-DOS'
  845.          
  846.       CASE ATC('WINDOWS',availplatforms[m.i]) > 0 AND !_WINDOWS
  847.          m.pcount = m.pcount + 1
  848.          DIMENSION platforms[m.pcount]
  849.          platforms[m.pcount] = 'FoxPro for Windows'
  850.          
  851.       CASE ATC('UNIX',availplatforms[m.i]) > 0 AND !_UNIX
  852.          m.pcount = m.pcount + 1
  853.          DIMENSION platforms[m.pcount]
  854.          platforms[i] = 'FoxPro for Unix'
  855.          
  856.       CASE ATC('MAC',availplatforms[m.i]) > 0 AND !_MAC
  857.          m.pcount = m.pcount + 1
  858.          DIMENSION platforms[m.pcount]
  859.          platforms[i] = 'FoxPro for Macintosh'
  860.       ENDCASE
  861.    ENDFOR
  862.    RELEASE availplatforms
  863.    
  864.    IF m.nplatforms = 0 OR m.pcount = 0                        && There isn't anything to convert from.
  865.       WAIT WINDOW "The transporter has nothing to do." NOWAIT
  866.       DO cleanup
  867.       RETURN c_cancel
  868.    ENDIF
  869. ENDIF
  870.  
  871. *   Call the dialog routine appropriate to this file type.
  872. DO CASE                        && Ask the user what we should do.
  873. CASE m.g_filetype = c_screen
  874.    RETURN scxfrxdialog("SCX")
  875. CASE m.g_filetype = c_report
  876.    RETURN scxfrxdialog("FRX")
  877. CASE m.g_filetype = c_label
  878.    RETURN scxfrxdialog("LBX")
  879. ENDCASE
  880. RETURN c_cancel
  881.  
  882. *
  883. * setversion - set global variable m.g_toPlatform with the name of the platform
  884. *            we are running on.
  885. *
  886. *!*****************************************************************************
  887. *!
  888. *!      Procedure: SETVERSION
  889. *!
  890. *!      Called by: TRANSPRT.PRG                      
  891. *!
  892. *!          Calls: ERRORHANDLER       (procedure in TRANSPRT.PRG)
  893. *!
  894. *!*****************************************************************************
  895. PROCEDURE setversion
  896.  
  897. DO CASE
  898. CASE _WINDOWS
  899.    m.g_toplatform = "WINDOWS"
  900.    m.g_tocodepage = c_wincp
  901. CASE _MAC
  902.    m.g_toplatform = "MAC"
  903.    m.g_tocodepage = c_maccp
  904. CASE _UNIX
  905.    m.g_toplatform = "UNIX"
  906.    m.g_tocodepage = c_unixcp
  907. CASE _DOS
  908.    m.g_toplatform = "DOS"
  909.    m.g_tocodepage = c_doscp
  910. OTHERWISE
  911.    DO errorhandler WITH "Unknown Version of FoxPro.", LINENO(), c_error3
  912. ENDCASE
  913.  
  914. *
  915. * import - Do the import.
  916. *
  917. *!*****************************************************************************
  918. *!
  919. *!      Procedure: IMPORT
  920. *!
  921. *!      Called by: TRANSPRT.PRG                      
  922. *!
  923. *!          Calls: EMPTYPLATFORM()    (function  in TRANSPRT.PRG)
  924. *!               : GETCHARSUPPRESS()  (function  in TRANSPRT.PRG)
  925. *!               : CHARTOGRAPHIC      (procedure in TRANSPRT.PRG)
  926. *!               : GRAPHICTOCHAR      (procedure in TRANSPRT.PRG)
  927. *!
  928. *!           Uses: M.G_SCRNALIAS      
  929. *!
  930. *!*****************************************************************************
  931. PROCEDURE import
  932. IF m.g_fromplatform = m.g_toplatform
  933.    RETURN
  934. ELSE
  935.    *   If we are converting everything, remove all records for the target
  936.    *   platform.
  937.    IF m.g_allobjects AND !emptyplatform(m.g_toplatform)
  938.       * We need to copy the records we want to a temporary file, clear our cursor
  939.       * and copy the records back since you can't pack a cursor and SELECT creates
  940.       * a read only cursor.
  941.       m.g_tempalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  942.       SELECT * FROM (m.g_scrnalias) ;
  943.          WHERE !DELETED() AND platform <> m.g_toplatform ;
  944.          INTO TABLE (m.g_tempalias)
  945.       SELECT (m.g_scrnalias)
  946.       ZAP
  947.       APPEND FROM (m.g_tempalias)
  948.       SELECT (m.g_tempalias)
  949.       USE
  950.       DELETE FILE (m.g_tempalias+".dbf")
  951.       DELETE FILE (m.g_tempalias+".fpt")
  952.       SELECT (m.g_scrnalias)
  953.    ENDIF
  954.    
  955.    *   Are we converting from graphics to a character
  956.    *   based screen?
  957.    m.g_tographic =  (m.g_toplatform = 'WINDOWS' OR m.g_toplatform = 'MAC') AND ;
  958.       (m.g_fromplatform = 'DOS' OR m.g_fromplatform = 'UNIX')
  959. ENDIF
  960.  
  961. IF g_filetype = c_report
  962.    m.g_norepeat = getcharsuppress()
  963. ENDIF
  964.  
  965. *  Pass control to the control routine appropriate for the direction we are converting.
  966. DO CASE
  967. CASE m.g_tographic
  968.    DO chartographic
  969. CASE !m.g_tographic
  970.    DO graphictochar
  971. ENDCASE
  972. RETURN
  973.  
  974. *
  975. * GraphicToChar - Converts everything, new objects or changed snippets from a grpahical
  976. *      platform to a character platform.
  977. *
  978. *!*****************************************************************************
  979. *!
  980. *!      Procedure: GRAPHICTOCHAR
  981. *!
  982. *!      Called by: IMPORT             (procedure in TRANSPRT.PRG)
  983. *!
  984. *!          Calls: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  985. *!               : SELECTOBJ          (procedure in TRANSPRT.PRG)
  986. *!               : STARTTHERM         (procedure in TRANSPRT.PRG)
  987. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  988. *!               : UPDATESCREEN       (procedure in TRANSPRT.PRG)
  989. *!               : UPDATEREPORT       (procedure in TRANSPRT.PRG)
  990. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  991. *!
  992. *!*****************************************************************************
  993. PROCEDURE graphictochar
  994. IF m.g_allobjects
  995.    *  Start the thermometer with the appropriate message.
  996.    DO starttherm WITH "Transporting",m.g_filetype
  997.    
  998.    DO allgraphictochar
  999. ELSE
  1000.    * Do a partial conversion, unless we're dealing with a label
  1001.    IF m.g_filetype = c_label      && We only do complete label conversion
  1002.       RETURN
  1003.    ENDIF
  1004.    
  1005.    DO selectobj   && figure out which ones to transport
  1006.    
  1007.    *  Start the thermometer with the appropriate message.
  1008.    DO starttherm WITH "Transporting",m.g_filetype
  1009.    
  1010.    m.g_mercury = 5
  1011.    DO updtherm WITH m.g_mercury
  1012.    
  1013.    DO putwinmsg WITH "Transporting " + LOWER(strippath(m.g_scrndbf))
  1014.    
  1015.    SELECT (m.g_scrnalias)
  1016.    
  1017.    IF m.g_snippets
  1018.       IF m.g_filetype = c_screen
  1019.          DO updatescreen
  1020.       ELSE
  1021.          DO updatereport
  1022.       ENDIF
  1023.    ENDIF
  1024.    IF m.g_newobjects
  1025.       DO newgraphictochar
  1026.    ENDIF
  1027. ENDIF
  1028.  
  1029. *
  1030. * CharToGraphic - Converts everything, new objects or changed snippets from a character
  1031. *      platform to a graphical platform.
  1032. *
  1033. *!*****************************************************************************
  1034. *!
  1035. *!      Procedure: CHARTOGRAPHIC
  1036. *!
  1037. *!      Called by: IMPORT             (procedure in TRANSPRT.PRG)
  1038. *!
  1039. *!          Calls: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  1040. *!               : SELECTOBJ          (procedure in TRANSPRT.PRG)
  1041. *!               : STARTTHERM         (procedure in TRANSPRT.PRG)
  1042. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1043. *!               : UPDATESCREEN       (procedure in TRANSPRT.PRG)
  1044. *!               : UPDATEREPORT       (procedure in TRANSPRT.PRG)
  1045. *!               : NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  1046. *!
  1047. *!*****************************************************************************
  1048. PROCEDURE chartographic
  1049. IF m.g_allobjects
  1050.    *  Start the thermometer with the appropriate message.
  1051.    DO starttherm WITH "Transporting",m.g_filetype
  1052.    
  1053.    DO allchartographic
  1054. ELSE
  1055.    IF m.g_filetype = c_label      && We only do complete label convertsion
  1056.       RETURN
  1057.    ENDIF
  1058.    
  1059.    DO selectobj   && figure out which ones to transport
  1060.    
  1061.    *  Start the thermometer with the appropriate message.
  1062.    DO starttherm WITH "Transporting",m.g_filetype
  1063.    
  1064.    m.g_mercury = 5
  1065.    DO updtherm WITH m.g_mercury
  1066.  
  1067.    DO putwinmsg WITH "Transporting " + LOWER(strippath(m.g_scrndbf))
  1068.    
  1069.    SELECT (m.g_scrnalias)
  1070.    
  1071.    IF m.g_snippets
  1072.       IF m.g_filetype = c_screen
  1073.          DO updatescreen
  1074.       ELSE
  1075.          DO updatereport
  1076.       ENDIF
  1077.    ENDIF
  1078.    IF m.g_newobjects
  1079.       DO newchartographic
  1080.    ENDIF
  1081. ENDIF
  1082.  
  1083. *
  1084. * UpdateScreen - Copy any non-platform specific
  1085. *
  1086. *!*****************************************************************************
  1087. *!
  1088. *!      Procedure: UPDATESCREEN
  1089. *!
  1090. *!      Called by: GRAPHICTOCHAR      (procedure in TRANSPRT.PRG)
  1091. *!               : CHARTOGRAPHIC      (procedure in TRANSPRT.PRG)
  1092. *!
  1093. *!          Calls: GETSNIPFLAG()      (function  in TRANSPRT.PRG)
  1094. *!               : ISOBJECT()         (function  in TRANSPRT.PRG)
  1095. *!               : MAPBUTTON()        (function  in TRANSPRT.PRG)
  1096. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1097. *!
  1098. *!           Uses: M.G_SCRNALIAS      
  1099. *!
  1100. *!        Indexes: ID                     (tag)
  1101. *!
  1102. *!*****************************************************************************
  1103. PROCEDURE updatescreen
  1104. PRIVATE m.thermstep
  1105.  
  1106. COUNT TO m.thermstep FOR platform = m.g_toplatform
  1107. IF m.g_newobjects
  1108.    m.thermstep = 40/m.thermstep
  1109. ELSE
  1110.    m.thermstep = 80/m.thermstep
  1111. ENDIF
  1112.  
  1113. m.g_tempalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1114. SELECT * FROM (m.g_scrnalias) ;
  1115.    WHERE !DELETED() AND platform = m.g_fromplatform ;
  1116.    AND isselected(uniqueid,objtype,objcode) ;
  1117.    INTO CURSOR (m.g_tempalias)
  1118. INDEX ON uniqueid TAG id
  1119.  
  1120. SELECT (m.g_scrnalias)
  1121. SET RELATION TO uniqueid INTO (m.g_tempalias) ADDITIVE
  1122. LOCATE FOR .T.
  1123.  
  1124. SELECT (m.g_scrnalias)
  1125.  
  1126. * Check for flag to transport only code snippets
  1127. sniponly = .F.
  1128. LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  1129. IF FOUND()
  1130.    m.sniponly = getsnipflag(setupcode)
  1131. ENDIF
  1132.  
  1133. IF !m.sniponly
  1134.    DO updenviron WITH .T.
  1135. ENDIF
  1136.  
  1137. * Update everything else
  1138. SCAN FOR platform = m.g_toplatform AND !DELETED() ;
  1139.       AND (isobject(objtype) OR objtype = c_otheader)
  1140.    IF &g_tempalias..timestamp > timestamp
  1141.       IF !m.sniponly
  1142.          REPLACE name WITH &g_tempalias..name
  1143.          REPLACE expr WITH &g_tempalias..expr
  1144.          REPLACE STYLE WITH &g_tempalias..style
  1145.          IF INLIST(objtype,c_otradbut,c_ottxtbut)
  1146.             * Don't zap the whole set of buttons if there are just some new ones
  1147.             REPLACE PICTURE WITH mapbutton(&g_tempalias..picture,PICTURE)
  1148.          ELSE
  1149.             REPLACE PICTURE WITH &g_tempalias..picture
  1150.          ENDIF
  1151.          IF objtype <> c_otheader OR !m.g_tographic OR EMPTY(order)
  1152.             * Icon file name is stored in Windows header, "order" field
  1153.             REPLACE ORDER WITH &g_tempalias..order
  1154.          ENDIF
  1155.          REPLACE UNIQUE WITH &g_tempalias..unique
  1156.          *REPLACE Environ WITH &g_tempalias..Environ
  1157.          REPLACE boxchar WITH &g_tempalias..boxchar
  1158.          REPLACE fillchar WITH &g_tempalias..fillchar
  1159.          REPLACE TAG WITH &g_tempalias..tag
  1160.          REPLACE tag2 WITH &g_tempalias..tag2
  1161.          REPLACE ruler WITH &g_tempalias..ruler
  1162.          REPLACE rulerlines WITH &g_tempalias..rulerlines
  1163.          REPLACE grid WITH &g_tempalias..grid
  1164.          REPLACE gridv WITH &g_tempalias..gridv
  1165.          REPLACE gridh WITH &g_tempalias..gridh
  1166.          REPLACE FLOAT WITH &g_tempalias..float
  1167.          REPLACE CLOSE WITH &g_tempalias..close
  1168.          REPLACE MINIMIZE WITH &g_tempalias..minimize
  1169.          REPLACE BORDER WITH &g_tempalias..border
  1170.          REPLACE SHADOW WITH &g_tempalias..shadow
  1171.          REPLACE CENTER WITH &g_tempalias..center
  1172.          REPLACE REFRESH WITH &g_tempalias..refresh
  1173.          REPLACE disabled WITH &g_tempalias..disabled
  1174.          REPLACE scrollbar WITH &g_tempalias..scrollbar
  1175.          REPLACE addalias WITH &g_tempalias..addalias
  1176.          REPLACE TAB WITH &g_tempalias..tab
  1177.          REPLACE initialval WITH &g_tempalias..initialval
  1178.          REPLACE initialnum WITH &g_tempalias..initialnum
  1179.          REPLACE spacing WITH &g_tempalias..spacing
  1180.          * Update width if it looks like a text object got longer in Windows
  1181.          IF !m.g_tographic AND objtype = c_ottext
  1182.             REPLACE width WITH MAX(width,LEN(CHRTRAN(expr,'"'+chr(39),'')))
  1183.          ENDIF
  1184.       ENDIF
  1185.       IF objtype = c_otfield  && watch out for SAYs changing to GETs
  1186.          REPLACE objcode WITH &g_tempalias..objcode
  1187.       ENDIF
  1188.       REPLACE lotype WITH &g_tempalias..lotype
  1189.       REPLACE rangelo WITH &g_tempalias..rangelo
  1190.       REPLACE hitype WITH &g_tempalias..hitype
  1191.       REPLACE rangehi WITH &g_tempalias..rangehi
  1192.       REPLACE whentype WITH &g_tempalias..whentype
  1193.       REPLACE WHEN WITH &g_tempalias..when
  1194.       REPLACE validtype WITH &g_tempalias..validtype
  1195.       REPLACE VALID WITH &g_tempalias..valid
  1196.       REPLACE errortype WITH &g_tempalias..errortype
  1197.       REPLACE ERROR WITH &g_tempalias..error
  1198.       REPLACE messtype WITH &g_tempalias..messtype
  1199.       REPLACE MESSAGE WITH &g_tempalias..message
  1200.       REPLACE showtype WITH &g_tempalias..showtype
  1201.       REPLACE SHOW WITH &g_tempalias..show
  1202.       REPLACE activtype WITH &g_tempalias..activtype
  1203.       REPLACE ACTIVATE WITH &g_tempalias..activate
  1204.       REPLACE deacttype WITH &g_tempalias..deacttype
  1205.       REPLACE DEACTIVATE WITH &g_tempalias..deactivate
  1206.       REPLACE proctype WITH &g_tempalias..proctype
  1207.       REPLACE proccode WITH &g_tempalias..proccode
  1208.       REPLACE setuptype WITH &g_tempalias..setuptype
  1209.       REPLACE setupcode WITH &g_tempalias..setupcode
  1210.       
  1211.       REPLACE timestamp WITH &g_tempalias..timestamp
  1212.       REPLACE platform WITH m.g_toplatform
  1213.    ENDIF
  1214.    
  1215.    m.g_mercury = m.g_mercury + m.thermstep
  1216.    DO updtherm WITH m.g_mercury
  1217.    
  1218. ENDSCAN
  1219.  
  1220. SELECT (m.g_tempalias)
  1221. USE
  1222. SELECT (m.g_scrnalias)
  1223.  
  1224. RETURN
  1225.  
  1226. *
  1227. * UpdateReport - Copy any "non-platform specific" information from one platform to another
  1228. *
  1229. *!*****************************************************************************
  1230. *!
  1231. *!      Procedure: UPDATEREPORT
  1232. *!
  1233. *!      Called by: GRAPHICTOCHAR      (procedure in TRANSPRT.PRG)
  1234. *!               : CHARTOGRAPHIC      (procedure in TRANSPRT.PRG)
  1235. *!
  1236. *!          Calls: ADJRPTSUPPRESS     (procedure in TRANSPRT.PRG)
  1237. *!               : ADJRPTFLOAT        (procedure in TRANSPRT.PRG)
  1238. *!               : ADJRPTRESET        (procedure in TRANSPRT.PRG)
  1239. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1240. *!
  1241. *!           Uses: M.G_SCRNALIAS      
  1242. *!
  1243. *!        Indexes: ID                     (tag)
  1244. *!
  1245. *!*****************************************************************************
  1246. PROCEDURE updatereport
  1247. PRIVATE m.thermstep
  1248.  
  1249. COUNT TO m.thermstep FOR platform = m.g_toplatform
  1250. IF m.g_newobjects
  1251.    m.thermstep = 40/m.thermstep
  1252. ELSE
  1253.    m.thermstep = 80/m.thermstep
  1254. ENDIF
  1255.  
  1256. m.g_tempalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1257. SELECT * FROM (m.g_scrnalias) ;
  1258.    WHERE platform = m.g_fromplatform AND !DELETED();
  1259.    AND isselected(uniqueid,objtype,objcode) ;
  1260.    INTO CURSOR (m.g_tempalias)
  1261. INDEX ON uniqueid TAG id
  1262.  
  1263. SELECT (m.g_scrnalias)
  1264. SET RELATION TO uniqueid INTO (m.g_tempalias) ADDITIVE
  1265. LOCATE FOR .T.
  1266.  
  1267. SELECT (m.g_scrnalias)
  1268. DO updenviron WITH .T.
  1269.  
  1270. SCAN FOR platform = m.g_toplatform AND ;
  1271.       (objtype = c_otheader OR objtype = c_otfield OR objtype = c_otpicture OR ;
  1272.       objtype = c_otrepfld OR objtype = c_otband OR objtype = c_otrepvar OR ;
  1273.       objtype = c_ottext OR objtype = c_otline OR objtype = c_otbox) AND !DELETED()
  1274.    IF &g_tempalias..timestamp > timestamp
  1275.       REPLACE name WITH &g_tempalias..name
  1276.       IF objtype = c_otrepvar AND !m.g_tographic
  1277.          REPLACE name WITH UPPER(name)
  1278.       ENDIF
  1279.       REPLACE expr WITH &g_tempalias..expr
  1280.       REPLACE STYLE WITH &g_tempalias..style
  1281.       REPLACE PICTURE WITH &g_tempalias..picture
  1282.       REPLACE ORDER WITH &g_tempalias..order
  1283.       REPLACE UNIQUE WITH &g_tempalias..unique
  1284.       REPLACE ENVIRON WITH &g_tempalias..environ
  1285.       REPLACE boxchar WITH &g_tempalias..boxchar
  1286.       REPLACE fillchar WITH &g_tempalias..fillchar
  1287.       REPLACE TAG WITH &g_tempalias..tag
  1288.       REPLACE tag2 WITH &g_tempalias..tag2
  1289.       REPLACE mode WITH &g_tempalias..mode
  1290.       REPLACE ruler WITH &g_tempalias..ruler
  1291.       REPLACE rulerlines WITH &g_tempalias..rulerlines
  1292.       REPLACE grid WITH &g_tempalias..grid
  1293.       REPLACE gridv WITH &g_tempalias..gridv
  1294.       REPLACE gridh WITH &g_tempalias..gridh
  1295.       REPLACE FLOAT WITH &g_tempalias..float
  1296.       REPLACE STRETCH WITH &g_tempalias..stretch
  1297.       REPLACE stretchtop WITH &g_tempalias..stretchtop
  1298.       REPLACE TOP WITH &g_tempalias..top
  1299.       REPLACE BOTTOM WITH &g_tempalias..bottom
  1300.       REPLACE suptype WITH &g_tempalias..suptype
  1301.       REPLACE suprest WITH &g_tempalias..suprest
  1302.       REPLACE norepeat WITH &g_tempalias..norepeat
  1303.       REPLACE resetrpt WITH &g_tempalias..resetrpt
  1304.       REPLACE pagebreak WITH &g_tempalias..pagebreak
  1305.       REPLACE colbreak WITH &g_tempalias..colbreak
  1306.       REPLACE resetpage WITH &g_tempalias..resetpage
  1307.       REPLACE GENERAL WITH &g_tempalias..general
  1308.       REPLACE spacing WITH &g_tempalias..spacing
  1309.       REPLACE DOUBLE WITH &g_tempalias..double
  1310.       REPLACE swapheader WITH &g_tempalias..swapheader
  1311.       REPLACE swapfooter WITH &g_tempalias..swapfooter
  1312.       REPLACE ejectbefor WITH &g_tempalias..ejectbefor
  1313.       REPLACE ejectafter WITH &g_tempalias..ejectafter
  1314.       REPLACE PLAIN WITH &g_tempalias..plain
  1315.       REPLACE SUMMARY WITH &g_tempalias..summary
  1316.       REPLACE addalias WITH &g_tempalias..addalias
  1317.       REPLACE offset WITH &g_tempalias..offset
  1318.       REPLACE topmargin WITH &g_tempalias..topmargin
  1319.       REPLACE botmargin WITH &g_tempalias..botmargin
  1320.       REPLACE totaltype WITH &g_tempalias..totaltype
  1321.       REPLACE resettotal WITH &g_tempalias..resettotal
  1322.       REPLACE resoid WITH &g_tempalias..resoid
  1323.       REPLACE curpos WITH &g_tempalias..curpos
  1324.       REPLACE supalways WITH &g_tempalias..supalways
  1325.       REPLACE supovflow WITH &g_tempalias..supovflow
  1326.       REPLACE suprpcol WITH &g_tempalias..suprpcol
  1327.       REPLACE supgroup WITH &g_tempalias..supgroup
  1328.       REPLACE supvalchng WITH &g_tempalias..supvalchng
  1329.       REPLACE supexpr WITH &g_tempalias..supexpr
  1330.       
  1331.       REPLACE timestamp WITH &g_tempalias..timestamp
  1332.       REPLACE platform WITH m.g_toplatform
  1333.       
  1334.       * Update width if it looks like a text object got longer in Windows
  1335.       IF !m.g_tographic AND objtype = c_ottext
  1336.          REPLACE width WITH MAX(width,LEN(CHRTRAN(expr,'"'+chr(39),'')))
  1337.       ENDIF
  1338.       
  1339.       DO adjrptsuppress
  1340.       DO adjrptfloat
  1341.       IF objtype = c_otrepvar OR (objtype = c_otrepfld AND totaltype > 0)
  1342.          DO adjrptreset
  1343.       ENDIF
  1344.    ENDIF
  1345.    
  1346.    m.g_mercury = m.g_mercury + m.thermstep
  1347.    DO updtherm WITH m.g_mercury
  1348. ENDSCAN
  1349.  
  1350. SELECT (m.g_tempalias)
  1351. USE
  1352. SELECT (m.g_scrnalias)
  1353.  
  1354. RETURN
  1355.  
  1356.  
  1357. *!*****************************************************************************
  1358. *!
  1359. *!      Procedure: UPDENVIRON
  1360. *!
  1361. *!*****************************************************************************
  1362. PROCEDURE updenviron
  1363. PARAMETER m.mustexist
  1364. * Update environment records if the user selected environment records for transport
  1365. * and if any of them have been updated.
  1366. IF EnvSelect() AND IsNewerEnv(m.mustexist)
  1367.    * Drop the old environment and put the new one in
  1368.    DELETE FOR IsEnviron(objtype) and platform = m.g_toplatform
  1369.    SCAN FOR platform = m.g_fromplatform AND IsEnviron(Objtype)
  1370.       SCATTER MEMVAR MEMO
  1371.       APPEND BLANK
  1372.       GATHER MEMVAR MEMO
  1373.       REPLACE platform WITH m.g_toplatform
  1374.       IF !g_tographic
  1375.          * DOS requires the alias name to be in upper case, while Windows doesn't
  1376.          REPLACE TAG WITH UPPER(TAG)
  1377.          REPLACE tag2 WITH UPPER(tag2)
  1378.       ENDIF
  1379.    ENDSCAN
  1380.    m.g_updenviron = .T.
  1381. ENDIF
  1382.  
  1383. *
  1384. * CONVERTPROJECT - Convert project file from 2.0 to 2.5 format
  1385. *
  1386. *!*****************************************************************************
  1387. *!
  1388. *!      Procedure: CONVERTPROJECT
  1389. *!
  1390. *!      Called by: CONVERTER          (procedure in TRANSPRT.PRG)
  1391. *!
  1392. *!*****************************************************************************
  1393. PROCEDURE convertproject
  1394. PRIVATE m.i
  1395.  
  1396. SELECT (m.g_scrnalias)
  1397. ZAP
  1398.  
  1399. SELECT (m.g_20alias)
  1400. SCAN FOR !DELETED()
  1401.    SCATTER MEMVAR MEMO
  1402.    m.wasarranged = arranged
  1403.    RELEASE m.arranged         && to avoid type mismatch at GATHER time
  1404.    
  1405.    SELECT (m.g_scrnalias)
  1406.    APPEND BLANK
  1407.    GATHER MEMVAR MEMO
  1408.    DO CASE
  1409.    CASE type == "H"
  1410.       IF !EMPTY(devinfo)
  1411.          * Adjust developer info to support wider state code
  1412.          REPLACE devinfo WITH STUFF(devinfo,162,0,CHR(0)+CHR(0)+CHR(0))
  1413.          REPLACE devinfo WITH STUFF(devinfo,176,0,REPLICATE(CHR(0),46))
  1414.       ENDIF
  1415.       
  1416.    CASE type == "s"   && must be lowercase S
  1417.       * Adjust for the new method of storing cross-platform arrangement info
  1418.       * (ScrnRow = -999 for centered screens)
  1419.       REPLACE arranged WITH ;
  1420.           PADR("DOS",8);
  1421.          +IIF(m.wasarranged,"T","F");
  1422.          +IIF(m.scrnrow=-999,"T","F");
  1423.          +PADL(LTRIM(STR(m.scrnrow,4)),8) ;
  1424.          +PADL(LTRIM(STR(m.scrncol,4)),8) ;
  1425.          +PADR("WINDOWS",8);
  1426.          +IIF(m.wasarranged,"T","F");
  1427.          +IIF(m.scrnrow=-999,"T","F");
  1428.          +PADL(LTRIM(STR(m.scrnrow,4)),8) ;
  1429.          +PADL(LTRIM(STR(m.scrncol,4)),8)
  1430.    ENDCASE
  1431.    
  1432.    * Adjust the symbol table
  1433.    IF !EMPTY(symbols)
  1434.       FOR i = 1 TO INT((LEN(symbols)-4)/14)
  1435.          * Format of a 2.0 symbol table is
  1436.          *   4 bytes of header information
  1437.          *   n occurrences of this structure:
  1438.          *      TEXT symName[11]
  1439.          *      TEXT symType
  1440.          *      TEXT flags[2]
  1441.          * Format of a 2.5 symbol table is the same, except symName is now 13 bytes long
  1442.          REPLACE symbols WITH STUFF(symbols,(m.i-1)*16+15,0,CHR(0)+CHR(0))
  1443.          REPLACE ckval WITH VAL(sys(2007,symbols))
  1444.       ENDFOR
  1445.    ENDIF
  1446.    
  1447.    * Blank out the timestamp
  1448.    REPLACE timestamp WITH 0
  1449. ENDSCAN
  1450.  
  1451. *
  1452. * NewCharToGraphic - Take any new objects from the character platform and copy them
  1453. *      to the graphical platform.
  1454. *
  1455. *!*****************************************************************************
  1456. *!
  1457. *!      Procedure: NEWCHARTOGRAPHIC
  1458. *!
  1459. *!      Called by: CHARTOGRAPHIC      (procedure in TRANSPRT.PRG)
  1460. *!
  1461. *!          Calls: GETWINDFONT        (procedure in TRANSPRT.PRG)
  1462. *!               : NEWBANDS           (procedure in TRANSPRT.PRG)
  1463. *!               : BANDINFO()         (function  in TRANSPRT.PRG)
  1464. *!               : ISOBJECT()         (function  in TRANSPRT.PRG)
  1465. *!               : PLATFORMDEFAULTS   (procedure in TRANSPRT.PRG)
  1466. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  1467. *!               : RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  1468. *!               : FINDLIKEVPOS       (procedure in TRANSPRT.PRG)
  1469. *!               : FINDLIKEHPOS       (procedure in TRANSPRT.PRG)
  1470. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1471. *!
  1472. *!           Uses: M.G_SCRNALIAS      
  1473. *!
  1474. *!*****************************************************************************
  1475. PROCEDURE newchartographic
  1476. PRIVATE m.thermstep, m.bandcount
  1477.  
  1478. SELECT (m.g_scrnalias)
  1479. SET ORDER TO
  1480.  
  1481. * Get the default font for the window in the "to" platform
  1482. IF m.g_tographic
  1483.    DO getwindfont
  1484. ENDIF
  1485.  
  1486. * Update the environment if it is new
  1487. DO updenviron WITH .F.
  1488.  
  1489. * Remember the window default font
  1490. SELECT (m.g_scrnalias)
  1491. LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  1492. IF FOUND()
  1493.    m.wfontface  = fontface
  1494.    m.wfontsize  = fontsize
  1495.    m.wfontstyle = fontstyle
  1496. ELSE
  1497.    m.wfontface  = m.g_fontface
  1498.    m.wfontsize  = m.g_fontsize
  1499.    m.wfontstyle = m.g_fontstyle
  1500. ENDIF
  1501.  
  1502. m.g_tempalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1503. SELECT * FROM (m.g_scrnalias) ;
  1504.    WHERE !DELETED() AND platform = m.g_fromplatform AND ;
  1505.    isselected(uniqueid,objtype,objcode) AND ;
  1506.    uniqueid NOT IN (SELECT uniqueid FROM (m.g_scrnalias) ;
  1507.    WHERE platform = m.g_toplatform) ;
  1508.    INTO CURSOR (m.g_tempalias)
  1509.  
  1510. IF m.g_snippets
  1511.    m.thermstep = 35/_TALLY
  1512. ELSE
  1513.    m.thermstep = 70/_TALLY
  1514. ENDIF
  1515.  
  1516. IF m.g_filetype = c_report
  1517.    DO newbands
  1518.    
  1519.    * We need to know where bands start and where they end in
  1520.    * both platforms.
  1521.    SELECT (m.g_scrnalias)
  1522.    COUNT TO m.bandcount FOR platform = m.g_toplatform AND objtype = c_otband
  1523.    DIMENSION bands[m.bandCount,4]
  1524.    m.bandcount = bandinfo()
  1525.    SELECT (m.g_tempalias)
  1526. ENDIF
  1527.  
  1528. m.rightmost = 0
  1529. m.bottommost = 0
  1530.  
  1531. SCAN
  1532.    IF isobject(objtype)
  1533.       SCATTER MEMVAR MEMO
  1534.       SELECT (m.g_scrnalias)
  1535.       APPEND BLANK
  1536.       GATHER MEMVAR MEMO
  1537.  
  1538.       REPLACE platform WITH m.g_toplatform
  1539.  
  1540.       DO platformdefaults WITH 0
  1541.       DO fillininfo
  1542.  
  1543.       DO CASE
  1544.       CASE INLIST(objtype,c_otbox, c_otline)
  1545.          DO adjbox WITH c_adjbox
  1546.       ENDCASE   
  1547.  
  1548.       IF m.g_filetype = c_report
  1549.          DO rptobjconvert WITH m.bandcount
  1550.       ELSE
  1551.          REPLACE vpos WITH findlikevpos(vpos)
  1552.          REPLACE hpos WITH findlikehpos(hpos)
  1553.          
  1554.          m.rightmost = MAX(m.rightmost, hpos + width ;
  1555.           * FONTMETRIC(6,fontface,fontsize,whatstyle(fontstyle)) ;
  1556.           / FONTMETRIC(6,m.wfontface,m.wfontsize,whatstyle(m.wfontstyle)))
  1557.          m.bottommost = MAX(m.bottommost, vpos + height ;
  1558.           * FONTMETRIC(1,fontface,fontsize,whatstyle(fontstyle)) ;
  1559.           / FONTMETRIC(1,m.wfontface,m.wfontsize,whatstyle(m.wfontstyle)))
  1560.       ENDIF
  1561.    ENDIF
  1562.  
  1563.    SELECT (m.g_tempalias)
  1564.  
  1565.    m.g_mercury = m.g_mercury + m.thermstep
  1566.    DO updtherm WITH m.g_mercury
  1567. ENDSCAN
  1568.  
  1569. SELECT (m.g_tempalias)
  1570. USE
  1571. SELECT (m.g_scrnalias)
  1572. * Update screen width/height if necessary to hold the new objects
  1573. IF m.g_filetype = c_screen
  1574.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  1575.    IF FOUND()
  1576.       * If the screen/report isn't big enough to hold the widest/tallest object, 
  1577.       * resize it.
  1578.       IF width < m.rightmost
  1579.          REPLACE width WITH m.rightmost + IIF(m.g_filetype = c_screen,2,2000)
  1580.       ENDIF
  1581.       IF height < m.bottommost AND m.g_filetype = c_screen
  1582.          REPLACE height WITH m.bottommost + IIF(m.g_filetype = c_screen,1,2000)
  1583.       ENDIF
  1584.    ENDIF      
  1585. ENDIF
  1586. RETURN
  1587.    
  1588. *
  1589. * NewGraphicToChar - Take any new objects from the graphic platform and copy them
  1590. *      to the character platform.
  1591. *
  1592. *!*****************************************************************************
  1593. *!
  1594. *!      Procedure: NEWGRAPHICTOCHAR
  1595. *!
  1596. *!      Called by: GRAPHICTOCHAR      (procedure in TRANSPRT.PRG)
  1597. *!
  1598. *!          Calls: NEWBANDS           (procedure in TRANSPRT.PRG)
  1599. *!               : BANDINFO()         (function  in TRANSPRT.PRG)
  1600. *!               : ISOBJECT()         (function  in TRANSPRT.PRG)
  1601. *!               : PLATFORMDEFAULTS   (procedure in TRANSPRT.PRG)
  1602. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  1603. *!               : ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  1604. *!               : RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  1605. *!               : FINDLIKEVPOS       (procedure in TRANSPRT.PRG)
  1606. *!               : FINDLIKEHPOS       (procedure in TRANSPRT.PRG)
  1607. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1608. *!               : MAKECHARFIT        (procedure in TRANSPRT.PRG)
  1609. *!
  1610. *!           Uses: M.G_SCRNALIAS      
  1611. *!
  1612. *!*****************************************************************************
  1613. PROCEDURE newgraphictochar
  1614. PRIVATE m.thermstep, m.bandcount
  1615.  
  1616. SELECT (m.g_scrnalias)
  1617. SET ORDER TO
  1618.  
  1619. * Update the environment if it is new
  1620. DO updenviron WITH .F.
  1621.  
  1622. m.g_tempalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1623. *
  1624. * Get a cursor containing the records in the "to" platform that do not have
  1625. * counterparts in the "from" platform.  Exclude Windows report column headers
  1626. * and column footers (objtype = 9, objcode = 2 or 6) since they have no DOS analogs.
  1627. * Exclude boxes that are filled black.  They are probably used for shadow effects.
  1628. *
  1629. SELECT * FROM (m.g_scrnalias) ;
  1630.    WHERE !DELETED() AND platform = m.g_fromplatform AND ;
  1631.    !(objtype = c_otband AND INLIST(objcode,2,6)) AND ;
  1632.    isselected(uniqueid,objtype,objcode) AND ;
  1633.    !blackbox(objtype,fillred,fillblue,fillgreen,fillpat) AND ;
  1634.    uniqueid NOT IN (SELECT uniqueid FROM (m.g_scrnalias) ;
  1635.    WHERE platform = m.g_toplatform) ;
  1636.    INTO CURSOR (m.g_tempalias)
  1637.  
  1638. IF m.g_snippets
  1639.    m.thermstep = 35/_TALLY
  1640. ELSE
  1641.    m.thermstep = 70/_TALLY
  1642. ENDIF
  1643.  
  1644. IF m.g_filetype = c_report
  1645.    DO newbands
  1646.    
  1647.    * We need to know where bands start and where they end in
  1648.    * both platforms.
  1649.    SELECT (m.g_scrnalias)
  1650.    COUNT TO m.bandcount FOR platform = m.g_toplatform AND objtype = c_otband
  1651.    DIMENSION bands[m.bandCount,4]
  1652.    m.bandcount = bandinfo()
  1653.    SELECT (m.g_tempalias)
  1654. ENDIF
  1655.  
  1656. LOCATE FOR .T.
  1657. DO WHILE !EOF()
  1658.    IF isobject(objtype) AND objtype <> c_otpicture
  1659.       SCATTER MEMVAR MEMO
  1660.       SELECT (m.g_scrnalias)
  1661.       APPEND BLANK
  1662.       GATHER MEMVAR MEMO
  1663.       
  1664.       REPLACE platform WITH m.g_toplatform
  1665.       
  1666.       DO platformdefaults WITH 0
  1667.       DO fillininfo
  1668.       
  1669.       IF m.g_filetype = c_screen
  1670.          DO adjheightandwidth
  1671.       ELSE
  1672.         DO rptobjconvert WITH m.bandcount
  1673.       ENDIF
  1674.       
  1675.       REPLACE vpos WITH findlikevpos(vpos)
  1676.       REPLACE hpos WITH findlikehpos(hpos)
  1677.    ENDIF
  1678.    
  1679.    SELECT (m.g_tempalias)
  1680.    SKIP
  1681.    
  1682.    m.g_mercury = m.g_mercury + m.thermstep
  1683.    DO updtherm WITH m.g_mercury
  1684. ENDDO
  1685.  
  1686. SELECT (m.g_tempalias)
  1687. USE
  1688. SELECT (m.g_scrnalias)
  1689.  
  1690. DO makecharfit
  1691.  
  1692. RETURN
  1693.  
  1694. *
  1695. * NewBands - Add any new band records.
  1696. *
  1697. *!*****************************************************************************
  1698. *!
  1699. *!      Procedure: NEWBANDS
  1700. *!
  1701. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  1702. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  1703. *!
  1704. *!          Calls: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  1705. *!               : BANDPOS()          (function  in TRANSPRT.PRG)
  1706. *!
  1707. *!*****************************************************************************
  1708. PROCEDURE newbands
  1709. PRIVATE m.prevband, m.bandstart, m.bandheight
  1710. * We need to have the groups in order to do report objects, so we do them seperately.
  1711.  
  1712. SCAN FOR objtype = c_otband
  1713.    SCATTER MEMVAR MEMO
  1714.    SELECT (m.g_scrnalias)
  1715.    LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.uniqueid
  1716.    SKIP -1
  1717.    m.prevband = uniqueid
  1718.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.prevband
  1719.    INSERT BLANK
  1720.    GATHER MEMVAR MEMO
  1721.    REPLACE platform WITH m.g_toplatform
  1722.    
  1723.    DO rptobjconvert WITH 0
  1724.    
  1725.    m.bandheight = HEIGHT + IIF(m.g_tographic, c_bandheight+(c_bandfudge/c_pixelsize), 0)
  1726.    m.bandstart = bandpos(m.uniqueid, m.g_toplatform)
  1727.    
  1728.    * Move all the lower bands down by the size of the one we just inserted.
  1729.    REPLACE ALL vpos WITH vpos + m.bandheight ;
  1730.       FOR platform = m.g_toplatform AND ;
  1731.       (objtype = c_otline OR objtype = c_otbox OR ;
  1732.       objtype = c_ottext OR objtype = c_otrepfld) AND ;
  1733.       vpos >= m.bandstart
  1734.    SELECT (m.g_tempalias)
  1735. ENDSCAN
  1736.  
  1737. *
  1738. * AllGraphicToChar - Convert from a graphic platform to a character platform assuming
  1739. *      that no records exist for the target platform.
  1740. *
  1741. *!*****************************************************************************
  1742. *!
  1743. *!      Procedure: ALLGRAPHICTOCHAR
  1744. *!
  1745. *!      Called by: GRAPHICTOCHAR      (procedure in TRANSPRT.PRG)
  1746. *!
  1747. *!          Calls: ALLENVIRONS        (procedure in TRANSPRT.PRG)
  1748. *!               : ALLOTHERS          (procedure in TRANSPRT.PRG)
  1749. *!               : ALLGROUPS          (procedure in TRANSPRT.PRG)
  1750. *!               : RPTCONVERT         (procedure in TRANSPRT.PRG)
  1751. *!               : MERGELABELOBJECTS  (procedure in TRANSPRT.PRG)
  1752. *!               : LINESBETWEEN       (procedure in TRANSPRT.PRG)
  1753. *!               : MAKECHARFIT        (procedure in TRANSPRT.PRG)
  1754. *!               : SUPPRESSBLANKLINES (procedure in TRANSPRT.PRG)
  1755. *!
  1756. *!           Uses: M.G_SCRNALIAS      
  1757. *!
  1758. *!*****************************************************************************
  1759. PROCEDURE allgraphictochar
  1760. PRIVATE m.objindex
  1761.  
  1762. DO allenvirons
  1763.  
  1764. *
  1765. * Create a cursor with all the objects we have left to add.
  1766. *
  1767. m.g_fromobjonlyalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1768. SELECT *, RECNO() AS recnum FROM (m.g_scrnalias) ;
  1769.    WHERE !DELETED() AND platform = m.g_fromplatform AND ;
  1770.    objtype <> c_otrel AND objtype <> c_otworkar AND objtype <> c_otindex AND ;
  1771.    objtype <> c_otheader AND objtype <> c_otgroup AND ;
  1772.    objtype <> c_otpicture AND ;
  1773.    !blackbox(objtype,fillred,fillblue,fillgreen,fillpat) AND ;
  1774.    !(m.g_filetype = c_label AND objtype = c_ot20label) AND ;
  1775.    !(objtype = c_ot20lbxobj AND EMPTY(expr)) AND;
  1776.    oktransport(comment) ;
  1777.    INTO CURSOR (m.g_fromobjonlyalias)
  1778. m.objindex = _TALLY
  1779.  
  1780. DO allothers WITH 80
  1781. DO allgroups WITH 10
  1782.  
  1783. DO CASE
  1784. CASE m.g_filetype = c_label
  1785.    ** Trim any records the character platforms won't deal with.
  1786.    DELETE FOR platform = m.g_toplatform AND ;
  1787.       ((objtype = c_otband AND objcode != 4) OR ;
  1788.       objtype = c_otrepvar OR objtype = c_otpicture OR ;
  1789.       objtype = c_otline OR objtype = c_otbox)
  1790.    DO rptconvert
  1791.    DO mergelabelobjects
  1792.    DO linesbetween
  1793.    
  1794. CASE m.g_filetype = c_report
  1795.    ** Trim any records the character platforms won't deal with.
  1796.    DELETE FOR platform = m.g_toplatform AND (objtype = c_otpicture)
  1797.    DO rptconvert
  1798.    DO makecharfit
  1799.    DO suppressblanklines
  1800.   
  1801. CASE m.g_filetype = c_screen
  1802.    DO makecharfit
  1803. ENDCASE
  1804.  
  1805. SELECT (m.g_fromobjonlyalias)
  1806. USE
  1807. SELECT (m.g_scrnalias)
  1808.  
  1809. RETURN
  1810.  
  1811. *
  1812. * AllCharToGraphic - Convert from a character platform to a graphic platform assuming
  1813. *      that no records exist for the target platform.
  1814. *
  1815. *!*****************************************************************************
  1816. *!
  1817. *!      Procedure: ALLCHARTOGRAPHIC
  1818. *!
  1819. *!      Called by: CHARTOGRAPHIC      (procedure in TRANSPRT.PRG)
  1820. *!
  1821. *!          Calls: ALLENVIRONS        (procedure in TRANSPRT.PRG)
  1822. *!               : ALLOTHERS          (procedure in TRANSPRT.PRG)
  1823. *!               : ALLGROUPS          (procedure in TRANSPRT.PRG)
  1824. *!               : CALCWINDOWDIMENSION(procedure in TRANSPRT.PRG)
  1825. *!               : ADJITEMSINBOXES    (procedure in TRANSPRT.PRG)
  1826. *!               : ADJINVBTNS         (procedure in TRANSPRT.PRG)
  1827. *!               : JOINLINES          (procedure in TRANSPRT.PRG)
  1828. *!               : RPTCONVERT         (procedure in TRANSPRT.PRG)
  1829. *!               : SUPPRESSBLANKLINES (procedure in TRANSPRT.PRG)
  1830. *!               : ADDGRAPHICALLABELGR(procedure in TRANSPRT.PRG)
  1831. *!               : LABELBANDS         (procedure in TRANSPRT.PRG)
  1832. *!               : LABELLINES         (procedure in TRANSPRT.PRG)
  1833. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  1834. *!               : WHATSTYLE()        (function  in TRANSPRT.PRG)
  1835. *!               : STRETCHLINESTOBORDE(procedure in TRANSPRT.PRG)
  1836. *!
  1837. *!           Uses: M.G_SCRNALIAS      
  1838. *!
  1839. *!*****************************************************************************
  1840. PROCEDURE allchartographic
  1841. PRIVATE m.objindex
  1842.  
  1843. * Make equivalent screen/report records for the new platform.
  1844. DO allenvirons
  1845.  
  1846. m.g_fromobjonlyalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  1847. SELECT *, RECNO() AS recnum FROM (m.g_scrnalias) ;
  1848.    WHERE !DELETED() AND platform = m.g_fromplatform AND objtype <> c_otrel AND ;
  1849.    objtype <> c_otworkar AND objtype <> c_otindex AND ;
  1850.    objtype <> c_otheader AND objtype <> c_otgroup AND ;
  1851.    !(m.g_filetype = c_label AND objtype = c_ot20label) AND ;
  1852.    !(objtype = c_ot20lbxobj AND EMPTY(expr)) AND;
  1853.    oktransport(comment) ;
  1854.    INTO CURSOR (m.g_fromobjonlyalias)
  1855.  
  1856. m.objindex = _TALLY
  1857. IF _TALLY = 0
  1858.    SELECT (m.g_fromobjonlyalias)
  1859.    USE
  1860.    SELECT (m.g_scrnalias)
  1861.    RETURN
  1862. ENDIF
  1863.  
  1864. DIMENSION objectpos[m.objindex, 9]
  1865.  
  1866. DO allothers WITH 25
  1867. DO allgroups WITH 5
  1868.  
  1869. * Attempt to adjust the position of objects to reflect the position
  1870. * in the previous platform.
  1871.  
  1872. DO CASE
  1873. CASE m.g_filetype = c_screen
  1874.    DO calcwindowdimensions
  1875.    DO adjitemsinboxes
  1876.    DO adjinvbtns
  1877.    SET ORDER TO
  1878.    
  1879.    IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  1880.       DO joinlines
  1881.    ENDIF
  1882.    
  1883. CASE m.g_filetype = c_report
  1884.    DO rptconvert
  1885.    DO joinlines
  1886.    DO suppressblanklines
  1887.    
  1888. CASE m.g_filetype = c_label
  1889.    IF m.g_fromplatform = "DOS" OR m.g_fromplatform = "UNIX"
  1890.       DO addgraphicallabelgroups
  1891.    ENDIF
  1892.    DO labelbands
  1893.    DO labellines
  1894. ENDCASE
  1895.  
  1896. m.g_mercury = m.g_mercury + 5
  1897. DO updtherm WITH m.g_mercury
  1898.  
  1899. IF m.g_filetype = c_screen
  1900.    IF m.g_allobjects
  1901.       LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader AND STYLE != 0
  1902.       IF FOUND()
  1903.          IF m.g_windheight - g_lastobjectline[1] - 3 = 0
  1904.             m.adjustment = .5
  1905.          ELSE
  1906.             m.adjustment = m.g_windheight - g_lastobjectline[1] - 3
  1907.          ENDIF
  1908.          
  1909.          IF m.adjustment < 0
  1910.             m.adjustment = m.adjustment + 1.5
  1911.          ENDIF
  1912.          
  1913.          IF m.adjustment > 0
  1914.             REPLACE HEIGHT WITH g_lastobjectline[2] + ;
  1915.                m.adjustment * (FONTMETRIC(1) / ;
  1916.                FONTMETRIC(1,fontface, fontsize, whatstyle(fontstyle)))
  1917.          ELSE
  1918.             REPLACE HEIGHT WITH g_lastobjectline[2] + 1
  1919.          ENDIF
  1920.       ENDIF
  1921.       DO stretchlinestoborders
  1922.    ENDIF
  1923. ENDIF
  1924.  
  1925. m.g_mercury = m.g_mercury + 5
  1926. DO updtherm WITH m.g_mercury
  1927.  
  1928. SELECT (m.g_fromobjonlyalias)
  1929. USE
  1930. SELECT (m.g_scrnalias)
  1931.  
  1932. *
  1933. * cvrt102FRX - Converts a DOS 1.02 report to DOS 2.5 format
  1934. *
  1935. *!*****************************************************************************
  1936. *!
  1937. *!       Function: CVRT102FRX
  1938. *!
  1939. *!      Called by: TRANSPRT.PRG                      
  1940. *!
  1941. *!          Calls: DOCREATE           (procedure in TRANSPRT.PRG)
  1942. *!               : FORCEEXT()         (function  in TRANSPRT.PRG)
  1943. *!
  1944. *!*****************************************************************************
  1945. FUNCTION cvrt102frx
  1946. * Converts FoxPro 1.02 DOS report to FoxPro 2.5 DOS report
  1947. PARAMETER m.fname102, m.ftype
  1948. PRIVATE m.bakname, m.in_area
  1949.  
  1950. m.in_area = SELECT()
  1951. SELECT 0
  1952. * Create a database structure matching the tab delimited format
  1953. *  of a 1.02 report file.
  1954. CREATE CURSOR old ( ;
  1955.    objtype N(10,0), ;
  1956.    content N(10,0), ;
  1957.    fldcontent C(254), ;
  1958.    frmcontent C(254), ;
  1959.    vertpos N(10,0), ;
  1960.    horzpos N(10,0), ;
  1961.    HEIGHT N(10,0), ;
  1962.    WIDTH N(10,0), ;
  1963.    FONT N(10,0), ;
  1964.    fontsize N(10,0), ;
  1965.    STYLE N(10,0), ;
  1966.    penred N(10,0), ;
  1967.    pengreen N(10,0), ;
  1968.    penblue N(10,0), ;
  1969.    fillred N(10,0), ;
  1970.    fillgreen N(10,0), ;
  1971.    fillblue N(10,0), ;
  1972.    PICTURE C(254), ;
  1973.    rangeup N(10,0), ;
  1974.    rangelow N(10,0), ;
  1975.    VALID N(10,0), ;
  1976.    initc N(10,0), ;
  1977.    calcexp N(10,0) ;
  1978.    )
  1979.  
  1980. * Replace quote marks with \" so that APPEND won't strip them out.  They are our only
  1981. * way of distinguishing quoted text from, say, field names.
  1982. m.fpin  = fopen(m.fname102,2)   && open for read access
  1983. m.outname = forceext(m.fname102,"TMP")
  1984. m.fpout = fcreate(m.outname)
  1985.  
  1986. IF m.fpin > 0 AND m.fpout > 0
  1987.    DO WHILE !FEOF(m.fpin)
  1988.       m.buf = fgets(m.fpin)
  1989.       m.buf = STRTRAN(m.buf,'"','\+')
  1990.       =fputs(m.fpout,m.buf)
  1991.    ENDDO
  1992.    =fclose(m.fpin)
  1993.    =fclose(m.fpout)
  1994.  
  1995.    APPEND FROM (m.outname) TYPE DELIMITED WITH TAB
  1996.    
  1997.    * Drop the temporary output file
  1998.    IF FILE(m.outname)
  1999.       DELETE FILE (m.outname)
  2000.    ENDIF
  2001.    
  2002.    * Replace quote markers with quotes in the character fields
  2003.    REPLACE ALL fldcontent WITH STRTRAN(fldcontent,'\+','"'), ;
  2004.                frmcontent WITH STRTRAN(frmcontent,'\+','"'), ;
  2005.                picture    WITH STRTRAN(picture,   '\+','"')  ;
  2006.       FOR objtype = 17
  2007.    * Strip quotes from other object types, such as quoted strings.
  2008.    REPLACE ALL fldcontent WITH STRTRAN(fldcontent,'\+',''), ;
  2009.                frmcontent WITH STRTRAN(frmcontent,'\+',''), ;
  2010.                picture    WITH STRTRAN(picture,   '\+','')  ;
  2011.       FOR objtype <> 17
  2012.       
  2013. ELSE
  2014.    APPEND FROM (m.fname102) TYPE DELIMITED WITH TAB
  2015. ENDIF
  2016.  
  2017. * Create an empty 2.5 report file
  2018. DO docreate WITH "new", c_report
  2019.  
  2020. SELECT old
  2021. SCAN
  2022.    DO CASE
  2023.    CASE objtype = 1  && report record
  2024.       SELECT new
  2025.       APPEND BLANK
  2026.       SELECT old
  2027.       REPLACE new.platform WITH "DOS"
  2028.       REPLACE new.objtype WITH 1
  2029.       REPLACE new.objcode WITH c_25frx
  2030.       REPLACE new.topmargin WITH old.vertpos
  2031.       REPLACE new.botmargin WITH old.horzpos
  2032.       REPLACE new.height WITH old.height
  2033.       REPLACE new.width WITH old.width
  2034.       REPLACE new.offset WITH old.fontsize
  2035.       IF (old.initc > 0)
  2036.          REPLACE new.environ WITH .T.
  2037.       ENDIF
  2038.       IF (old.calcexp = 1 OR old.calcexp = 3)
  2039.          REPLACE new.ejectbefor WITH .T.
  2040.       ENDIF
  2041.       IF (old.calcexp = 2 OR old.calcexp = 3)
  2042.          REPLACE new.ejectafter WITH .T.
  2043.       ENDIF
  2044.       
  2045.    CASE objtype = 5  && text record
  2046.       SELECT new
  2047.       APPEND BLANK
  2048.       SELECT old
  2049.       REPLACE new.platform WITH "DOS"
  2050.       REPLACE new.objtype WITH 5
  2051.       REPLACE new.vpos WITH old.vertpos
  2052.       REPLACE new.hpos WITH old.horzpos
  2053.       REPLACE new.height WITH 1
  2054.       REPLACE new.width WITH old.width
  2055.       IF (old.rangelow > 0)
  2056.          REPLACE new.float WITH .T.
  2057.       ENDIF
  2058.       REPLACE new.expr WITH '"' + CPTRANS(m.g_tocodepage,m.g_fromcodepage,ALLTRIM(old.fldcontent)) + '"'
  2059.       
  2060.    CASE objtype = 7 && box record
  2061.       SELECT new
  2062.       APPEND BLANK
  2063.       SELECT old
  2064.       REPLACE new.platform WITH "DOS"
  2065.       REPLACE new.objtype WITH 7
  2066.       REPLACE new.vpos WITH old.vertpos
  2067.       REPLACE new.hpos WITH old.horzpos
  2068.       REPLACE new.height WITH old.height
  2069.       REPLACE new.width WITH old.width
  2070.       REPLACE new.objcode WITH old.content + 4
  2071.       IF (old.rangelow > 0)
  2072.          REPLACE new.float WITH .T.
  2073.       ENDIF
  2074.       IF (old.fontsize > 0)
  2075.          REPLACE new.boxchar WITH CHR(old.fontsize / 256)
  2076.       ENDIF
  2077.       
  2078.    CASE objtype = 17 && field record
  2079.       SELECT new
  2080.       APPEND BLANK
  2081.       SELECT old
  2082.       REPLACE new.platform WITH "DOS"
  2083.       REPLACE new.objtype WITH 8
  2084.       REPLACE new.vpos WITH old.vertpos
  2085.       REPLACE new.hpos WITH old.horzpos
  2086.       REPLACE new.height WITH 1
  2087.       REPLACE new.width WITH old.width
  2088.       REPLACE new.expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,TRIM(old.fldcontent))
  2089.       IF !EMPTY(old.picture)
  2090.          REPLACE new.picture WITH '"' + CPTRANS(m.g_tocodepage,m.g_fromcodepage,ALLTRIM(old.picture)) + '"'
  2091.       ENDIF
  2092.       REPLACE new.totaltype WITH old.valid
  2093.       REPLACE new.resettotal WITH old.initc
  2094.       IF (old.rangeup > 0)
  2095.          REPLACE new.norepeat WITH .T.
  2096.       ENDIF
  2097.       
  2098.       IF (old.rangelow > 1)
  2099.          WRAP = MAX(old.rangelow - 3, 0)
  2100.       ELSE
  2101.          WRAP = old.rangelow
  2102.       ENDIF
  2103.       
  2104.       IF (WRAP > 0)
  2105.          REPLACE new.stretch WITH .T.
  2106.       ENDIF
  2107.       
  2108.       IF (old.rangelow = 3 OR old.rangelow = 4)
  2109.          REPLACE new.float WITH .T.
  2110.       ENDIF
  2111.       
  2112.       REPLACE new.fillchar WITH ALLTRIM(old.frmcontent)
  2113.       
  2114.    CASE objtype = 18 && band record
  2115.       SELECT new
  2116.       APPEND BLANK
  2117.       SELECT old
  2118.       REPLACE new.platform WITH "DOS"
  2119.       REPLACE new.objtype WITH 9
  2120.       REPLACE new.objcode WITH old.content
  2121.       REPLACE new.expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,old.fldcontent)
  2122.       REPLACE new.height WITH old.height
  2123.       IF (old.vertpos > 0)
  2124.          REPLACE new.pagebreak WITH .T.
  2125.       ENDIF
  2126.       IF (old.fontsize > 0)
  2127.          REPLACE new.swapheader WITH .T.
  2128.       ENDIF
  2129.       IF (old.style > 0)
  2130.          REPLACE new.swapfooter WITH .T.
  2131.       ENDIF
  2132.    ENDCASE
  2133. ENDSCAN
  2134.  
  2135. * Discard the temporary cursor
  2136. SELECT old
  2137. USE
  2138.  
  2139. IF m.ftype = c_frx102repo
  2140.    * Back up the original report and copy the new information to the original file name
  2141.    m.bakname = forceext(m.fname102,"TBK")
  2142.    RENAME (m.fname102) TO (m.bakname)
  2143. ENDIF
  2144.  
  2145. * Write the new information on top of the original 1.02 report
  2146. SELECT new
  2147. COPY TO (m.fname102)
  2148. USE
  2149. SELECT (m.in_area)
  2150. RETURN m.fname102
  2151.  
  2152. *!*****************************************************************************
  2153. *!
  2154. *!      Procedure: CVRTFBPRPT
  2155. *!
  2156. *!      Called by: TRANSPRT.PRG                      
  2157. *!
  2158. *!          Calls: ERRORHANDLER       (procedure in TRANSPRT.PRG)
  2159. *!               : CVTSHORT()         (function  in TRANSPRT.PRG)
  2160. *!               : CVTBYTE()          (function  in TRANSPRT.PRG)
  2161. *!               : DOCREATE           (procedure in TRANSPRT.PRG)
  2162. *!               : EVALIMPORTEXPR     (procedure in TRANSPRT.PRG)
  2163. *!               : INITBANDS          (procedure in TRANSPRT.PRG)
  2164. *!               : BLDBREAKS          (procedure in TRANSPRT.PRG)
  2165. *!               : BLDDETAIL          (procedure in TRANSPRT.PRG)
  2166. *!               : FORCEEXT()         (function  in TRANSPRT.PRG)
  2167. *!
  2168. *!*****************************************************************************
  2169. PROCEDURE cvrtfbprpt
  2170. * Convert a FoxBASE+ report to FoxPro 2.5 DOS format
  2171. PARAMETER m.fnamefbp, m.ftype
  2172. PRIVATE m.bakname, m.in_area, m.i, m.idbyte, m.objname, m.obj, m.rp_pool, ;
  2173.    m.rp_ltadr, m.rp_ltlen, m.rp_ssexno, m.rp_sbexno, m.rp_doublesp, ;
  2174.    m.rp_flds_width, m.rp_flds_exprno, m.rp_width, m.rp_flds_headno, ;
  2175.    m.rp_plain, m.band_rows, m.current_row, m.group_num, m.head_row
  2176.  
  2177. m.in_area = SELECT()
  2178. SELECT 0
  2179.  
  2180. m.objname       = ""
  2181. m.obj           = 0
  2182. m.rp_pool       = 0
  2183. m.rp_ltadr      = 0
  2184. m.rp_ltlen      = 0
  2185. m.rp_ssexno     = 0
  2186. m.rp_sbexno     = 0
  2187. m.rp_doublesp   = 0
  2188. m.rp_flds_width = 0
  2189. m.rp_flds_exprno= 0
  2190. m.rp_width      = 0
  2191. m.rp_flds_headno= 0
  2192. m.rp_plain      = 0
  2193. m.band_rows     = 0
  2194. m.current_row   = 0
  2195. m.group_num     = 0
  2196. m.head_row      = 0
  2197.  
  2198. * Create a set of parallel arrays to contain the report information we need to bring
  2199. * across to FoxPro 2.5 DOS.
  2200. DIMENSION rp_ltlen(maxliterals)
  2201. DIMENSION rp_ltadr(maxliterals)
  2202. DIMENSION rp_flds_width(maxrepflds)
  2203. DIMENSION rp_flds_type(maxrepflds)
  2204. DIMENSION rp_flds_totals(maxrepflds)
  2205. DIMENSION rp_flds_dp(maxrepflds)
  2206. DIMENSION rp_flds_exprno(maxrepflds)
  2207. DIMENSION rp_flds_headno(maxrepflds)
  2208. DIMENSION band_rows(10)
  2209. band_rows = 0
  2210.  
  2211. m.obj = FOPEN(m.g_scrndbf)
  2212. IF (m.obj < 1)
  2213.    DO errorhandler WITH "Could not open FoxBASE+ report form",LINENO(),c_error3
  2214. ENDIF
  2215.  
  2216. m.idbyte = cvtshort(FREAD(m.obj,2),0)
  2217.  
  2218. poolsize = cvtshort(FREAD(m.obj,2),0)
  2219. FOR i = 1 TO maxliterals
  2220.    rp_ltlen(i) = cvtshort(FREAD(m.obj,2),0)
  2221. ENDFOR
  2222. FOR i = 1 TO maxliterals
  2223.    rp_ltadr(i) = cvtshort(FREAD(m.obj,2),0)
  2224. ENDFOR
  2225. rp_pool = FREAD(m.obj,litpoolsize)
  2226. FOR i = 1 TO maxrepflds
  2227.    rp_flds_width(i) = cvtshort(FREAD(m.obj,2),0)
  2228.    =FREAD(m.obj,2)
  2229.    rp_flds_type(i) = FREAD(m.obj,1)
  2230.    rp_flds_totals(i) = FREAD(m.obj,1)
  2231.    rp_flds_dp(i) = cvtshort(FREAD(m.obj,2),0)
  2232.    rp_flds_exprno(i) = cvtshort(FREAD(m.obj,2),0)
  2233.    rp_flds_headno(i) = cvtshort(FREAD(m.obj,2),0)
  2234. ENDFOR
  2235. rp_pghdno = cvtshort(FREAD(m.obj,2),0)
  2236. rp_sbexno = cvtshort(FREAD(m.obj,2),0)
  2237. rp_ssexno = cvtshort(FREAD(m.obj,2),0)
  2238. rp_sbhdno = cvtshort(FREAD(m.obj,2),0)
  2239. rp_sshdno = cvtshort(FREAD(m.obj,2),0)
  2240. rp_width = cvtshort(FREAD(m.obj,2),0)
  2241. rp_length = cvtshort(FREAD(m.obj,2),0)
  2242. rp_lmarg = cvtshort(FREAD(m.obj,2),0)
  2243. rp_rmarg = cvtshort(FREAD(m.obj,2),0)
  2244. rp_fldcnt = cvtshort(FREAD(m.obj,2),0)
  2245. rp_doublesp = FREAD(m.obj,1)
  2246. rp_summary = FREAD(m.obj, 1)
  2247. rp_subeject = FREAD(m.obj,1)
  2248. rp_other = cvtbyte(FREAD(m.obj,1),0)
  2249. rp_pageno = cvtshort(FREAD(m.obj,2),0)
  2250. =FCLOSE(m.obj)
  2251. IF (rp_pageno != 2)
  2252.    =FCLOSE(m.obj)
  2253. ENDIF
  2254.  
  2255. * Create an empty 2.5 report file
  2256. DO docreate WITH "new", c_report
  2257.  
  2258. * Fill it in
  2259. DO evalimportexpr
  2260. DO initbands
  2261. DO bldbreaks
  2262. IF rp_fldcnt > 0
  2263.    DO blddetail
  2264. ENDIF
  2265.  
  2266. * Add the header data
  2267. SELECT new
  2268. GOTO TOP
  2269. REPLACE objtype WITH 1, objcode WITH c_25frx
  2270.  
  2271. IF m.ftype = c_fbprptrepo
  2272.    * Back up the original report and copy the new information to the original file name
  2273.    m.bakname = forceext(m.fnamefbp,"TBK")
  2274.    RENAME (m.fnamefbp) TO (m.bakname)
  2275. ENDIF
  2276.  
  2277. * Write the new information to a file with an FRX extension but the
  2278. * same base name as the original FoxBASE+ report
  2279. SELECT new
  2280. COPY TO (m.fnamefbp)
  2281. USE
  2282. SELECT (m.in_area)
  2283. RETURN m.fnamefbp
  2284.  
  2285.  
  2286. *!********************************************************************
  2287. *!
  2288. *!        Convert FoxPro 1.0 label to 2.0 format
  2289. *!
  2290. *!********************************************************************
  2291.  
  2292. PROCEDURE cvrt102lbx
  2293. PARAMETERS m.fname102, m.ftype
  2294. PRIVATE m.i, m.short, m.contlen, m.obj, m.remarks, m.height, m.lmargin, m.width, ;
  2295.    m.numacross, m.spacesbet, m.linesbet, m.bakname, m.in_area
  2296.    
  2297. m.in_area = SELECT()
  2298.  
  2299. m.lblname = m.fname102
  2300.  
  2301. m.obj = FOPEN(m.lblname)
  2302. =FREAD(m.obj,1)                && Skip revision
  2303. m.remarks = FREAD(m.obj,60)
  2304. m.height = cvtshort(FREAD(m.obj,2),0)
  2305. m.lmargin = cvtshort(FREAD(m.obj,2),0)
  2306. m.width = cvtshort(FREAD(m.obj,2),0)
  2307. m.numacross = cvtshort(FREAD(m.obj,2),0)
  2308. m.spacesbet = cvtshort(FREAD(m.obj,2),0)
  2309. m.linesbet = cvtshort(FREAD(m.obj,2),0)
  2310.  
  2311. * Read in label contents -- each line ends in a CR
  2312.  
  2313. m.contlen = cvtshort(FREAD(m.obj,2),0)
  2314. m.work = FREAD(m.obj, m.contlen)
  2315. =FCLOSE(m.obj)
  2316.  
  2317. DIMENSION lbllines[m.height]
  2318. m.start = 1
  2319. m.i = 1
  2320. FOR m.curlen = 1 TO m.contlen
  2321.    IF (SUBSTR(m.work, m.curlen, 1) = CHR(13))
  2322.       lbllines[m.i] = SUBSTR(m.work, m.start, m.curlen-m.start)
  2323.       m.start = m.curlen+1
  2324.       m.i = m.i + 1
  2325.    ENDIF
  2326. ENDFOR
  2327.  
  2328. DO WHILE (m.i <= m.height)
  2329.    lbllines[m.i] = ''
  2330.    m.i = m.i + 1
  2331. ENDDO
  2332.  
  2333. * Create an empty 2.0 label 
  2334. CREATE CURSOR new (objtype N(2), objcode N(2), ;
  2335.    name m, expr m, STYLE m, HEIGHT N(3), WIDTH N(3), lmargin N(3), ;
  2336.    numacross N(3), spacesbet N(3), linesbet N(3), ENVIRON l, ;
  2337.    ORDER m, UNIQUE l, TAG m, tag2 m, addalias l)
  2338.  
  2339. * Add the header data
  2340. SELECT new
  2341. APPEND BLANK
  2342. REPLACE new.objtype WITH 30
  2343. REPLACE new.name WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,m.remarks)
  2344.  
  2345. REPLACE new.height WITH m.height
  2346. REPLACE new.width WITH m.width
  2347. REPLACE new.lmargin WITH m.lmargin
  2348. REPLACE new.numacross WITH m.numacross
  2349. REPLACE new.spacesbet WITH m.spacesbet
  2350. REPLACE new.linesbet WITH m.linesbet
  2351.  
  2352. * Add the label contents
  2353.  
  2354. FOR m.i = 1 TO m.height
  2355.    APPEND BLANK
  2356.    REPLACE new.objtype WITH 19
  2357.    REPLACE new.expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,lbllines[m.i])
  2358. ENDFOR
  2359.  
  2360. IF m.ftype = c_lbx102repo
  2361.    * Back up the original label and copy the new information to the original file name
  2362.    m.bakname = forceext(m.fname102,"TBK")
  2363.    RENAME (m.fname102) TO (m.bakname)
  2364. ENDIF
  2365.  
  2366. * Write the new information on top of the original 1.02 label
  2367. SELECT new
  2368. COPY TO (m.fname102)
  2369. USE
  2370. SELECT (m.in_area)
  2371. RETURN m.fname102
  2372.  
  2373.  
  2374. RETURN
  2375.  
  2376. *!********************************************************************
  2377. *!
  2378. *!        Convert FoxBase+ label to 2.0 format
  2379. *!
  2380. *!********************************************************************
  2381.  
  2382. PROCEDURE cvrtfbplbl
  2383. PARAMETERS m.fnamefbp, m.ftype
  2384.  
  2385. PRIVATE m.width, m.height, m.lmargin, m.spacesbet, m.linesbet, m.numacross, m.obj, ;
  2386.    m.i, m.lblname, m.in_area, m.dummy
  2387.  
  2388. m.in_area = SELECT()
  2389.    
  2390. m.lblname = m.fnamefbp
  2391.    
  2392. m.width = 0
  2393. m.height = 0
  2394. m.lmargin = 0
  2395. m.spacesbet = 0
  2396. m.linesbet = 0
  2397. m.numacross = 0
  2398.  
  2399. m.obj = FOPEN(m.lblname)
  2400. =FREAD(m.obj,1)                && Skip revision
  2401. m.remarks = FREAD(m.obj,60)
  2402. m.height = cvtshort(FREAD(m.obj,2),0)
  2403. m.width = cvtshort(FREAD(m.obj,2),0)
  2404. m.lmargin = cvtshort(FREAD(m.obj,2),0)
  2405. m.linesbet = cvtshort(FREAD(m.obj,2),0)
  2406. m.spacesbet = cvtshort(FREAD(m.obj,2),0)
  2407. m.numacross = cvtshort(FREAD(m.obj,2),0)
  2408.  
  2409. *******************************************************
  2410. * Read the label contents -- strip spaces and add a CR
  2411. *******************************************************
  2412.  
  2413. DIMENSION lbllines[m.height]
  2414. lbllines = '""'
  2415. m.lastline = 0
  2416. FOR m.i = 1 TO m.height
  2417.    m.olen = 60
  2418.    m.work = FREAD(m.obj,m.olen)
  2419.    DO WHILE ((m.olen > 0) AND (SUBSTR(m.work, m.olen, 1) = ' '))
  2420.       m.olen = m.olen - 1
  2421.    ENDDO
  2422.    =STUFF(m.work, m.olen, 1, '\n')
  2423.    lbllines[m.i] = SUBSTR(m.work, 1, m.olen+1)
  2424.    IF EMPTY(lbllines[m.i])
  2425.       lbllines[m.i] = '""'
  2426.    ELSE
  2427.       m.lastline = m.i
  2428.    ENDIF
  2429. ENDFOR
  2430.  
  2431. =FCLOSE(m.obj)
  2432.  
  2433. CREATE CURSOR new (objtype N(2), objcode N(2), ;
  2434.    name m, expr m, STYLE m, HEIGHT N(3), WIDTH N(3), lmargin N(3), ;
  2435.    numacross N(3), spacesbet N(3), linesbet N(3), ENVIRON l, ;
  2436.   ORDER m, UNIQUE l, TAG m, tag2 m, addalias l)
  2437.  
  2438. * Add the header data
  2439. SELECT new
  2440. APPEND BLANK
  2441. REPLACE new.objtype WITH 30
  2442. REPLACE new.name WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,m.remarks)
  2443.  
  2444. REPLACE new.height WITH m.height
  2445. REPLACE new.width WITH m.width
  2446. REPLACE new.lmargin WITH m.lmargin
  2447. REPLACE new.numacross WITH m.numacross
  2448. REPLACE new.spacesbet WITH m.spacesbet
  2449. REPLACE new.linesbet WITH m.linesbet
  2450.  
  2451. FOR m.i = 1 TO m.lastline
  2452.    APPEND BLANK
  2453.    REPLACE new.objtype WITH 19
  2454.    REPLACE new.expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,lbllines[m.i])
  2455. ENDFOR
  2456.  
  2457. IF m.ftype = c_fbprptrepo
  2458.    * Back up the original report and copy the new information to the original file name
  2459.    m.bakname = forceext(m.fnamefbp,"TBK")
  2460.    RENAME (m.fnamefbp) TO (m.bakname)
  2461. ENDIF
  2462.  
  2463. * Write the new information to a file with an LBX extension but the
  2464. * same base name as the original FoxBASE+ label.
  2465. SELECT new
  2466. COPY TO (m.fnamefbp)
  2467. USE
  2468. SELECT (m.in_area)
  2469. RETURN m.fnamefbp
  2470.  
  2471. *!*****************************************************************************
  2472. *!
  2473. *!      Procedure: INITBANDS
  2474. *!
  2475. *!      Called by: cvrtfbpRPT      (procedure in TRANSPRT.PRG)
  2476. *!
  2477. *!          Calls: GETLITEXPR()       (function  in TRANSPRT.PRG)
  2478. *!               : LINESFORHEADING()  (function  in TRANSPRT.PRG)
  2479. *!               : FLD_HEAD_EXIST()   (function  in TRANSPRT.PRG)
  2480. *!               : HOWMANYHEADINGS()  (function  in TRANSPRT.PRG)
  2481. *!               : MAKEBAND           (procedure in TRANSPRT.PRG)
  2482. *!               : TOTALS_EXIST()     (function  in TRANSPRT.PRG)
  2483. *!               : MAKETEXT           (procedure in TRANSPRT.PRG)
  2484. *!               : MAKEFIELD          (procedure in TRANSPRT.PRG)
  2485. *!               : GETHEADING()       (function  in TRANSPRT.PRG)
  2486. *!               : CENTER_COL()       (function  in TRANSPRT.PRG)
  2487. *!
  2488. *!*****************************************************************************
  2489. PROCEDURE initbands
  2490.  
  2491. APPEND BLANK
  2492. REPLACE new->platform WITH "DOS"
  2493. REPLACE new->WIDTH WITH m.rp_width
  2494. REPLACE new->HEIGHT WITH m.rp_length
  2495. REPLACE new->offset WITH m.rp_lmarg
  2496. REPLACE new->ejectbefor WITH .T.
  2497. m.rp_plain = 0
  2498. m.group_num = 0
  2499. IF ("Y" = m.rp_summary)
  2500.    REPLACE new->SUMMARY WITH .T.
  2501. ENDIF
  2502. IF (INLIST(m.rp_other,1,3,5,7))
  2503.    REPLACE new->ejectbefor WITH .F.
  2504. ENDIF
  2505. IF (INLIST(m.rp_other,3,6,7))
  2506.    REPLACE new->ejectafter WITH .T.
  2507. ENDIF
  2508. IF (INLIST(m.rp_other,4,5,6,7))
  2509.    REPLACE new->PLAIN WITH .T.
  2510.    m.rp_plain = 1
  2511. ENDIF
  2512. m.rp_totals = 0
  2513. m.current_row = 0
  2514.  
  2515. * header band
  2516.  
  2517. m.bandsize = 1
  2518. IF (m.rp_plain = 0)
  2519.    m.bandsize = m.bandsize + 2
  2520. ENDIF
  2521.  
  2522. m.string = ""
  2523. IF (getlitexpr(m.rp_pghdno, @m.string) <> 0)
  2524.    m.size = linesforheading(m.string)
  2525.    m.bandsize = m.bandsize + m.size
  2526. ENDIF
  2527.  
  2528. IF (fld_head_exist() = 1)
  2529.    m.size = howmanyheadings()
  2530.    m.bandsize = m.bandsize + m.size + 3
  2531. ELSE
  2532.    m.bandsize = m.bandsize + 3
  2533. ENDIF
  2534.  
  2535. DO makeband WITH h_page, m.bandsize, "", .F.
  2536.  
  2537. * group bands
  2538. m.bandstring = ""
  2539. IF (getlitexpr(m.rp_sbexno, @m.bandstring) <> 0)
  2540.    IF ("Y" = m.rp_subeject)
  2541.       m.newpage = .T.
  2542.    ELSE
  2543.       m.newpage = .F.
  2544.    ENDIF
  2545.    DO makeband WITH h_break, 2, m.bandstring, m.newpage
  2546.    m.rp_totals = m.rp_totals + 1
  2547.    IF (getlitexpr(m.rp_ssexno, @m.bandstring) <> 0)
  2548.       DO makeband WITH h_break, 2, m.bandstring, .F.
  2549.       m.rp_totals = m.rp_totals + 1
  2550.    ENDIF
  2551. ENDIF
  2552.  
  2553. group_num = rp_totals
  2554. m.numlines = 1
  2555. IF ("Y" = m.rp_doublesp)
  2556.    m.numlines = 2
  2557. ENDIF
  2558.  
  2559. * detail band
  2560. DO makeband WITH l_item, m.numlines, "", .F.
  2561.  
  2562. * break footer bands
  2563. IF (totals_exist() = 1)
  2564.    m.bandsize = 2
  2565. ELSE
  2566.    m.bandsize = 1
  2567. ENDIF
  2568.  
  2569. m.groupnum = m.rp_totals
  2570.  
  2571. FOR i = 1 TO m.rp_totals
  2572.    DO makeband WITH f_break, m.bandsize, "", .F.
  2573. ENDFOR
  2574.  
  2575. * page footer band
  2576. DO makeband WITH f_page, 1, "", .F.
  2577.  
  2578. * report footer band
  2579. DO makeband WITH f_rpt, m.bandsize, "", .F.
  2580.  
  2581. IF (rp_plain = 0)
  2582.    DO maketext WITH 9, 1, "PAGE NO. ", band_rows(h_page)+1, 0
  2583.    DO makefield WITH 5, 1, "_PAGENO", band_rows(h_page)+1, 9, "C", .F., .F., 0, 0
  2584.    DO makefield WITH 8, 1, "DATE()", band_rows(h_page)+2, 0, "D", .F., .F., 0, 0
  2585.    m.head_row = 3
  2586. ELSE
  2587.    m.head_row = 0
  2588. ENDIF
  2589.  
  2590. IF (getlitexpr(m.rp_pghdno,@m.string) <> 0)
  2591.    m.string = m.string + ";"
  2592.    m.heading = ""
  2593.    DO WHILE .T.
  2594.       IF (getheading(@m.heading, @m.string) > 0)
  2595.          DO maketext WITH LEN(m.heading), 1, m.heading, m.head_row, center_col(LEN(m.heading))
  2596.          m.head_row = m.head_row + 1
  2597.       ELSE
  2598.          EXIT
  2599.       ENDIF
  2600.    ENDDO
  2601. ENDIF
  2602.  
  2603. m.head_row = m.head_row + 1
  2604.  
  2605. RETURN
  2606.  
  2607. *!*****************************************************************************
  2608. *!
  2609. *!      Procedure: BLDBREAKEXP
  2610. *!
  2611. *!      Called by: BLDBREAKS          (procedure in TRANSPRT.PRG)
  2612. *!
  2613. *!          Calls: GETLITEXPR()       (function  in TRANSPRT.PRG)
  2614. *!               : MAKETEXT           (procedure in TRANSPRT.PRG)
  2615. *!               : MAKEFIELD          (procedure in TRANSPRT.PRG)
  2616. *!
  2617. *!*****************************************************************************
  2618. PROCEDURE bldbreakexp
  2619. PARAMETER m.exprno, m.headno, m.row, m.stars
  2620.  
  2621. PRIVATE m.string
  2622. m.string = ""
  2623. =getlitexpr(m.headno, @m.string)
  2624. m.string = m.stars + m.string
  2625. strlen = LEN(m.string)
  2626. DO maketext WITH m.strlen, 1, m.string, m.row, 0
  2627. =getlitexpr(m.exprno, @m.string)
  2628. DO makefield WITH rp_ltlen(m.exprno+1), 1, m.string, m.row, m.strlen + 1, "C", .F., .F., 0, 0
  2629. RETURN
  2630.  
  2631. *!*****************************************************************************
  2632. *!
  2633. *!      Procedure: BLDBREAKS
  2634. *!
  2635. *!      Called by: cvrtfbpRPT      (procedure in TRANSPRT.PRG)
  2636. *!
  2637. *!          Calls: LITEXIST()         (function  in TRANSPRT.PRG)
  2638. *!               : BLDBREAKEXP        (procedure in TRANSPRT.PRG)
  2639. *!
  2640. *!*****************************************************************************
  2641. PROCEDURE bldbreaks
  2642. IF (litexist(rp_sbexno) = 1)
  2643.    DO bldbreakexp WITH rp_sbexno, rp_sbhdno, band_rows(h_break) + 1, "** "
  2644.    IF (litexist(rp_ssexno) = 1)
  2645.       DO bldbreakexp WITH rp_ssexno, rp_sshdno, band_rows(h_break) + 3, "*"
  2646.    ENDIF
  2647. ENDIF
  2648. RETURN
  2649.  
  2650. *!*****************************************************************************
  2651. *!
  2652. *!      Procedure: BLDDETAIL
  2653. *!
  2654. *!      Called by: cvrtfbpRPT      (procedure in TRANSPRT.PRG)
  2655. *!
  2656. *!          Calls: GETLITEXPR()       (function  in TRANSPRT.PRG)
  2657. *!               : MAKEFIELD          (procedure in TRANSPRT.PRG)
  2658. *!               : ADDTOTAL           (procedure in TRANSPRT.PRG)
  2659. *!               : GETHEADING()       (function  in TRANSPRT.PRG)
  2660. *!               : MAKETEXT           (procedure in TRANSPRT.PRG)
  2661. *!
  2662. *!*****************************************************************************
  2663. PROCEDURE blddetail
  2664. PRIVATE m.i, m.pg_row, m.istotal, m.fcol, m.row, m.string, m.col, m.heading
  2665.  
  2666. m.pg_row = 0
  2667. m.istotal = 0
  2668. m.fcol = 0
  2669. m.row = band_rows(l_item)
  2670. m.string = ""
  2671. FOR m.i = 1 TO rp_fldcnt
  2672.    IF (getlitexpr(rp_flds_exprno(m.i), @m.string) <> 0)
  2673.       m.row = band_rows(l_item)
  2674.       IF (m.fcol + rp_flds_width(m.i) > m.rp_width - 1)
  2675.          rp_flds_width(m.i) = rp_flds_width(m.i) - (m.fcol + rp_flds_width(m.i) - m.rp_width)
  2676.          IF (rp_flds_width(m.i) < 0)
  2677.             EXIT
  2678.          ENDIF
  2679.       ENDIF
  2680.       DO makefield WITH rp_flds_width(m.i), 1, m.string, m.row, m.fcol, rp_flds_type(m.i), .T., .T., 0, 0
  2681.       IF ("Y" = rp_flds_totals(m.i))
  2682.          DO makefield WITH rp_flds_width(m.i), 1, m.string, band_rows(f_rpt) + 1, m.fcol, "N", .F., .F., 2, 0
  2683.          IF (m.group_num > 0)
  2684.             IF (m.group_num > 1)
  2685.                DO addtotal WITH m.istotal, band_rows(f_break), m.fcol, rp_flds_width(m.i), m.string, "* Subsubtotal *", 4
  2686.                DO addtotal WITH m.istotal, band_rows(f_break) + 2, m.fcol, rp_flds_width(m.i), m.string, "** Subtotal **", 3
  2687.             ELSE
  2688.                DO addtotal WITH m.istotal, band_rows(f_break), m.fcol, rp_flds_width(m.i), m.string, "** Subtotal **", 3
  2689.             ENDIF
  2690.          ENDIF
  2691.          m.istotal = 1
  2692.       ENDIF
  2693.    ENDIF
  2694.    
  2695.    IF (getlitexpr(rp_flds_headno(m.i), @m.string) <> 0)
  2696.       m.string = m.string + ";"
  2697.       m.heading = ""
  2698.       m.hrow = m.head_row
  2699.       DO WHILE .T.
  2700.          IF (getheading(@m.heading, @m.string) > 0)
  2701.             IF (rp_flds_type(m.i) = "N")
  2702.                m.col = (m.fcol + rp_flds_width(m.i)) - LEN(m.heading)
  2703.             ELSE
  2704.                m.col = m.fcol
  2705.             ENDIF
  2706.             DO maketext WITH LEN(m.heading), 1, m.heading, m.hrow, m.col
  2707.             m.hrow = m.hrow + 1
  2708.          ELSE
  2709.             EXIT
  2710.          ENDIF
  2711.       ENDDO
  2712.    ENDIF
  2713.    m.fcol = m.fcol + rp_flds_width(m.i) + 1
  2714. ENDFOR
  2715.  
  2716. IF (m.istotal = 1)
  2717.    DO maketext WITH 13, 1, "*** Total ***", band_rows(f_rpt), 0
  2718. ENDIF
  2719.  
  2720. RETURN
  2721.  
  2722. *!*****************************************************************************
  2723. *!
  2724. *!      Procedure: ADDTOTAL
  2725. *!
  2726. *!      Called by: BLDDETAIL          (procedure in TRANSPRT.PRG)
  2727. *!
  2728. *!          Calls: MAKETEXT           (procedure in TRANSPRT.PRG)
  2729. *!               : MAKEFIELD          (procedure in TRANSPRT.PRG)
  2730. *!
  2731. *!*****************************************************************************
  2732. PROCEDURE addtotal
  2733. PARAMETER m.isfirst, m.row, m.col, m.wt, m.workstr, m.totalstr, m.reset
  2734. IF (m.isfirst = 0)
  2735.    DO maketext WITH LEN(m.totalstr), 1, m.totalstr, m.row, 0
  2736. ENDIF
  2737. DO makefield WITH m.wt, 1, m.workstr, m.row+1, m.col, "N", .F., .F., 2, m.reset
  2738. RETURN
  2739.  
  2740.  
  2741. *!*****************************************************************************
  2742. *!
  2743. *!       Function: LITEXIST
  2744. *!
  2745. *!      Called by: BLDBREAKS          (procedure in TRANSPRT.PRG)
  2746. *!               : GETLITEXPR()       (function  in TRANSPRT.PRG)
  2747. *!               : FLD_HEAD_EXIST()   (function  in TRANSPRT.PRG)
  2748. *!
  2749. *!*****************************************************************************
  2750. FUNCTION litexist
  2751. PARAMETER m.idx
  2752. PRIVATE m.flag
  2753. m.flag = 0
  2754. IF m.idx != 65535
  2755.    IF "" <> SUBSTR(rp_pool, rp_ltadr(m.idx+1)+1, 1)
  2756.       m.flag = 1
  2757.    ENDIF
  2758. ENDIF
  2759. RETURN m.flag
  2760.  
  2761. *!*****************************************************************************
  2762. *!
  2763. *!       Function: GETLITEXPR
  2764. *!
  2765. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2766. *!               : BLDBREAKEXP        (procedure in TRANSPRT.PRG)
  2767. *!               : BLDDETAIL          (procedure in TRANSPRT.PRG)
  2768. *!               : HOWMANYHEADINGS()  (function  in TRANSPRT.PRG)
  2769. *!               : EVALIMPORTEXPR     (procedure in TRANSPRT.PRG)
  2770. *!
  2771. *!          Calls: LITEXIST()         (function  in TRANSPRT.PRG)
  2772. *!
  2773. *!*****************************************************************************
  2774. FUNCTION getlitexpr
  2775. PARAMETER m.idx, m.string
  2776. m.flag = 0
  2777. IF (litexist(m.idx) = 1)
  2778.    m.string = SUBSTR(m.rp_pool, rp_ltadr(m.idx+1)+1, rp_ltlen(m.idx+1) - 1)
  2779.    m.flag = 1
  2780. ELSE
  2781.    m.string = ""
  2782. ENDIF
  2783. RETURN m.flag
  2784.  
  2785. *!*****************************************************************************
  2786. *!
  2787. *!      Procedure: MAKEBAND
  2788. *!
  2789. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2790. *!
  2791. *!*****************************************************************************
  2792. PROCEDURE makeband
  2793. PARAMETER m.type, m.size, m.string, m.newpage
  2794. APPEND BLANK
  2795. REPLACE new->platform WITH "DOS"
  2796. REPLACE new->objtype WITH 9
  2797. REPLACE new->objcode WITH m.type
  2798. REPLACE new->expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,m.string)
  2799. REPLACE new->HEIGHT WITH m.size
  2800. REPLACE new->pagebreak WITH m.newpage
  2801. IF (band_rows(m.type) = 0)
  2802.    band_rows(m.type) = m.current_row
  2803. ENDIF
  2804. m.current_row = m.current_row + m.size
  2805. RETURN
  2806.  
  2807. *!*****************************************************************************
  2808. *!
  2809. *!      Procedure: MAKETEXT
  2810. *!
  2811. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2812. *!               : BLDBREAKEXP        (procedure in TRANSPRT.PRG)
  2813. *!               : BLDDETAIL          (procedure in TRANSPRT.PRG)
  2814. *!               : ADDTOTAL           (procedure in TRANSPRT.PRG)
  2815. *!
  2816. *!*****************************************************************************
  2817. PROCEDURE maketext
  2818. PARAMETER  wt, ht, string, ROW, COL
  2819. IF m.wt > 0 
  2820.    APPEND BLANK
  2821.    REPLACE new->platform WITH "DOS"
  2822.    REPLACE new->expr WITH '"' + CPTRANS(m.g_tocodepage,m.g_fromcodepage,m.string) + '"'
  2823.    REPLACE new->objtype WITH 5
  2824.    REPLACE new->HEIGHT WITH ht
  2825.    REPLACE new->WIDTH WITH wt
  2826.    REPLACE new->vpos WITH ROW
  2827.    REPLACE new->hpos WITH COL
  2828. ENDIF   
  2829. RETURN
  2830.  
  2831. *!*****************************************************************************
  2832. *!
  2833. *!      Procedure: MAKEFIELD
  2834. *!
  2835. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2836. *!               : BLDBREAKEXP        (procedure in TRANSPRT.PRG)
  2837. *!               : BLDDETAIL          (procedure in TRANSPRT.PRG)
  2838. *!               : ADDTOTAL           (procedure in TRANSPRT.PRG)
  2839. *!
  2840. *!*****************************************************************************
  2841. PROCEDURE makefield
  2842. PARAMETER m.wt, m.ht, m.string, m.row, m.col, m.fldchar, m.strch, m.flt, m.total, m.reset
  2843.  
  2844. APPEND BLANK
  2845. REPLACE new->platform WITH "DOS"
  2846. REPLACE new->objtype WITH 8
  2847. REPLACE new->expr WITH CPTRANS(m.g_tocodepage,m.g_fromcodepage,m.string)
  2848. REPLACE new->HEIGHT WITH m.ht
  2849. REPLACE new->WIDTH WITH m.wt
  2850. REPLACE new->vpos WITH m.row
  2851. REPLACE new->hpos WITH m.col
  2852. REPLACE new->fillchar WITH m.fldchar
  2853. REPLACE new->STRETCH WITH m.strch
  2854. REPLACE new->FLOAT WITH m.flt
  2855. REPLACE new->totaltype WITH m.total
  2856. REPLACE new->resettotal WITH m.reset
  2857. RETURN
  2858.  
  2859. *!*****************************************************************************
  2860. *!
  2861. *!       Function: GETHEADING
  2862. *!
  2863. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2864. *!               : BLDDETAIL          (procedure in TRANSPRT.PRG)
  2865. *!               : LINESFORHEADING()  (function  in TRANSPRT.PRG)
  2866. *!
  2867. *!*****************************************************************************
  2868. FUNCTION getheading
  2869. PARAMETER m.heading, m.string
  2870. PRIVATE m.flag, m.x, m.heading
  2871. m.flag = 0
  2872. m.x = AT(';',m.string)
  2873. m.heading = SUBSTR(m.string, 1, m.x-1)
  2874. m.string = SUBSTR(m.string, m.x+1)
  2875. IF (LEN(m.string) > 0)   && more left
  2876.    m.flag = 1
  2877. ENDIF
  2878. IF (LEN(m.heading) > 0)
  2879.    m.flag = 1
  2880. ENDIF
  2881. RETURN m.flag
  2882.  
  2883. *!*****************************************************************************
  2884. *!
  2885. *!       Function: LINESFORHEADING
  2886. *!
  2887. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2888. *!               : HOWMANYHEADINGS()  (function  in TRANSPRT.PRG)
  2889. *!
  2890. *!          Calls: GETHEADING()       (function  in TRANSPRT.PRG)
  2891. *!
  2892. *!*****************************************************************************
  2893. FUNCTION linesforheading
  2894. PARAMETER m.string
  2895. PRIVATE m.retval, m.string2, m.heading
  2896. m.string2 = m.string + ";"
  2897. m.heading = ""
  2898. m.retval = 0
  2899. DO WHILE .T.
  2900.    IF (getheading(@m.heading, @m.string2) > 0)
  2901.       m.retval = m.retval + 1
  2902.    ELSE
  2903.       EXIT
  2904.    ENDIF
  2905. ENDDO
  2906. RETURN m.retval
  2907.  
  2908. *!*****************************************************************************
  2909. *!
  2910. *!       Function: HOWMANYHEADINGS
  2911. *!
  2912. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2913. *!
  2914. *!          Calls: GETLITEXPR()       (function  in TRANSPRT.PRG)
  2915. *!               : LINESFORHEADING()  (function  in TRANSPRT.PRG)
  2916. *!
  2917. *!*****************************************************************************
  2918. FUNCTION howmanyheadings
  2919. PRIVATE m.retval, m.i, m.newval
  2920. m.retval = 0
  2921. FOR m.i = 1 TO m.rp_fldcnt
  2922.    IF (getlitexpr(rp_flds_headno, @m.string) <> 0)
  2923.       m.newval = linesforheading(m.string)
  2924.       m.retval = MAX(m.newval, m.retval)
  2925.    ENDIF
  2926. ENDFOR
  2927. RETURN m.retval
  2928.  
  2929. *!*****************************************************************************
  2930. *!
  2931. *!       Function: FLD_HEAD_EXIST
  2932. *!
  2933. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2934. *!
  2935. *!          Calls: LITEXIST()         (function  in TRANSPRT.PRG)
  2936. *!
  2937. *!*****************************************************************************
  2938. FUNCTION fld_head_exist
  2939. PRIVATE m.flag, m.i
  2940. m.flag = 0
  2941. FOR m.i = 1 TO m.rp_fldcnt
  2942.    IF (litexist(rp_flds_headno(m.i)) = 1)
  2943.       m.flag = 1
  2944.       EXIT
  2945.    ENDIF
  2946. ENDFOR
  2947. RETURN m.flag
  2948.  
  2949. *!*****************************************************************************
  2950. *!
  2951. *!       Function: TOTALS_EXIST
  2952. *!
  2953. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2954. *!
  2955. *!*****************************************************************************
  2956. FUNCTION totals_exist
  2957. PRIVATE m.flag, m.i
  2958. m.flag = 0
  2959. FOR m.i = 1 TO m.rp_fldcnt
  2960.    IF ("Y" = rp_flds_totals(m.i))
  2961.       m.flag = 1
  2962.       EXIT
  2963.    ENDIF
  2964. ENDFOR
  2965. RETURN m.flag
  2966.  
  2967. *!*****************************************************************************
  2968. *!
  2969. *!       Function: CENTER_COL
  2970. *!
  2971. *!      Called by: INITBANDS          (procedure in TRANSPRT.PRG)
  2972. *!
  2973. *!*****************************************************************************
  2974. FUNCTION center_col
  2975. PARAMETER m.length
  2976. RETURN (MAX(0, ((m.rp_width - m.rp_lmarg - m.rp_rmarg) - m.length)/2))
  2977.  
  2978. *!*****************************************************************************
  2979. *!
  2980. *!      Procedure: EVALIMPORTEXPR
  2981. *!
  2982. *!      Called by: cvrtfbpRPT      (procedure in TRANSPRT.PRG)
  2983. *!
  2984. *!          Calls: GETLITEXPR()       (function  in TRANSPRT.PRG)
  2985. *!
  2986. *!*****************************************************************************
  2987. PROCEDURE evalimportexpr
  2988. PRIVATE string
  2989. m.string = ""
  2990. FOR i = 1 TO rp_fldcnt
  2991.    IF (getlitexpr(rp_flds_exprno(i), @string) <> 0)
  2992.       rp_flds_type(i) = TYPE(m.string)
  2993.       IF ("U" = rp_flds_type(i))
  2994.          rp_flds_type = "C"
  2995.       ENDIF
  2996.    ENDIF
  2997. ENDFOR
  2998. RETURN
  2999.  
  3000. *!*****************************************************************************
  3001. *!
  3002. *!       Function: GETOLDREPORTTYPE
  3003. *!
  3004. *!      Called by: TRANSPRT.PRG                      
  3005. *!
  3006. *!          Calls: CVTSHORT()         (function  in TRANSPRT.PRG)
  3007. *!
  3008. *!*****************************************************************************
  3009. FUNCTION getoldreporttype
  3010. * Open the main file and see what kind of file it is.  At this point, all we know
  3011. * is that it is either a FoxPro 1.02 report or a FoxBASE+ report.
  3012.  
  3013. PRIVATE m.fp, m.reptotals, m.retcode
  3014. m.retcode = m.tp_filetype
  3015.  
  3016. m.fp = FOPEN(m.g_scrndbf)
  3017. IF fp > 0
  3018.    m.reptotals = cvtshort(FREAD(m.fp,2),0)
  3019.    DO CASE
  3020.    CASE (m.reptotals == 2)   && FoxBASE+ report
  3021.       DO CASE
  3022.       CASE m.tp_filetype = c_frx102modi
  3023.          m.retcode= c_fbprptmodi
  3024.       CASE m.tp_filetype = c_frx102repo
  3025.          m.retcode = c_fbprptrepo
  3026.       OTHERWISE
  3027.          m.retcode = c_fbprptrepo
  3028.       ENDCASE
  3029.    OTHERWISE
  3030.       m.retcode = m.tp_filetype
  3031.    ENDCASE
  3032.    =FCLOSE(m.fp)
  3033. ENDIF
  3034. RETURN m.retcode
  3035. *!*****************************************************************************
  3036. *!
  3037. *!       Function: GETOLDLABELTYPE
  3038. *!
  3039. *!      Called by: TRANSPRT.PRG                      
  3040. *!
  3041. *!          Calls: CVTSHORT()         (function  in TRANSPRT.PRG)
  3042. *!
  3043. *!*****************************************************************************
  3044. FUNCTION getoldlabeltype
  3045. * Open the main file and see what kind of file it is.  At this point, all we know
  3046. * is that it is either a FoxPro 1.02 report or a FoxBASE+ label.
  3047.  
  3048. PRIVATE m.fp, m.reptotals, m.retcode
  3049. m.retcode = m.tp_filetype
  3050.  
  3051. m.fp = FOPEN(m.g_scrndbf)
  3052. IF fp > 0
  3053.    m.reptotals = cvtbyte(FREAD(m.fp,1),0)
  3054.    m.dummy     = FREAD(m.fp,1)   && skip this one
  3055.    DO CASE
  3056.    CASE (m.reptotals == 2)   && FoxBASE+ label
  3057.       DO CASE
  3058.       CASE m.tp_filetype = c_lbx102modi
  3059.          m.retcode= c_fbplblmodi
  3060.       CASE m.tp_filetype = c_lbx102repo
  3061.          m.retcode = c_fbplblrepo
  3062.       OTHERWISE
  3063.          m.retcode = c_fbplblrepo
  3064.       ENDCASE
  3065.    OTHERWISE
  3066.       m.retcode = m.tp_filetype
  3067.    ENDCASE
  3068.    =FCLOSE(m.fp)
  3069. ENDIF
  3070. RETURN m.retcode
  3071.  
  3072. *
  3073. * MAPBUTTON - Compare two sets of buttons
  3074. *
  3075. *!*****************************************************************************
  3076. *!
  3077. *!       Function: MAPBUTTON
  3078. *!
  3079. *!      Called by: UPDATESCREEN       (procedure in TRANSPRT.PRG)
  3080. *!
  3081. *!          Calls: SCATTERBUTTONS     (procedure in TRANSPRT.PRG)
  3082. *!
  3083. *!*****************************************************************************
  3084. FUNCTION mapbutton
  3085. PARAMETER frombtn, tobtn
  3086. PRIVATE m.endpos, m.outstrg, m.topos, m.i. m.pictclau
  3087. m.pictclau = LEFT(m.tobtn,AT(' ',m.tobtn)-1)
  3088. DO CASE
  3089. CASE !m.g_tographic
  3090.    * Strip out the BMP extensions, if present
  3091.    m.frombtn = STRTRAN(m.frombtn,".BMP","")
  3092.    m.frombtn = STRTRAN(m.frombtn,".bmp","")
  3093.    
  3094. CASE ".BMP" $ UPPER(m.tobtn)
  3095.    * Add back in the bitmap extensions, if the to platform already has some.  The 
  3096.    * strategy is to mark all existing bitmap extensions, then add one to each of the 
  3097.    * atoms in the picture clause.
  3098.    DO CASE
  3099.    CASE RIGHT(m.tobtn,1) = '"' OR RIGHT(m.tobtn,1) = "'"
  3100.       m.tobtn = STUFF(m.tobtn,LEN(m.tobtn),0,';')
  3101.    OTHERWISE
  3102.       m.tobtn = m.tobtn + ';'
  3103.    ENDCASE
  3104.    
  3105.    * 'brlfq' is just a marker for where a semicolon needs to go.  Mark all the existing
  3106.    * BMP extensions.
  3107.    m.tobtn = STRTRAN(m.tobtn,".BMP;",".BMPbrlfq")
  3108.    m.tobtn = STRTRAN(m.tobtn,".bmp;",".BMPbrlfq")
  3109.    
  3110.    * Add a new BMP extension where there wasn't one before.
  3111.    m.tobtn = STRTRAN(m.tobtn,";",".BMPbrlfq")
  3112.    
  3113.    * Put the semicolons back
  3114.    m.tobtn = STRTRAN(m.tobtn,"brlfq",";")
  3115.    
  3116.    * Remove trailing semicolons
  3117.    DO WHILE RIGHT(m.tobtn,2) = ';"' OR RIGHT(m.tobtn,2) = ";'"
  3118.       m.tobtn = STUFF(m.tobtn,LEN(m.tobtn)-1,1,"")
  3119.    ENDDO
  3120.    
  3121.    * Now make sure there is a 'B' in the picture clause
  3122.    IF !("B" $ m.pictclau) AND ("@" $ m.pictclau)
  3123.       m.tobtn = STUFF(m.tobtn,AT("@",m.tobtn)+2,0,"B")
  3124.       m.pictclau = m.pictclau + "B"
  3125.    ENDIF
  3126. ENDCASE
  3127.  
  3128. DO CASE
  3129. CASE m.frombtn == m.tobtn
  3130.    RETURN m.frombtn
  3131. CASE OCCURS(';',m.frombtn) = OCCURS(';',m.tobtn)
  3132.    IF m.g_tographic AND ("B" $ m.pictclau)
  3133.       * Return the newly modified "to" string in this case.
  3134.       RETURN m.tobtn
  3135.    ELSE
  3136.       RETURN m.frombtn
  3137.    ENDIF
  3138. CASE OCCURS(';',m.frombtn) > OCCURS(';',m.tobtn)
  3139.    * Are these bitmap buttons?
  3140.    IF ("B" $ m.pictclau)
  3141.       * Just add a blank one to the end
  3142.       m.endpos = RAT('"',m.tobtn)
  3143.       IF endpos > 1
  3144.          RETURN STUFF(m.tobtn,m.endpos,0,';NEW.BMP')
  3145.       ELSE
  3146.          RETURN m.tobtn + ';'
  3147.       ENDIF
  3148.    ELSE
  3149.       * Not bitmaps.
  3150.       RETURN m.frombtn
  3151.    ENDIF
  3152. OTHERWISE
  3153.    RETURN m.frombtn
  3154.    
  3155.    * An alternative strategy is to try to preserve as many as possible of the
  3156.    * destination buttons, especially since they might contain bitmaps, etc.
  3157.    
  3158.    * Populate two arrays with the button prompts.  Then scan through the
  3159.    * 'from' array seeing if we can match it up against something in the 'to'
  3160.    * array.  If so, emit the 'to' array picture.  Otherwise, emit the 'from'
  3161.    * one.
  3162.    DIMENSION fromarray[1], toarray[1]
  3163.    DO scatterbuttons WITH m.frombtn, fromarray
  3164.    DO scatterbuttons WITH m.tobtn, toarray
  3165.    outstrg = ""
  3166.    FOR m.i = 1 TO ALEN(fromarray)
  3167.       m.topos = ASCAN(toarray,fromarray[i])
  3168.       IF m.topos > 0
  3169.          m.outstrg = m.outstrg + IIF(EMPTY(m.outstrg),'',';') + toarray[m.topos]
  3170.       ELSE
  3171.          m.outstrg = m.outstrg + IIF(EMPTY(m.outstrg),'',';') + fromarray[m.i]
  3172.       ENDIF
  3173.    ENDFOR
  3174.    m.outstrg = LEFT(m.frombtn,AT(' ',m.frombtn)) + m.outstrg + '"'
  3175.    RETURN m.outstrg
  3176. ENDCASE
  3177.  
  3178. *!*****************************************************************************
  3179. *!
  3180. *!      Procedure: SCATTERBUTTONS
  3181. *!
  3182. *!      Called by: MAPBUTTON()        (function  in TRANSPRT.PRG)
  3183. *!
  3184. *!*****************************************************************************
  3185. PROCEDURE scatterbuttons
  3186. PARAMETERS btnlist, destarray
  3187. PRIVATE m.i, m.fromstrg, m.num, m.theword
  3188. m.fromstrg = SUBSTR(m.btnlist,AT(' ',m.btnlist)+1)
  3189. m.fromstrg = CHRTRAN(m.fromstrg,CHR(34)+CHR(39),"")
  3190. m.num = OCCURS(';',m.fromstrg)
  3191. DIMENSION destarray[m.num+1]
  3192. FOR m.i = 1 TO m.num + 1
  3193.    DO CASE
  3194.    CASE m.i = 1    && first button
  3195.       m.theword = LEFT(m.fromstrg,AT(';',m.fromstrg)-1)
  3196.    CASE m.i = m.num + 1   && last button
  3197.       m.theword = SUBSTR(m.fromstrg,AT(';',m.fromstrg,m.num)+1)
  3198.    OTHERWISE
  3199.       m.theword = SUBSTR(m.fromstrg,AT(';',m.fromstrg,m.i-1)+1, ;
  3200.          AT(';',m.fromstrg,m.i) - AT(';',m.fromstrg,m.i-1))
  3201.    ENDCASE
  3202.    destarray[m.i] = UPPER(ALLTRIM(m.theword))
  3203. ENDFOR
  3204.  
  3205. *
  3206. * FindLikeVpos - Tries to find an object in the from platform with a vpos that matches the vpos
  3207. *      of a new object we are adding.  If it finds one, we return that objects Vpos in the to
  3208. *      platform.  This gives us a reasonable chance of coming close to where the user will want
  3209. *      an object that is being added to a pre-converted screen.
  3210. *
  3211. *!*****************************************************************************
  3212. *!
  3213. *!      Procedure: FINDLIKEVPOS
  3214. *!
  3215. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3216. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3217. *!
  3218. *!          Calls: ISOBJECT()         (function  in TRANSPRT.PRG)
  3219. *!
  3220. *!*****************************************************************************
  3221. PROCEDURE findlikevpos
  3222. PARAMETER m.oldvpos
  3223. PRIVATE m.objid, m.saverec, m.retval
  3224. m.saverec = RECNO()
  3225. m.retval = m.oldvpos
  3226.  
  3227. LOCATE FOR platform = m.g_fromplatform AND vpos = m.oldvpos AND isobject(objtype)
  3228. IF FOUND()
  3229.    m.objid = uniqueid
  3230.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  3231.    IF FOUND()
  3232.       m.retval = vpos
  3233.    ENDIF
  3234. ENDIF
  3235.  
  3236. GOTO RECORD (m.saverec)
  3237. RETURN m.retval
  3238.  
  3239. *
  3240. * FindLikeHpos - Tries to find an object in the from platform with an hpos that matches the hpos
  3241. *      of a new object we are adding.  If it finds one, we return that objects Hpos in the to
  3242. *      platform.  This gives us a reasonable chance of coming close to where the user will want
  3243. *      an object that is being added to a pre-converted screen.
  3244. *
  3245. *!*****************************************************************************
  3246. *!
  3247. *!      Procedure: FINDLIKEHPOS
  3248. *!
  3249. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3250. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3251. *!
  3252. *!          Calls: ISOBJECT()         (function  in TRANSPRT.PRG)
  3253. *!
  3254. *!*****************************************************************************
  3255. PROCEDURE findlikehpos
  3256. PARAMETER m.oldhpos
  3257. PRIVATE m.objid, m.saverec, m.retval
  3258. m.saverec = RECNO()
  3259. m.retval = m.oldhpos
  3260.  
  3261. LOCATE FOR platform = m.g_fromplatform AND hpos = m.oldhpos AND isobject(objtype)
  3262. IF FOUND()
  3263.    m.objid = uniqueid
  3264.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  3265.    IF FOUND()
  3266.       m.retval = hpos
  3267.    ENDIF
  3268. ENDIF
  3269.  
  3270. GOTO RECORD (m.saverec)
  3271. RETURN m.retval
  3272.  
  3273. *
  3274. * MakeCharFit - Makes sure that a report or screen is large enough to hold all of its objects.
  3275. *
  3276. *!*****************************************************************************
  3277. *!
  3278. *!      Procedure: MAKECHARFIT
  3279. *!
  3280. *!      Called by: NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3281. *!               : ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3282. *!
  3283. *!          Calls: GETRIGHTMOST       (procedure in TRANSPRT.PRG)
  3284. *!               : GETLOWEST          (procedure in TRANSPRT.PRG)
  3285. *!
  3286. *!*****************************************************************************
  3287. PROCEDURE makecharfit
  3288. PRIVATE m.right, m.bottom
  3289.  
  3290. m.right = CEILING(getrightmost(m.g_toplatform))+2
  3291. m.bottom = CEILING(getlowest(m.g_toplatform))+2
  3292.  
  3293. LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  3294. IF FOUND()
  3295.    IF WIDTH < m.right
  3296.       REPLACE WIDTH WITH m.right
  3297.    ENDIF
  3298.    
  3299.    IF HEIGHT < m.bottom AND m.g_filetype = c_screen
  3300.       REPLACE HEIGHT WITH m.bottom
  3301.    ENDIF
  3302. ENDIF
  3303.  
  3304. *
  3305. * allenvirons - Process all the screen and environment records first.
  3306. *
  3307. *!*****************************************************************************
  3308. *!
  3309. *!      Procedure: ALLENVIRONS
  3310. *!
  3311. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3312. *!               : ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3313. *!
  3314. *!          Calls: ADJCOLOR           (procedure in TRANSPRT.PRG)
  3315. *!               : ADJOBJCODE         (procedure in TRANSPRT.PRG)
  3316. *!               : ADJFONT            (procedure in TRANSPRT.PRG)
  3317. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  3318. *!
  3319. *!*****************************************************************************
  3320. PROCEDURE allenvirons
  3321. PRIVATE m.recno
  3322.  
  3323. SCAN FOR platform = m.g_fromplatform AND !DELETED() AND ;
  3324.       (objtype = c_otheader OR objtype = c_otrel OR objtype = c_otworkar OR objtype = c_otindex OR ;
  3325.       (m.g_filetype = c_label AND objtype = c_ot20label))
  3326.    m.recno = RECNO()
  3327.    
  3328.    SCATTER MEMVAR MEMO
  3329.    APPEND BLANK
  3330.    GATHER MEMVAR MEMO
  3331.    
  3332.    REPLACE platform WITH m.g_toplatform
  3333.    IF IsEnviron(objtype) AND !g_tographic
  3334.       * DOS requires the alias name to be in upper case, while Windows doesn't
  3335.       REPLACE TAG WITH UPPER(TAG)
  3336.       REPLACE tag2 WITH UPPER(tag2)
  3337.    ENDIF
  3338.    
  3339.    IF objtype = c_otheader OR (m.g_filetype = c_label AND objtype = c_ot20label)
  3340.       m.g_windheight = HEIGHT
  3341.       m.g_windwidth = WIDTH
  3342.       
  3343.       DO CASE
  3344.       CASE m.g_filetype = c_screen
  3345.          DO adjcolor
  3346.          
  3347.       CASE m.g_filetype = c_report
  3348.          IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  3349.             REPLACE vpos WITH 1
  3350.             REPLACE WIDTH WITH -1.0
  3351.             REPLACE ruler WITH 1
  3352.             REPLACE rulerlines WITH 1
  3353.             REPLACE gridv WITH 9
  3354.             REPLACE gridh WITH 9
  3355.             REPLACE penred   WITH 60
  3356.             REPLACE pengreen WITH 80
  3357.             REPLACE penblue    WITH 0
  3358.          ELSE
  3359.             REPLACE HEIGHT WITH c_charrptheight
  3360.             REPLACE WIDTH WITH c_charrptwidth
  3361.          ENDIF
  3362.          
  3363.       CASE m.g_filetype = c_label
  3364.          IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  3365.             REPLACE objtype WITH c_otheader
  3366.             REPLACE ruler WITH 1
  3367.             REPLACE rulerlines WITH 1
  3368.             REPLACE grid WITH .T.
  3369.             REPLACE gridv WITH 12
  3370.             REPLACE gridh WITH 12
  3371.             REPLACE penred   WITH -1
  3372.             REPLACE pengreen WITH 65535
  3373.             REPLACE stretchtop WITH .F.
  3374.             REPLACE TOP WITH .F.
  3375.             REPLACE BOTTOM WITH .T.
  3376.             REPLACE curpos WITH .F.
  3377.          ELSE
  3378.             REPLACE objtype WITH c_ot20label
  3379.             *REPLACE vpos WITH (vpos * c_charsperinch)/10000
  3380.             REPLACE hpos WITH (hpos * c_charsperinch)/10000
  3381.             REPLACE HEIGHT WITH (HEIGHT * c_linesperinch)/10000
  3382.             REPLACE WIDTH WITH (WIDTH * c_charsperinch)/10000
  3383.             IF WIDTH < 0
  3384.                REPLACE WIDTH WITH c_charrptwidth
  3385.             ENDIF
  3386.          ENDIF
  3387.       ENDCASE
  3388.       
  3389.       DO adjobjcode
  3390.       DO adjfont
  3391.    ENDIF
  3392.    
  3393.    GOTO RECORD m.recno
  3394. ENDSCAN
  3395. m.g_mercury = m.g_mercury + 5
  3396. DO updtherm WITH m.g_mercury
  3397.  
  3398. *
  3399. * allothers - Process all other records.
  3400. *
  3401. *!*****************************************************************************
  3402. *!
  3403. *!      Procedure: ALLOTHERS
  3404. *!
  3405. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3406. *!               : ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3407. *!
  3408. *!          Calls: CALCPOSITIONS      (procedure in TRANSPRT.PRG)
  3409. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  3410. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  3411. *!
  3412. *!*****************************************************************************
  3413. PROCEDURE allothers
  3414. PARAMETER m.thermpart
  3415. PRIVATE m.recno, m.numothers, m.thermstep, m.i
  3416.  
  3417. m.thermstep = m.thermpart / m.objindex
  3418.  
  3419. SELECT (m.g_fromobjonlyalias)
  3420. SET RELATION TO recnum INTO m.g_scrnalias ADDITIVE
  3421. LOCATE FOR .T.
  3422. m.i = 1
  3423.  
  3424. SCAN FOR !DELETED()
  3425.    
  3426.    m.recno = RECNO()
  3427.    
  3428.    SCATTER MEMVAR MEMO
  3429.    
  3430.    IF m.g_tographic
  3431.       DO calcpositions WITH m.i
  3432.       m.i = m.i + 1
  3433.    ENDIF
  3434.    
  3435.    SELECT (m.g_scrnalias)
  3436.    APPEND BLANK
  3437.    GATHER MEMVAR MEMO
  3438.    
  3439.    REPLACE platform WITH m.g_toplatform
  3440.    
  3441.    DO fillininfo
  3442.    
  3443.    SELECT (m.g_fromobjonlyalias)
  3444.    GOTO RECORD m.recno
  3445.    
  3446.    m.g_mercury = m.g_mercury + m.thermstep
  3447.    DO updtherm WITH m.g_mercury
  3448.       
  3449. ENDSCAN
  3450.  
  3451. *
  3452. * FillInInfo - Fill in information for the fields in SCX/FRX database.
  3453. *
  3454. *!*****************************************************************************
  3455. *!
  3456. *!      Procedure: FILLININFO
  3457. *!
  3458. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3459. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3460. *!               : ALLOTHERS          (procedure in TRANSPRT.PRG)
  3461. *!
  3462. *!          Calls: ADJRPTSUPPRESS     (procedure in TRANSPRT.PRG)
  3463. *!               : ADJRPTFLOAT        (procedure in TRANSPRT.PRG)
  3464. *!               : ADJRPTRESET        (procedure in TRANSPRT.PRG)
  3465. *!               : OBJ2BASEFONT()     (function  in TRANSPRT.PRG)
  3466. *!               : WHATSTYLE()        (function  in TRANSPRT.PRG)
  3467. *!               : ADJPEN             (procedure in TRANSPRT.PRG)
  3468. *!               : ADJCOLOR           (procedure in TRANSPRT.PRG)
  3469. *!               : ADJFONT            (procedure in TRANSPRT.PRG)
  3470. *!               : ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  3471. *!
  3472. *!*****************************************************************************
  3473. PROCEDURE fillininfo
  3474. IF m.g_filetype = c_report
  3475.    DO adjrptsuppress
  3476.    DO adjrptfloat
  3477. ENDIF
  3478.  
  3479. DO CASE
  3480. CASE m.g_tographic
  3481.    DO CASE
  3482.    CASE objtype = c_otpopup
  3483.       * Popups are a special case since the arrow control counts against the width
  3484.       * under Windows.
  3485.       REPLACE WIDTH WITH WIDTH + 2
  3486.    CASE INLIST(objtype,c_otrepvar,c_otrepfld)
  3487.       DO adjrptreset
  3488.       IF fillchar = "N"
  3489.          REPLACE offset WITH 1      && Change alignment for numerics.
  3490.       ENDIF
  3491.    ENDCASE
  3492. CASE !m.g_tographic
  3493.    DO CASE
  3494.    CASE objtype = c_ottext
  3495.       REPLACE HEIGHT WITH MAX(height,1), width WITH MAX(width,1)
  3496.    CASE objtype = c_otspinner
  3497.       * Map spinners to regular fields
  3498.       REPLACE objtype   WITH c_otfield, ;
  3499.          HEIGHT    WITH 1, ;
  3500.          fillchar  WITH "N"
  3501.    CASE objtype = c_otline
  3502.       * Map Windows lines to DOS boxes
  3503.       REPLACE objtype WITH c_otbox
  3504.       REPLACE HEIGHT  WITH MAX(HEIGHT,1), WIDTH WITH MAX(WIDTH,1)
  3505.       IF pensize >= 6
  3506.  
  3507. ***** CGC MYF *****            1994.3.7
  3508. *         REPLACE boxchar WITH "█"
  3509.          REPLACE boxchar WITH "ä"
  3510. ***** CGC MYF *****
  3511.  
  3512.       ENDIF
  3513.    CASE INLIST(objtype,c_otradbut,c_ottxtbut)
  3514.       * Remove the BMP extension from bitmap buttons
  3515.       REPLACE PICTURE WITH STRTRAN(PICTURE,".BMP","")
  3516.       REPLACE PICTURE WITH STRTRAN(PICTURE,".bmp","")
  3517.    CASE objtype = c_otfield AND ;
  3518.          (objcode = 2  OR (INLIST(objcode,0,1) AND WIDTH > 25))
  3519.       * Adjust widths of edit fields and very long GET/SAY fields to account
  3520.       * for font differences between the object and the base font.
  3521.       REPLACE WIDTH WITH MAX(obj2basefont(WIDTH,g_fontface,g_fontsize,g_fontstyle,;
  3522.          fontface,fontsize,whatstyle(fontstyle)),1)
  3523.    CASE objtype = c_otbox AND (objcode = 4)
  3524.       IF pensize >= 6
  3525.  
  3526. ***** CGC MYF *****        1994.3.7.
  3527. *         REPLACE boxchar WITH "█"
  3528.          REPLACE boxchar WITH "ä"
  3529. ***** CGC MYF *****
  3530.  
  3531.       ENDIF
  3532.    CASE INLIST(objtype,c_otrepvar,c_otrepfld)
  3533.       DO adjrptreset
  3534.       IF objtype = c_otrepvar
  3535.          * DOS report variable names have to be in upper case
  3536.          REPLACE name WITH UPPER(name)
  3537.       ENDIF
  3538.    ENDCASE
  3539. ENDCASE
  3540.  
  3541. IF objtype <> c_otbox AND objtype <> c_otline
  3542.    DO adjpen
  3543. ENDIF
  3544.  
  3545. DO adjcolor
  3546. DO adjfont
  3547. IF m.g_filetype = c_screen
  3548.    DO adjheightandwidth
  3549. ENDIF
  3550.  
  3551. *
  3552. * adjrptfloat - Convert float/stretch/relative postion types between
  3553. *      character and graphical positions
  3554. *
  3555. *!*****************************************************************************
  3556. *!
  3557. *!      Procedure: ADJRPTFLOAT
  3558. *!
  3559. *!      Called by: UPDATEREPORT       (procedure in TRANSPRT.PRG)
  3560. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  3561. *!
  3562. *!*****************************************************************************
  3563. PROCEDURE adjrptfloat
  3564. IF m.g_tographic
  3565.    DO CASE
  3566.    CASE FLOAT AND (objtype = c_otbox AND HEIGHT > 1)
  3567.       * Box or a vertical line--float as band stretches translates to Top--stretch w/ band.
  3568.       * Use the height > 1 test because DOS boxes haven't been translated into Windows
  3569.       * lines yet.
  3570.       REPLACE stretchtop WITH .T.
  3571.       REPLACE TOP WITH .F.
  3572.       REPLACE BOTTOM WITH .F.
  3573.    CASE FLOAT AND STRETCH
  3574.       REPLACE stretchtop WITH .T.
  3575.       REPLACE TOP WITH .F.
  3576.       REPLACE BOTTOM WITH .F.
  3577.    CASE FLOAT
  3578.       REPLACE BOTTOM WITH .T.
  3579.       REPLACE TOP WITH .F.
  3580.       REPLACE stretchtop WITH .F.
  3581.    ENDCASE
  3582. ELSE
  3583.    DO CASE
  3584.    CASE objtype = c_otrepfld AND (stretchtop OR STRETCH)
  3585.       REPLACE FLOAT WITH .T.
  3586.       REPLACE STRETCH WITH .T.
  3587.    CASE BOTTOM
  3588.       REPLACE FLOAT WITH .T.
  3589.       REPLACE STRETCH WITH .F.
  3590.    CASE TOP
  3591.       REPLACE FLOAT WITH .F.
  3592.       REPLACE STRETCH WITH .F.
  3593.    CASE stretchtop OR STRETCH
  3594.       REPLACE FLOAT WITH .T.
  3595.       REPLACE STRETCH WITH .F.
  3596.    ENDCASE
  3597. ENDIF
  3598.  
  3599. *
  3600. * adjrptSuppress - Convert Suppression types between 2.5 platforms.
  3601. *
  3602. *!*****************************************************************************
  3603. *!
  3604. *!      Procedure: ADJRPTSUPPRESS
  3605. *!
  3606. *!      Called by: UPDATEREPORT       (procedure in TRANSPRT.PRG)
  3607. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  3608. *!
  3609. *!*****************************************************************************
  3610. PROCEDURE adjrptsuppress
  3611. * Handle suppression of repeated values.
  3612. *
  3613. * In DOS 2.0, the value of the detail record "norepeat" determines whether repeated values
  3614. * are suppressed, if this is a field object, or whether group headings are repeated,
  3615. * if this is a group header.  The main screen header record "norepeat" field determines
  3616. * whether blank lines are suppressed in the detail band.
  3617. *
  3618. * In 2.5, the norepeat field is used just for suppression of blank lines.
  3619. * We are positioned on a detail record now.
  3620. *
  3621. IF m.g_tographic
  3622.    IF objtype = c_otband
  3623.       * The meaning for DOS is reversed from Windows
  3624.       REPLACE norepeat WITH !norepeat
  3625.    ELSE
  3626.       IF norepeat            && suppress repeated values
  3627.          REPLACE supvalchng WITH .T.
  3628.          REPLACE supovflow WITH .F.
  3629.          DO CASE
  3630.          CASE resetrpt = 0
  3631.             REPLACE suprpcol WITH 0
  3632.             REPLACE supgroup WITH 0
  3633.          CASE resetrpt = 1
  3634.             REPLACE suprpcol WITH 3
  3635.             REPLACE supgroup WITH 0
  3636.          OTHERWISE
  3637.             REPLACE suprpcol WITH 0
  3638.             REPLACE supgroup WITH resetrpt+3
  3639.          ENDCASE
  3640.       ELSE                   && no suppression of repeated values
  3641.          REPLACE supalways WITH .T.
  3642.          REPLACE supvalchng WITH .F.
  3643.          REPLACE supovflow WITH .F.
  3644.          REPLACE suprpcol WITH 3
  3645.          REPLACE supgroup WITH 0
  3646.       ENDIF
  3647.    ENDIF
  3648. ELSE
  3649.    IF supvalchng AND !supalways
  3650.       REPLACE norepeat WITH .T.
  3651.       IF supgroup > 0
  3652.          REPLACE resetrpt WITH supgroup - 3
  3653.       ELSE
  3654.          IF suprpcol = 3
  3655.             REPLACE resetrpt WITH 1
  3656.          ELSE
  3657.             REPLACE resetrpt WITH 0
  3658.          ENDIF
  3659.       ENDIF
  3660.    ELSE
  3661.       REPLACE norepeat WITH .F.
  3662.    ENDIF
  3663. ENDIF
  3664.  
  3665. *
  3666. * adjrptreset - Convert the reset values between 2.0 and 2.5.
  3667. *
  3668. *!*****************************************************************************
  3669. *!
  3670. *!      Procedure: ADJRPTRESET
  3671. *!
  3672. *!      Called by: UPDATEREPORT       (procedure in TRANSPRT.PRG)
  3673. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  3674. *!
  3675. *!*****************************************************************************
  3676. PROCEDURE adjrptreset
  3677. IF m.g_tographic
  3678.    DO CASE
  3679.    CASE resettotal = 0
  3680.       REPLACE resettotal WITH 1
  3681.    CASE resettotal = 1
  3682.       REPLACE resettotal WITH 2
  3683.    OTHERWISE
  3684.       REPLACE resettotal WITH resettotal+3
  3685.    ENDCASE
  3686. ELSE
  3687.    DO CASE
  3688.    CASE resettotal = 1
  3689.       REPLACE resettotal WITH 0
  3690.    CASE resettotal = 2 OR resettotal = 3
  3691.       REPLACE resettotal WITH 1
  3692.    OTHERWISE
  3693.       REPLACE resettotal WITH resettotal-3
  3694.    ENDCASE
  3695. ENDIF
  3696.  
  3697. *
  3698. * GetCharSuppress - Gets the global setting of blank line Suppression for a report. (This is
  3699. *      only valid for character mode reports).
  3700. *
  3701. *!*****************************************************************************
  3702. *!
  3703. *!       Function: GETCHARSUPPRESS
  3704. *!
  3705. *!      Called by: IMPORT             (procedure in TRANSPRT.PRG)
  3706. *!
  3707. *!*****************************************************************************
  3708. FUNCTION getcharsuppress
  3709. LOCATE FOR platform = m.g_fromplatform AND objtype = c_otheader
  3710. IF FOUND()
  3711.    RETURN norepeat
  3712. ELSE
  3713.    RETURN .F.
  3714. ENDIF
  3715.  
  3716. *
  3717. * SuppressBlankLines - Looks through the from platform to see if any
  3718. *      object is marked to Suppress blank lines.  If one is, we
  3719. *      make the entire "to" report (which is assumed to be character)
  3720. *      Suppress blank lines.
  3721. *
  3722. *!*****************************************************************************
  3723. *!
  3724. *!      Procedure: SUPPRESSBLANKLINES
  3725. *!
  3726. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3727. *!               : ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3728. *!
  3729. *!          Calls: GETBANDCODE()      (function  in TRANSPRT.PRG)
  3730. *!
  3731. *!*****************************************************************************
  3732. PROCEDURE suppressblanklines
  3733. PRIVATE m.supcount
  3734. DO CASE
  3735. CASE m.g_toplatform = "DOS" OR m.g_toplatform = "UNIX"
  3736.    COUNT TO m.supcount FOR platform = m.g_fromplatform AND objtype = c_otrepfld
  3737.    IF m.supcount > 0
  3738.       LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  3739.       IF FOUND()
  3740.          REPLACE norepeat WITH .T.
  3741.       ENDIF
  3742.    ENDIF
  3743. CASE m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  3744.    * DOS suppression of blank lines only applies to detail lines.  Only mark graphical
  3745.    * objects in the detail band as suppressed.
  3746.    SCAN FOR platform = m.g_toplatform AND objtype <> c_otband AND objtype <> c_otheader
  3747.       myexpr = expr
  3748.       IF objtype = 8
  3749.          WAIT CLEAR
  3750.       ENDIF
  3751.       bcode  = getbandcode(vpos)
  3752.       IF bcode = 4     && detail band
  3753.          REPLACE norepeat WITH m.g_norepeat
  3754.       ELSE
  3755.          REPLACE norepeat WITH .F.
  3756.       ENDIF
  3757.    ENDSCAN
  3758. ENDCASE
  3759.  
  3760. *
  3761. * allGroups - Process all Group records.
  3762. *
  3763. *!*****************************************************************************
  3764. *!
  3765. *!      Procedure: ALLGROUPS
  3766. *!
  3767. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3768. *!               : ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3769. *!
  3770. *!          Calls: UPDTHERM           (procedure in TRANSPRT.PRG)
  3771. *!
  3772. *!*****************************************************************************
  3773. PROCEDURE allgroups
  3774. PARAMETER m.thermpart
  3775. PRIVATE m.recno, m.numothers, m.thermstep
  3776.  
  3777. m.thermstep = m.thermpart / m.objindex
  3778. SELECT (m.g_scrnalias)
  3779.  
  3780. SCAN FOR platform = m.g_fromplatform AND objtype = c_otgroup
  3781.    m.recno = RECNO()
  3782.    
  3783.    SCATTER MEMVAR MEMO
  3784.    APPEND BLANK
  3785.    GATHER MEMVAR MEMO
  3786.    
  3787.    REPLACE platform WITH m.g_toplatform
  3788.    
  3789.    GOTO RECORD m.recno
  3790.    
  3791.    m.g_mercury = m.g_mercury + m.thermstep
  3792.    DO updtherm WITH m.g_mercury
  3793. ENDSCAN
  3794.  
  3795. *
  3796. * RptConvert - Converts entire reports between platforms.
  3797. *
  3798. *!*****************************************************************************
  3799. *!
  3800. *!      Procedure: RPTCONVERT
  3801. *!
  3802. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3803. *!               : ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3804. *!
  3805. *!          Calls: ISREPTOBJECT()     (function  in TRANSPRT.PRG)
  3806. *!               : RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  3807. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  3808. *!               : BANDINFO()         (function  in TRANSPRT.PRG)
  3809. *!               : CLONEBAND          (procedure in TRANSPRT.PRG)
  3810. *!
  3811. *!*****************************************************************************
  3812. PROCEDURE rptconvert
  3813. PRIVATE m.thermstep
  3814.  
  3815. COUNT TO m.thermstep FOR platform = m.g_toplatform AND ;
  3816.    (isreptobject(objtype) OR objtype = c_otband)
  3817.  
  3818. IF m.g_toplatform = "DOS" OR m.g_toplatform = "UNIX"
  3819.    m.thermstep = 25 / m.thermstep
  3820. ELSE
  3821.    m.thermstep = 50 / m.thermstep
  3822. ENDIF
  3823.  
  3824. * We need to do bands before any other object.
  3825. SCAN FOR platform = m.g_toplatform AND objtype = c_otband
  3826.    DO rptobjconvert WITH 0
  3827.    m.g_mercury = m.g_mercury + m.thermstep
  3828.    DO updtherm WITH m.g_mercury
  3829. ENDSCAN
  3830.  
  3831. * We need to know where bands start and where they end in
  3832. * both platforms.
  3833. COUNT TO m.bandcount FOR platform = m.g_toplatform AND objtype = c_otband
  3834. GOTO TOP
  3835.  
  3836. DIMENSION bands[m.bandCount,4]
  3837. m.bandcount = bandinfo()
  3838.  
  3839. * Make sure that the band headers and footers match on Windows
  3840. IF m.g_tographic
  3841.    DO cloneband
  3842. ENDIF
  3843.  
  3844. SCAN FOR platform = m.g_toplatform AND ;
  3845.       (objtype = c_otrepfld OR objtype = c_ottext OR ;
  3846.       objtype = c_otbox OR objtype = c_otline)
  3847.    
  3848.    DO rptobjconvert WITH m.bandcount
  3849.    
  3850.    m.g_mercury = m.g_mercury + m.thermstep
  3851.    DO updtherm WITH m.g_mercury
  3852. ENDSCAN
  3853.  
  3854. *
  3855. * RptObjConvert - Converts the size and postion of a given record in a report/label
  3856. *
  3857. *!*****************************************************************************
  3858. *!
  3859. *!      Procedure: RPTOBJCONVERT
  3860. *!
  3861. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  3862. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  3863. *!               : NEWBANDS           (procedure in TRANSPRT.PRG)
  3864. *!               : RPTCONVERT         (procedure in TRANSPRT.PRG)
  3865. *!
  3866. *!          Calls: EMPTYBAND()        (function  in TRANSPRT.PRG)
  3867. *!               : CVTREPORTVERTICAL()(function  in TRANSPRT.PRG)
  3868. *!               : ADJBOX             (procedure in TRANSPRT.PRG)
  3869. *!               : ADJCOLOR           (procedure in TRANSPRT.PRG)
  3870. *!               : ADJFONT            (procedure in TRANSPRT.PRG)
  3871. *!               : GETBANDINDEX       (procedure in TRANSPRT.PRG)
  3872. *!               : CVTREPORTHORIZONTAL(function  in TRANSPRT.PRG)
  3873. *!               : CVTRPTLINES()      (function  in TRANSPRT.PRG)
  3874. *!               : ADJTEXT            (procedure in TRANSPRT.PRG)
  3875. *!
  3876. *!*****************************************************************************
  3877. PROCEDURE rptobjconvert
  3878. PARAMETER m.bandcount
  3879. PRIVATE m.bandindex, m.endindex, m.posinband, m.saverec, m.objid, m.origvpos, m.lineheight
  3880.  
  3881. IF objtype = c_otband
  3882.    * Map height and width of band to proper values
  3883.    
  3884.    IF m.g_tographic AND emptyband(uniqueid)
  3885.       REPLACE HEIGHT WITH 0
  3886.    ELSE
  3887.       m.lineheight = cvtreportvertical(HEIGHT)
  3888.       IF !m.g_tographic AND BETWEEN(m.lineheight,1.00,1.10) AND objcode = 4
  3889.          * This is a heuristic rule to make quick reports and other reports with 
  3890.          * a single-line detail band transport to DOS correctly.  Sometimes the bands
  3891.          * will be just a little larger than one line in Windows.
  3892.          REPLACE HEIGHT WITH 1
  3893.       ELSE
  3894.          REPLACE HEIGHT WITH CEILING(m.lineheight)
  3895.       ENDIF
  3896.    ENDIF
  3897.    
  3898.    IF m.g_tographic
  3899.       * Map DOS offset field to Windows "if lines less than".  These fields control
  3900.       * when the data grouping decides to start a new page.  This data is stored in "width".
  3901.       REPLACE WIDTH WITH 10000 * offset / c_linesperinch
  3902.    ELSE
  3903.       REPLACE HEIGHT WITH MAX(1, HEIGHT)
  3904.       REPLACE offset WITH ROUND(WIDTH/10000, 0) * c_linesperinch
  3905.    ENDIF
  3906. ELSE
  3907.    * Converting a regular object such as a field or line.
  3908.    m.origvpos   = vpos
  3909.    m.origheight = HEIGHT
  3910.    
  3911.    IF (m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC") AND objtype = c_otbox
  3912.       DO adjbox WITH 0
  3913.       DO adjcolor
  3914.       DO adjfont
  3915.    ENDIF
  3916.    
  3917.    * Find which band in the "from" platform this object came from
  3918.    * Use a vpos expressed in "from" units for this function.
  3919.    m.bandindex = getbandindex(m.origvpos, m.bandcount)
  3920.    
  3921.    * Since keeping objects in the proper bands is our highest
  3922.    * priority, we calculate the new Vpos by determining how many
  3923.    * lines into its band an object lies and adding this
  3924.    * value (converted) to that band's Vpos in the from platform.
  3925.    m.posinband = MAX(cvtreportvertical((vpos - bands[m.bandIndex, c_fmbandvpos])),0)
  3926.    REPLACE vpos WITH bands[m.bandIndex, c_tobandvpos] + m.posinband
  3927.    
  3928.    * Since vertical lines and boxes can stretch across bands, we need to
  3929.    * watch their ending positions.
  3930.    IF (objtype = c_otbox AND cvtreportvertical(HEIGHT) > 1) ;
  3931.          OR (objtype = c_otline AND WIDTH < HEIGHT)
  3932.       m.endindex = getbandindex(IIF(m.g_tographic,m.origvpos+m.origheight-1,;
  3933.          m.origvpos + m.origheight), m.bandcount)
  3934.       IF m.endindex <> m.bandindex
  3935.          *m.endinband = IIF(m.g_tographic, m.origvpos+m.origheight-.25, m.origvpos+m.origheight) ;
  3936.          *   - bands[m.endIndex, c_fmbandvpos]
  3937.          m.endinband = m.origvpos+m.origheight - bands[m.endIndex, c_fmbandvpos]
  3938.          IF m.g_tographic
  3939.             * Allow for the fact that box characters in DOS appear in the middle of
  3940.             * the line, but always stick out into the "end" band a little bit.
  3941.             m.endinband = MAX(m.endinband - 0.5,0.25)
  3942.          ENDIF
  3943.          m.endinband = cvtreportvertical(m.endinband)
  3944.          REPLACE HEIGHT WITH bands[m.endIndex, c_tobandvpos] + m.endinband - vpos
  3945.       ELSE
  3946.          REPLACE HEIGHT WITH cvtreportvertical(HEIGHT)
  3947.       ENDIF
  3948.    ELSE
  3949.       REPLACE HEIGHT WITH cvtreportvertical(HEIGHT)
  3950.    ENDIF
  3951.    
  3952.    REPLACE hpos WITH cvtreporthorizontal(hpos)
  3953.    REPLACE WIDTH WITH cvtreporthorizontal(WIDTH)
  3954.    IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  3955.       IF objtype = c_otline AND WIDTH > HEIGHT
  3956.          * Handle horizontal lines separately.  They are very sensitive to line
  3957.          * height.
  3958.          REPLACE HEIGHT WITH cvtrptlines(HEIGHT)
  3959.       ENDIF
  3960.    ELSE
  3961.       IF objtype = c_otbox AND ROUND(HEIGHT,0) <> 1
  3962.          DO adjbox WITH 0
  3963.       ENDIF
  3964.       
  3965.       REPLACE vpos WITH ROUND(vpos,0)
  3966.       REPLACE hpos WITH ROUND(hpos,0)
  3967.       REPLACE HEIGHT WITH ROUND(HEIGHT,0)
  3968.       REPLACE WIDTH WITH ROUND(WIDTH,0)
  3969.       
  3970.       * Make sure that this object will not extend past the end of the last
  3971.       * band, which leads to "invalid report" errors on DOS.
  3972.       IF m.bandindex = m.bandcount AND ;
  3973.             (vpos + HEIGHT ;
  3974.             > bands[m.bandIndex,c_tobandvpos] ;
  3975.             + bands[m.bandIndex,c_tobandheight])
  3976.          * Can we move the object up so that it fits?
  3977.          IF HEIGHT <= bands[m.bandIndex, c_tobandheight]
  3978.             * It will fit if we scootch it up a little.
  3979.             REPLACE vpos WITH vpos -;
  3980.                (bands[m.bandIndex,c_tobandheight] - HEIGHT)
  3981.          ELSE
  3982.             * No room for it at all.  Crop the height.  Make as much fit as possible.
  3983.             REPLACE vpos   WITH bands[m.bandIndex,c_tobandvpos]
  3984.             REPLACE HEIGHT WITH bands[m.bandIndex,c_tobandheight]
  3985.          ENDIF
  3986.       ENDIF
  3987.       
  3988.       DO CASE
  3989.       CASE objtype = c_ottext
  3990.          REPLACE HEIGHT WITH 1
  3991.          DO adjtext WITH WIDTH
  3992.          REPLACE WIDTH WITH LEN(expr)-2
  3993.          
  3994.       CASE objtype = c_otrepfld AND HEIGHT < 1
  3995.          REPLACE HEIGHT WITH 1
  3996.          
  3997.       ENDCASE
  3998.       IF ROUND(hpos,0) = -1
  3999.          REPLACE hpos WITH 0
  4000.       ENDIF
  4001.    ENDIF
  4002.    
  4003.    * Guarantee that we are in the right band.
  4004.    IF vpos > bands[m.bandIndex,c_tobandvpos] ;
  4005.          + bands[m.bandIndex,c_tobandheight] - 1
  4006.       REPLACE vpos WITH bands[m.bandIndex,c_tobandvpos] ;
  4007.          + bands[m.bandIndex,c_tobandheight] - 1
  4008.    ENDIF
  4009.    
  4010.    IF vpos < 0
  4011.       REPLACE vpos WITH 0
  4012.    ENDIF
  4013. ENDIF
  4014.  
  4015. IF HEIGHT <= 0
  4016.    REPLACE HEIGHT WITH 1
  4017. ENDIF
  4018.  
  4019. RETURN
  4020.  
  4021. *
  4022. * GetBandIndex - Given a Vpos (from platform), this function returns the
  4023. *      index in the Band array of the band which this Vpos lies in.
  4024. *
  4025. *!*****************************************************************************
  4026. *!
  4027. *!      Procedure: GETBANDINDEX
  4028. *!
  4029. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  4030. *!
  4031. *!*****************************************************************************
  4032. PROCEDURE getbandindex
  4033. PARAMETER m.vpos, m.bandcount
  4034. PRIVATE m.loop
  4035. FOR m.loop = 1 TO m.bandcount
  4036.    IF m.vpos >= bands[m.loop,c_fmbandvpos] ;
  4037.          AND m.vpos < bands[m.loop,c_fmbandvpos]+bands[m.loop,c_fmbandheight]
  4038.       RETURN m.loop
  4039.    ENDIF
  4040. ENDFOR
  4041. RETURN m.bandcount    && drop them into the bottom band as a default
  4042.  
  4043. *
  4044. * BandInfo - Fills a predefined array named Band as follows.
  4045. *   bands[1] = Start Position in To platform.
  4046. *   bands[2] = Height in To platform.
  4047. *   bands[3] = Start Position in From platform.
  4048. *   bands[4] = Height in From platform.
  4049. *
  4050. *!*****************************************************************************
  4051. *!
  4052. *!       Function: BANDINFO
  4053. *!
  4054. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  4055. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  4056. *!               : RPTCONVERT         (procedure in TRANSPRT.PRG)
  4057. *!
  4058. *!          Calls: RESIZEBAND         (procedure in TRANSPRT.PRG)
  4059. *!
  4060. *!*****************************************************************************
  4061. FUNCTION bandinfo
  4062. PRIVATE m.saverec, m.bandcount, m.loop, ;
  4063.    m.pagefooter, m.pageheader, m.colheader, m.colfooter, ;
  4064.    m.toposition, m.fromposition, m.objcode, m.expr
  4065.  
  4066. m.toposition   = 0
  4067. m.fromposition = 0
  4068. m.bandcount    = 0
  4069. m.colheader    = 0
  4070. m.colfooter    = 0
  4071. m.pageheader   = 0
  4072. m.pagefooter   = 0
  4073.  
  4074. SCAN FOR platform = m.g_toplatform AND objtype = c_otband
  4075.    m.bandcount = m.bandcount + 1
  4076.    
  4077.    DO CASE
  4078.    CASE objcode = 1
  4079.       m.pageheader = m.bandcount
  4080.    CASE objcode = 2
  4081.       m.colheader  = m.bandcount
  4082.    CASE objcode = 6
  4083.       m.colfooter  = m.bandcount
  4084.    CASE objcode = 7
  4085.       m.pagefooter = m.bandcount
  4086.    ENDCASE
  4087.    
  4088.    * The To fields are already converted at this point
  4089.    bands[m.bandCount,c_tobandvpos] = m.toposition
  4090.    IF m.g_tographic
  4091.       bands[m.bandCount,c_tobandheight] ;
  4092.          = HEIGHT + c_bandheight + (c_bandfudge/c_pixelsize)
  4093.    ELSE
  4094.       bands[m.bandCount,c_tobandheight] = HEIGHT
  4095.    ENDIF
  4096.    
  4097.    
  4098.    m.objcode = objcode
  4099.    m.expr    = expr
  4100.    m.saverec = RECNO()
  4101.    
  4102.    IF !EMPTY(expr)
  4103.       LOCATE FOR platform = m.g_fromplatform AND ;
  4104.          objtype = c_otband AND objcode = m.objcode AND expr = m.expr
  4105.    ELSE
  4106.       * The expression is empty, which means this is probably a group footer.  There could
  4107.       * be many of them, all empty.  We have to find the right one.
  4108.       GOTO TOP
  4109.       * Figure out which occurrence this one is.
  4110.       COUNT TO m.seq FOR platform = m.g_toplatform AND ;
  4111.          objtype = c_otband AND objcode = m.objcode AND EMPTY(expr) ;
  4112.          AND RECNO() <= m.saverec
  4113.       GOTO TOP
  4114.       * Now find the corresponding band in the "from" platform
  4115.       LOCATE FOR platform = m.g_fromplatform AND ;
  4116.          objtype = c_otband AND objcode = m.objcode AND EMPTY(expr)
  4117.       m.i = 1
  4118.       DO WHILE FOUND() AND m.i < m.seq
  4119.          m.i = m.i + 1
  4120.          CONTINUE
  4121.       ENDDO
  4122.    ENDIF
  4123.    IF FOUND()
  4124.       bands[m.bandCount,c_fmbandvpos] = m.fromposition
  4125.       IF m.g_tographic   && so coming from DOS
  4126.          bands[m.bandCount,c_fmbandheight] = HEIGHT
  4127.       ELSE
  4128.          bands[m.bandCount,c_fmbandheight] = HEIGHT + c_bandheight
  4129.       ENDIF
  4130.       
  4131.       m.fromposition = m.fromposition + bands[m.bandCount,c_fmbandheight]
  4132.       
  4133.       IF !g_tographic
  4134.          * Resize 'to' band if necessary to account for boxes that narrowly
  4135.          * surround text on a graphic platform.  Sometimes the box can be
  4136.          * tightly against the text such that the graphical band appears to
  4137.          * be only two rows high.  We need three rows to display the box in
  4138.          * a character platform
  4139.          bands[m.bandCount,c_tobandheight] = ;
  4140.             resizeband(bands[m.bandCount,c_tobandheight], ;
  4141.             bands[m.bandCount,c_fmbandvpos  ], ;
  4142.             bands[m.bandCount,c_fmbandheight])
  4143.       ENDIF
  4144.    ELSE
  4145.       bands[m.bandCount,c_fmbandvpos] = 9999999
  4146.       bands[m.bandCount,c_fmbandheight] = 9999999
  4147.    ENDIF
  4148.    
  4149.    
  4150.    m.toposition = m.toposition + bands[m.bandCount,c_tobandheight]
  4151.    
  4152.    GOTO RECORD (m.saverec)
  4153.    
  4154.    IF !g_tographic
  4155.       * Stuff the newly recomputed height into the DOS record
  4156.       REPLACE HEIGHT WITH bands[m.bandCount,c_tobandheight]
  4157.    ENDIF
  4158.    
  4159. ENDSCAN
  4160.  
  4161. * We don't want to have any column headers/footers in the character
  4162. * products so we need to combine them with the page headers/footers.
  4163. IF m.colfooter > 0 AND m.pagefooter > 0
  4164.    bands[m.pageFooter,c_tobandvpos] = bands[m.colFooter,c_tobandvpos]
  4165.    bands[m.pageFooter,c_tobandheight];
  4166.       = bands[m.pageFooter,c_tobandheight] ;
  4167.       + bands[m.colFooter,c_tobandheight]
  4168.    bands[m.pageFooter,c_fmbandvpos] = bands[m.colFooter,c_fmbandvpos]
  4169.    bands[m.pageFooter,c_fmbandheight] ;
  4170.       = bands[m.pageFooter,c_fmbandheight] ;
  4171.       + bands[m.colFooter,c_fmbandheight]
  4172.    
  4173.    LOCATE FOR platform = m.g_toplatform ;
  4174.       AND objtype = c_otband AND objcode = 6
  4175.    IF FOUND()
  4176.       DELETE
  4177.    ENDIF
  4178.    
  4179.    LOCATE FOR platform = m.g_toplatform ;
  4180.       AND objtype = c_otband AND objcode = 7
  4181.    IF FOUND()
  4182.       REPLACE HEIGHT WITH HEIGHT + bands[m.colFooter,c_tobandheight]
  4183.    ENDIF
  4184.    
  4185.    =ADEL(bands,m.colfooter)
  4186.    m.bandcount = m.bandcount - 1
  4187. ENDIF
  4188.  
  4189. IF m.colheader > 0 AND m.pageheader > 0
  4190.    bands[m.pageHeader,c_tobandheight];
  4191.       = bands[m.pageHeader,c_tobandheight] ;
  4192.       + bands[m.colHeader,c_tobandheight]
  4193.    bands[m.pageHeader,c_fmbandheight] ;
  4194.       = bands[m.pageHeader,c_fmbandheight] ;
  4195.       + bands[m.colHeader,c_fmbandheight]
  4196.    
  4197.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otband AND objcode = 2
  4198.    IF FOUND()
  4199.       DELETE
  4200.    ENDIF
  4201.    
  4202.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otband AND objcode = 1
  4203.    IF FOUND()
  4204.       REPLACE HEIGHT WITH HEIGHT + bands[m.colHeader,c_tobandheight]
  4205.    ENDIF
  4206.    
  4207.    =ADEL(bands,m.colheader)
  4208.    m.bandcount = m.bandcount - 1
  4209. ENDIF
  4210. RETURN m.bandcount
  4211.  
  4212.  
  4213. *!*****************************************************************************
  4214. *!
  4215. *!      Procedure: CLONEBAND
  4216. *!
  4217. *!      Called by: RPTCONVERT         (procedure in TRANSPRT.PRG)
  4218. *!
  4219. *!*****************************************************************************
  4220. PROCEDURE cloneband
  4221. * Copy the band header record data into the respective footer bands.  Data in band header
  4222. * and footer records must match on Windows.  The main data that needs to match is the
  4223. * group expression and things like how many spaces to require after a heading
  4224. * before doing a page break.
  4225. PRIVATE m.in_area, m.in_rec, m.pivot, m.ouniqid, m.ovpos, m.ohpos, m.owidth, m.oheight,;
  4226.    m.oobjcode, m.headband
  4227. IF m.g_tographic
  4228.    m.in_area = SELECT()
  4229.    m.in_rec = RECNO()
  4230.    * First find the detail band.  It acts as a pivot.
  4231.    GOTO TOP
  4232.    LOCATE FOR platform = m.g_toplatform ;
  4233.       AND objtype = c_otband ;
  4234.       AND objcode = 4     && detail band has code = 4
  4235.    IF !FOUND()
  4236.       * Return and make the best of it
  4237.       RETURN
  4238.    ENDIF
  4239.    m.pivot = RECNO()
  4240.    
  4241.    * Scan for each of the header bands
  4242.    SCAN FOR platform = m.g_toplatform ;
  4243.          AND objtype = c_otband ;
  4244.          AND objcode < 4 AND objcode > 0
  4245.       SCATTER MEMVAR MEMO
  4246.       
  4247.       m.headband = RECNO()
  4248.       
  4249.       * Go to the matching footer band record
  4250.       GOTO (m.pivot + (m.pivot - RECNO()))
  4251.       
  4252.       * Store the values we don't want to copy from the header
  4253.       m.ouniqid  = uniqueid
  4254.       m.ovpos    = vpos
  4255.       m.ohpos    = hpos
  4256.       m.oheight  = HEIGHT
  4257.       m.oobjcode = objcode
  4258.       
  4259.       * Stuff header data into this footer band
  4260.       GATHER MEMVAR MEMO
  4261.       
  4262.       * Restore the data we didn't want to copy from the header
  4263.       REPLACE vpos WITH m.ovpos, hpos WITH m.ohpos, ;
  4264.          HEIGHT WITH m.oheight, objcode WITH m.oobjcode, ;
  4265.          uniqueid WITH m.ouniqid
  4266.       
  4267.       GOTO (m.headband)
  4268.       
  4269.    ENDSCAN
  4270.    SELECT (m.in_area)
  4271.    GOTO (MIN(m.in_rec,RECCOUNT()))
  4272. ENDIF
  4273.  
  4274. RETURN
  4275.  
  4276. *
  4277. * RESIZEBAND - Resize the character mode report band to accommodate
  4278. * boxes, etc.
  4279. *
  4280. *!*****************************************************************************
  4281. *!
  4282. *!      Procedure: RESIZEBAND
  4283. *!
  4284. *!      Called by: BANDINFO()         (function  in TRANSPRT.PRG)
  4285. *!
  4286. *!          Calls: CVTREPORTVERTICAL()(function  in TRANSPRT.PRG)
  4287. *!
  4288. *!*****************************************************************************
  4289. PROCEDURE resizeband
  4290. PARAMETER tobandheight, fmbandvpos, fmbandheight
  4291.  
  4292. PRIVATE in_rec, minbandheight
  4293. m.in_rec = RECNO()
  4294. m.minbandheight = m.tobandheight
  4295. IF !g_tographic
  4296.    * Search for boxes that lie entirely within this band.
  4297.    SCAN FOR platform = m.g_fromplatform ;
  4298.          AND objtype = c_otbox AND vpos >= m.fmbandvpos ;
  4299.          AND vpos + HEIGHT <= m.fmbandvpos + m.fmbandheight
  4300.       * The box needs to be expanded
  4301.       m.minbandheight = MAX(m.minbandheight,cvtreportvertical(HEIGHT)+1)
  4302.       * If there is a box in the band, always make it at least three rows
  4303.       m.minbandheight = MAX(m.minbandheight,3)
  4304.    ENDSCAN
  4305. ENDIF
  4306. GOTO RECORD (m.in_rec)
  4307. RETURN CEILING(m.minbandheight)
  4308.  
  4309. *
  4310. * BandHeight - Given a band ID and platform, this function reurns the band's
  4311. *      starting position in that platform.
  4312. *
  4313. *!*****************************************************************************
  4314. *!
  4315. *!       Function: BANDPOS
  4316. *!
  4317. *!      Called by: NEWBANDS           (procedure in TRANSPRT.PRG)
  4318. *!               : EMPTYBAND()        (function  in TRANSPRT.PRG)
  4319. *!
  4320. *!*****************************************************************************
  4321. FUNCTION bandpos
  4322. PARAMETER m.objid, m.platform
  4323. PRIVATE m.saverec, m.bandstart
  4324. m.saverec = RECNO()
  4325. m.bandstart = 0
  4326.  
  4327. SCAN FOR platform = m.platform AND objtype = c_otband
  4328.    IF uniqueid <> m.objid
  4329.       IF m.platform = "DOS" OR m.platform = "UNIX"
  4330.          m.bandstart = m.bandstart + HEIGHT
  4331.       ELSE
  4332.          m.bandstart = m.bandstart + HEIGHT + c_bandheight + (c_bandfudge/c_pixelsize)
  4333.       ENDIF
  4334.    ELSE
  4335.       LOCATE FOR .F.
  4336.    ENDIF
  4337. ENDSCAN
  4338.  
  4339. GOTO RECORD (m.saverec)
  4340. RETURN m.bandstart
  4341.  
  4342. *
  4343. * EmptyBand - Given a band ID, this funtion determines if the band is empty.
  4344. *
  4345. *!*****************************************************************************
  4346. *!
  4347. *!       Function: EMPTYBAND
  4348. *!
  4349. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  4350. *!
  4351. *!          Calls: BANDPOS()          (function  in TRANSPRT.PRG)
  4352. *!
  4353. *!*****************************************************************************
  4354. FUNCTION emptyband
  4355. PARAMETER m.id
  4356. PRIVATE m.saverec, m.bandstart, m.bandheight, m.retval
  4357. IF m.g_toplatform = "DOS" OR m.g_toplatform = "UNIX"
  4358.    RETURN .F.
  4359. ENDIF
  4360.  
  4361. m.saverec = RECNO()
  4362. m.retval = .F.
  4363.  
  4364. LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.id
  4365. IF FOUND()
  4366.    m.bandheight = HEIGHT
  4367.    m.bandstart = bandpos(m.id, m.g_fromplatform)
  4368.    * Look for objects in this band
  4369.    LOCATE FOR platform = m.g_fromplatform AND ;
  4370.       (objtype = c_otline OR objtype = c_otbox OR ;
  4371.       objtype = c_ottext OR objtype = c_otrepfld) AND ;
  4372.       vpos >= m.bandstart AND vpos < m.bandstart + m.bandheight
  4373.    IF !FOUND() AND m.g_tographic
  4374.       * Look for a DOS box or line that ends in the band
  4375.       GOTO TOP
  4376.       LOCATE FOR platform = m.g_fromplatform AND ;
  4377.          INLIST(objtype,c_otbox, c_otline) AND ;
  4378.          vpos + HEIGHT - 1 >= m.bandstart AND vpos + HEIGHT - 1 < m.bandstart + m.bandheight
  4379.    ENDIF
  4380.    m.retval = !FOUND()
  4381. ENDIF
  4382.  
  4383. GOTO RECORD (m.saverec)
  4384. RETURN m.retval
  4385.  
  4386. *
  4387. * GETBANDCODE - returns band objcode given a vpos
  4388. *
  4389. *!*****************************************************************************
  4390. *!
  4391. *!       Function: GETBANDCODE
  4392. *!
  4393. *!      Called by: SUPPRESSBLANKLINES (procedure in TRANSPRT.PRG)
  4394. *!
  4395. *!*****************************************************************************
  4396. FUNCTION getbandcode
  4397. PARAMETER m.thisvpos
  4398. PRIVATE m.in_num, m.retcode
  4399. retcode = -1
  4400. m.in_num = RECNO()
  4401. m.startvpos = 0
  4402.  
  4403. IF INLIST(objtype,c_otheader, c_otband, c_otrel, c_otworkar, c_otindex)
  4404.    RETURN -1
  4405. ENDIF
  4406.  
  4407. SET FILTER TO platform = m.g_toplatform AND (objtype = c_otband)
  4408. GOTO TOP
  4409. DO WHILE m.startvpos <= m.thisvpos AND !EOF()
  4410.    IF m.startvpos + HEIGHT +c_bandheight > m.thisvpos
  4411.       retcode = objcode
  4412.       EXIT
  4413.    ELSE
  4414.       m.startvpos = m.startvpos + HEIGHT + c_bandheight
  4415.       SKIP
  4416.    ENDIF
  4417. ENDDO
  4418. SET FILTER TO
  4419. GOTO m.in_num
  4420. RETURN retcode
  4421.  
  4422. *
  4423. * CvtReportVertical - Convert report vertical dimensions between 10000ths of an inch and characters
  4424. *      depending on the to platform.  (This function is for vertical dimensions only).
  4425. *
  4426. *!*****************************************************************************
  4427. *!
  4428. *!       Function: CVTREPORTVERTICAL
  4429. *!
  4430. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  4431. *!               : RESIZEBAND         (procedure in TRANSPRT.PRG)
  4432. *!
  4433. *!*****************************************************************************
  4434. FUNCTION cvtreportvertical
  4435. PARAMETER m.units
  4436. DO CASE
  4437. CASE !m.g_tographic
  4438.    RETURN m.units/10000 * c_linesperinch
  4439. CASE g_tographic
  4440.    RETURN (m.units * m.g_rptlinesize) + (5000/c_pixelsize)
  4441. OTHERWISE
  4442.    RETURN m.units
  4443. ENDCASE
  4444.  
  4445. *
  4446. * CvtReportWidth - Convert report horizontal dimensions between 10000ths of an inch
  4447. *      and chanracters depending on the to platform.
  4448. *
  4449. *!*****************************************************************************
  4450. *!
  4451. *!       Function: CVTREPORTHORIZONTAL
  4452. *!
  4453. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  4454. *!
  4455. *!*****************************************************************************
  4456. FUNCTION cvtreporthorizontal
  4457. PARAMETER m.units
  4458. DO CASE
  4459. CASE !m.g_tographic
  4460.    RETURN m.units/10000 * c_charsperinch
  4461. CASE m.g_tographic
  4462.    RETURN m.units * m.g_rptcharsize
  4463. OTHERWISE
  4464.    RETURN m.units
  4465. ENDCASE
  4466. *!*****************************************************************************
  4467. *!
  4468. *!       Function: CVTRPTLINES
  4469. *!
  4470. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  4471. *!
  4472. *!*****************************************************************************
  4473. FUNCTION cvtrptlines
  4474. * Adjust the height of horizontal lines
  4475. PARAMETER m.height
  4476. DO CASE
  4477. CASE g_tographic
  4478.    DO CASE
  4479.    CASE BETWEEN(m.height,0,200)
  4480.       RETURN 104
  4481.    CASE BETWEEN(m.height,200,600)
  4482.       RETURN 520
  4483.    CASE BETWEEN(m.height,600,850)
  4484.       RETURN 850
  4485.    OTHERWISE
  4486.       RETURN m.height
  4487.    ENDCASE
  4488. OTHERWISE
  4489.    RETURN m.height
  4490. ENDCASE
  4491.  
  4492. *
  4493. * MergeLabelObjects - Combines report objects which lie on the same line
  4494. *      when going from a graphical platform to a character platform.
  4495. *
  4496. *!*****************************************************************************
  4497. *!
  4498. *!      Procedure: MERGELABELOBJECTS
  4499. *!
  4500. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  4501. *!
  4502. *!          Calls: LABELOBJMERGE      (procedure in TRANSPRT.PRG)
  4503. *!
  4504. *!        Indexes: TEMP                   (tag)
  4505. *!
  4506. *!*****************************************************************************
  4507. PROCEDURE mergelabelobjects
  4508. INDEX ON platform+STR(vpos,3)+STR(hpos,3) TAG temp
  4509.  
  4510. SCAN FOR platform = m.g_toplatform AND !DELETED() AND ;
  4511.       (objtype = c_otrepfld OR objtype = c_ottext OR objtype = c_otbox OR objtype = c_otline)
  4512.    DO labelobjmerge WITH RECNO()
  4513. ENDSCAN
  4514.  
  4515. DELETE TAG temp
  4516. RETURN
  4517.  
  4518. *
  4519. * LabelObjMerge - Given a record which is a report object, this function tries to find a label
  4520. *      object on the same line and combine them.  If no label object exists on the line, the
  4521. *      record is turned into one.
  4522. *
  4523. *!*****************************************************************************
  4524. *!
  4525. *!      Procedure: LABELOBJMERGE
  4526. *!
  4527. *!      Called by: MERGELABELOBJECTS  (procedure in TRANSPRT.PRG)
  4528. *!
  4529. *!*****************************************************************************
  4530. PROCEDURE labelobjmerge
  4531. PARAMETER m.recno
  4532. PRIVATE m.saverec, m.vpos, m.hpos, m.width, m.height, m.expr, m.type, m.picture
  4533.  
  4534. m.saverec = RECNO()
  4535. GOTO RECORD (m.recno)
  4536.  
  4537. m.vpos = vpos
  4538. m.width = WIDTH
  4539. m.expr = expr
  4540. m.type = fillchar
  4541. m.picture = PICTURE
  4542. DELETE
  4543.  
  4544. LOCATE FOR platform = m.g_toplatform AND !DELETED() AND ;
  4545.    objtype = c_ot20lbxobj AND vpos = m.vpos
  4546. IF FOUND()
  4547.    REPLACE expr WITH expr + "," + m.expr
  4548. ELSE
  4549.    GOTO RECORD (m.recno)
  4550.    RECALL
  4551.    REPLACE objtype WITH c_ot20lbxobj
  4552. ENDIF
  4553.  
  4554. GOTO RECORD (m.saverec)
  4555.  
  4556. *
  4557. * AddLabelBlanks - Adds sufficient blank lines to make the converted lines
  4558. *
  4559. *!*****************************************************************************
  4560. *!
  4561. *!      Procedure: ADDLABELBLANKS
  4562. *!
  4563. *!           Uses: M.G_SCRNALIAS      
  4564. *!
  4565. *!*****************************************************************************
  4566. PROCEDURE addlabelblanks
  4567. PRIVATE m.linecount, m.last, m.scanloop
  4568. SELECT vpos FROM m.g_scrnalias ;
  4569.    WHERE !DELETED() AND platform = m.g_toplatform AND objtype = c_ot20lbxobj ;
  4570.    ORDER BY vpos ;
  4571.    INTO ARRAY lines
  4572.  
  4573. m.linecount = _TALLY
  4574. m.last = 0
  4575. FOR m.scanloop = 1 TO lines[m.linecount]
  4576.    IF ASCAN(lines, m.scanloop) = 0
  4577.       APPEND BLANK
  4578.       REPLACE platform WITH m.g_toplatform
  4579.       REPLACE objtype WITH c_ot20lbxobj
  4580.       REPLACE vpos WITH m.lines
  4581.    ENDIF
  4582. ENDFOR
  4583. RETURN
  4584.  
  4585. *
  4586. * LinesBetween - Removes all the whitespace from the bottom of the detail
  4587. *      band and puts it in lines between.
  4588. *
  4589. *!*****************************************************************************
  4590. *!
  4591. *!      Procedure: LINESBETWEEN
  4592. *!
  4593. *!      Called by: ALLGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  4594. *!
  4595. *!*****************************************************************************
  4596. PROCEDURE linesbetween
  4597. PRIVATE m.linecount, m.blanklines
  4598. COUNT TO m.linecount FOR platform = m.g_toplatform AND objtype = c_ot20lbxobj
  4599.  
  4600. LOCATE FOR platform = m.g_toplatform AND objtype = c_otband AND objcode = 4
  4601. IF FOUND() AND m.linecount < HEIGHT
  4602.    m.blanklines = HEIGHT - m.linecount
  4603.    REPLACE HEIGHT WITH m.linecount
  4604.    LOCATE FOR platform = m.g_toplatform AND objtype = c_ot20label
  4605.    IF FOUND()
  4606.       REPLACE penblue WITH m.blanklines
  4607.    ENDIF
  4608. ENDIF
  4609.  
  4610. *
  4611. * labelBands - Adds the group records needed by a graphical label
  4612. *
  4613. *!*****************************************************************************
  4614. *!
  4615. *!      Procedure: LABELBANDS
  4616. *!
  4617. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  4618. *!
  4619. *!*****************************************************************************
  4620. PROCEDURE labelbands
  4621. PRIVATE m.lbxheight, m.lbxwidth, m.lbxlinesbet
  4622.  
  4623. LOCATE FOR platform = m.g_fromplatform AND objtype = c_otband AND objcode = 4
  4624. IF FOUND()
  4625.    m.lbxheight = HEIGHT
  4626. ENDIF
  4627.  
  4628. LOCATE FOR platform = m.g_fromplatform AND objtype = c_ot20label
  4629. IF FOUND()
  4630.    DO CASE
  4631.    CASE name = '3 1/2" x 15/16" x 1' AND penblue = 1 AND ;
  4632.          WIDTH = 35 AND m.lbxheight = 5 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4633.       m.lbxheight = (15/16) * 10000
  4634.       m.lbxwidth = -1
  4635.       m.lbxlinesbet = m.lbxheight / 5
  4636.       
  4637.    CASE name = '3 1/2" x 15/16" x 2' AND penblue = 1 AND ;
  4638.          WIDTH = 35 AND m.lbxheight = 5 AND vpos = 2 AND hpos = 0 AND HEIGHT = 2
  4639.       m.lbxheight = (15/16) * 10000
  4640.       m.lbxwidth = (3 + (1/2)) * 10000
  4641.       m.lbxlinesbet = m.lbxheight / 5
  4642.       
  4643.    CASE name = '3 1/2" x 15/16" x 3' AND penblue = 1 AND ;
  4644.          WIDTH = 35 AND m.lbxheight = 5 AND vpos = 3 AND hpos = 0 AND HEIGHT = 2
  4645.       m.lbxheight = (15/16) * 10000
  4646.       m.lbxwidth = (3 + (1/2)) * 10000
  4647.       m.lbxlinesbet = m.lbxheight / 5
  4648.       
  4649.    CASE name = '3 2/10" x 11/12" x 3 (Cheshire)' AND penblue = 1 AND ;
  4650.          WIDTH = 32 AND m.lbxheight = 5 AND vpos = 3 AND hpos = 0 AND HEIGHT = 2
  4651.       m.lbxheight = (11/12) * 10000
  4652.       m.lbxwidth = (3 + (2/10)) * 10000
  4653.       m.lbxlinesbet = m.lbxheight / 5
  4654.       
  4655.    CASE name = '3" x 5 Rolodex' AND penblue = 4 AND ;
  4656.          WIDTH = 50 AND m.lbxheight = 14 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4657.       m.lbxheight = 5 * 10000
  4658.       m.lbxwidth = -1
  4659.       m.lbxlinesbet = 4 * (m.lbxheight / 14)
  4660.       
  4661.    CASE name = '4" x 1 7/16" x 1' AND penblue = 1 AND ;
  4662.          WIDTH = 40 AND m.lbxheight = 8 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4663.       m.lbxheight = (1 + (7/16)) * 10000
  4664.       m.lbxwidth = -1
  4665.       m.lbxlinesbet = m.lbxheight / 8
  4666.       
  4667.    CASE name = '4" x 2 1/4 Rolodex' AND penblue = 1 AND ;
  4668.          WIDTH = 40 AND m.lbxheight = 10 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4669.       m.lbxheight = (2 + (1/4)) * 10000
  4670.       m.lbxwidth = -1
  4671.       m.lbxlinesbet = m.lbxheight / 10
  4672.       
  4673.    CASE name = '6 1/2" x 3 5/8 Envelope' AND penblue = 8 AND ;
  4674.          WIDTH = 65 AND m.lbxheight = 14 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4675.       m.lbxheight = (3 + (5/8)) * 10000
  4676.       m.lbxwidth = -1
  4677.       m.lbxlinesbet = 8 * (m.lbxheight / 14)
  4678.       
  4679.    CASE name = '9 7/8" x 7 1/8 Envelope' AND penblue = 8 AND ;
  4680.          WIDTH = 78 AND m.lbxheight = 17 AND vpos = 1 AND hpos = 0 AND HEIGHT = 0
  4681.       m.lbxheight = (7 + (1/8)) * 10000
  4682.       m.lbxwidth = -1
  4683.       m.lbxlinesbet = 8 * (m.lbxheight / 17)
  4684.       
  4685.    OTHERWISE
  4686.       m.lbxheight = m.lbxheight * m.g_rptlinesize
  4687.       m.lbxwidth = IIF(vpos > 1, WIDTH * m.g_rptcharsize, -1)
  4688.       m.lbxlinesbet = penblue * m.g_rptlinesize
  4689.    ENDCASE
  4690. ELSE
  4691.    RETURN
  4692. ENDIF
  4693.  
  4694. LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  4695. IF FOUND()
  4696.    REPLACE vpos WITH IIF(vpos > 1, vpos * m.g_rptlinesize, 1)
  4697.    REPLACE WIDTH WITH m.lbxwidth
  4698.    REPLACE hpos WITH hpos * m.g_rptcharsize      && Left margin
  4699.    REPLACE HEIGHT WITH HEIGHT * m.g_rptcharsize   && Spaces Between Columns
  4700. ENDIF
  4701.  
  4702. LOCATE FOR platform = m.g_toplatform AND objtype = c_otband AND objcode = 4
  4703. IF FOUND()
  4704.    REPLACE HEIGHT WITH m.lbxheight + m.lbxlinesbet
  4705. ENDIF
  4706.  
  4707. *
  4708. * labelLines - Converts the character style label objects to graphical report objects
  4709. *
  4710. *!*****************************************************************************
  4711. *!
  4712. *!      Procedure: LABELLINES
  4713. *!
  4714. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  4715. *!
  4716. *!          Calls: ADJFONT            (procedure in TRANSPRT.PRG)
  4717. *!               : ADJCOLOR           (procedure in TRANSPRT.PRG)
  4718. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  4719. *!
  4720. *!*****************************************************************************
  4721. PROCEDURE labellines
  4722. PRIVATE m.bandstart, m.linecount, m.thermstep, m.lbxwidth, ;
  4723.    m.saverec, m.nextexpr, m.loop
  4724.  
  4725. COUNT TO m.thermstep FOR platform = m.g_toplatform AND objtype = c_ot20lbxobj
  4726. m.thermstep = 45 / m.thermstep
  4727. m.bandstart = 4166.667
  4728.  
  4729. LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  4730. IF WIDTH != -1
  4731.    m.lbxwidth = WIDTH
  4732. ELSE
  4733.    LOCATE FOR platform = m.g_fromplatform AND objtype = c_ot20label
  4734.    m.lbxwidth = WIDTH * m.g_rptcharsize
  4735. ENDIF
  4736.  
  4737. m.linecount = 0
  4738.  
  4739. SCAN FOR platform = m.g_toplatform AND objtype = c_ot20lbxobj AND !DELETED()
  4740.    REPLACE expr WITH ALLTRIM(expr)
  4741.    REPLACE objtype WITH c_otrepfld
  4742.    REPLACE objcode WITH 0
  4743.    REPLACE vpos WITH m.bandstart + (m.linecount * m.g_rptlinesize)
  4744.    REPLACE hpos WITH 0
  4745.    REPLACE HEIGHT WITH m.g_rptlinesize
  4746.    REPLACE WIDTH WITH m.lbxwidth
  4747.    REPLACE fillchar WITH "C"
  4748.    REPLACE FLOAT WITH .F.
  4749.    REPLACE STRETCH WITH .F.
  4750.    REPLACE spacing WITH 12
  4751.    REPLACE offset WITH 0
  4752.    REPLACE totaltype WITH 0
  4753.    REPLACE TOP WITH .T.
  4754.    REPLACE resettotal WITH 1
  4755.    REPLACE supalways WITH .T.
  4756.    REPLACE supovflow WITH .F.
  4757.    REPLACE suprpcol WITH 3
  4758.    REPLACE supgroup WITH 0
  4759.    REPLACE supvalchng WITH .F.
  4760.    
  4761.    DO adjfont
  4762.    DO adjcolor
  4763.    
  4764.    m.loop = (RIGHT(expr,1) = ";")
  4765.    DO WHILE m.loop
  4766.       m.saverec = RECNO()
  4767.       SKIP
  4768.       DO WHILE platform = m.g_toplatform AND objtype = c_ot20lbxobj AND DELETED()
  4769.          SKIP
  4770.       ENDDO
  4771.       IF platform = m.g_toplatform AND objtype = c_ot20lbxobj
  4772.          DELETE
  4773.          m.nextexpr = expr
  4774.          GOTO RECORD (m.saverec)
  4775.          REPLACE expr WITH expr + m.nextexpr
  4776.          REPLACE HEIGHT WITH HEIGHT + m.g_rptlinesize
  4777.          m.loop = (RIGHT(expr,1) = ";")
  4778.       ELSE
  4779.          GOTO RECORD (m.saverec)
  4780.          m.loop = .F.
  4781.       ENDIF
  4782.    ENDDO
  4783.    
  4784.    m.linecount = m.linecount + 1
  4785.    
  4786.    m.g_mercury = m.g_mercury + m.thermstep
  4787.    DO updtherm WITH m.g_mercury
  4788. ENDSCAN
  4789.  
  4790. *
  4791. * calcpositions - Calculate each objects position as a percentage across
  4792. *            and down the window.
  4793. *
  4794. *!*****************************************************************************
  4795. *!
  4796. *!      Procedure: CALCPOSITIONS
  4797. *!
  4798. *!      Called by: ALLOTHERS          (procedure in TRANSPRT.PRG)
  4799. *!
  4800. *!*****************************************************************************
  4801. PROCEDURE calcpositions
  4802. PARAMETER m.index
  4803. PRIVATE m.record, m.vert, m.horiz, m.width, m.numothers, m.thermstep, m.i
  4804. *
  4805. * Search for the original platform records and establish the horizontal
  4806. * and vertical positioning percentages.
  4807. *
  4808.  
  4809. objectpos[m.index, 1] = hpos / m.g_windwidth
  4810. objectpos[m.index, 2] = vpos / m.g_windheight
  4811. objectpos[m.index, 3] = uniqueid
  4812. objectpos[m.index, 4] = objtype
  4813. objectpos[m.index, 5] = .F.                && right aligned with object above or below?
  4814. objectpos[m.index, 6] = hpos
  4815. objectpos[m.index, 7] = WIDTH
  4816. objectpos[m.index, 8] = spacing
  4817. objectpos[m.index, 9] = PICTURE
  4818.  
  4819. IF objtype = c_ottext
  4820.    m.record = RECNO()
  4821.    m.vert1 = vpos
  4822.    m.horiz = hpos
  4823.    m.endpos = hpos + WIDTH
  4824.    
  4825.    LOCATE FOR objtype = c_ottext AND hpos != m.horiz AND ;
  4826.       m.vert1 - 1 = vpos AND hpos + WIDTH = m.endpos
  4827.    IF FOUND()
  4828.       objectpos[m.index,5] = .T.
  4829.       DO WHILE FOUND()
  4830.          IF objectpos[m.index, 7] < WIDTH
  4831.             objectpos[m.index, 7] = WIDTH
  4832.          ENDIF
  4833.          m.vert = vpos
  4834.          LOCATE FOR objtype = c_ottext AND hpos != m.horiz AND ;
  4835.             m.vert - 1 = vpos AND hpos + WIDTH = m.endpos
  4836.       ENDDO
  4837.    ENDIF
  4838.    LOCATE FOR objtype = c_ottext AND hpos != m.horiz AND ;
  4839.       m.vert1 + 1 = vpos AND hpos + WIDTH = m.endpos
  4840.    
  4841.    IF FOUND()
  4842.       objectpos[m.index,5] = .T.
  4843.       DO WHILE FOUND()
  4844.          IF objectpos[m.index, 7] < WIDTH
  4845.             objectpos[m.index, 7] = WIDTH
  4846.          ENDIF
  4847.          m.vert = vpos
  4848.          LOCATE FOR objtype = c_ottext AND hpos != m.horiz AND ;
  4849.             m.vert + 1 = vpos AND hpos + WIDTH = m.endpos
  4850.       ENDDO
  4851.    ENDIF
  4852.    
  4853.    GOTO RECORD m.record
  4854.    IF objectpos[m.index, 5]
  4855.       objectpos[m.index, 6] = hpos + WIDTH - 1
  4856.       objectpos[m.index, 1] = (hpos + WIDTH) / m.g_windwidth
  4857.    ENDIF
  4858.    
  4859. ENDIF
  4860.  
  4861. *
  4862. * calcwindowdimensions - Calculate the needed Height and Width for the new window
  4863. *
  4864. *!*****************************************************************************
  4865. *!
  4866. *!      Procedure: CALCWINDOWDIMENSIONS
  4867. *!
  4868. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  4869. *!
  4870. *!          Calls: FINDWIDEROBJECTS   (procedure in TRANSPRT.PRG)
  4871. *!               : HORIZBUTTON()      (function  in TRANSPRT.PRG)
  4872. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  4873. *!               : REPOOBJECTS        (procedure in TRANSPRT.PRG)
  4874. *!
  4875. *!        Indexes: UNIQUEID               (tag)
  4876. *!
  4877. *!*****************************************************************************
  4878. PROCEDURE calcwindowdimensions
  4879. PRIVATE m.i, m.curline, m.largestobj, m.lineheight, m.adjwindowwidth, m.thermstep
  4880.  
  4881. INDEX ON uniqueid + platform TAG uniqueid OF (m.g_tempindex) ADDITIVE
  4882.  
  4883. SELECT (m.g_fromobjonlyalias)
  4884. SET RELATION OFF INTO (m.g_scrnalias)
  4885. SET RELATION TO uniqueid+m.g_toplatform INTO (m.g_scrnalias) ADDITIVE
  4886. SELECT (m.g_scrnalias)
  4887.  
  4888. m.adjwindwidth = 0
  4889. DO findwiderobjects WITH m.adjwindwidth
  4890.  
  4891. =ASORT(objectpos,2)
  4892. STORE 0 TO m.curline, m.largestobj, m.lineheight, m.adjheight
  4893. m.thermstep = 10 / m.objindex
  4894.  
  4895. FOR m.i = 1 TO m.objindex
  4896.    
  4897.    IF objectpos[m.i,2] != m.curline
  4898.       m.adjheight = m.adjheight + m.lineheight
  4899.       STORE 0 TO m.lineheight, m.largestobj
  4900.       m.curline = objectpos[m.i,2]
  4901.    ENDIF
  4902.    
  4903.    IF m.largestobj != 3
  4904.       DO CASE
  4905.       CASE objectpos[m.i, 4] = c_ottxtbut AND m.largestobj < 3
  4906.          IF !horizbutton(objectpos[m.i, 9])
  4907.             m.numitems = OCCURS(';',objectpos[m.i, 9]) + 1
  4908.             m.lineheight = c_adjtbtn * m.numitems
  4909.          ELSE
  4910.             m.lineheight = c_adjtbtn
  4911.          ENDIF
  4912.          m.largestobj = 3
  4913.          
  4914.       CASE (objectpos[m.i, 4] = c_otradbut AND m.largestobj < 2) ;
  4915.             OR (objectpos[m.i, 4] = c_otchkbox AND m.largestobj < 2)
  4916.          IF objectpos[m.i, 4] = c_otradbut AND !horizbutton(objectpos[m.i, 9])
  4917.             m.numitems = OCCURS(';',objectpos[m.i, 9]) + 1
  4918.             m.lineheight = c_adjrbtn * m.numitems
  4919.          ELSE
  4920.             m.lineheight = c_adjrbtn
  4921.          ENDIF
  4922.          m.largestobj = 2
  4923.          
  4924.       CASE (objectpos[m.i, 4] = c_otlist AND m.largestobj < 1) ;
  4925.             OR (objectpos[m.i, 4] = c_otfield AND m.largestobj < 1)
  4926.          m.lineheight = c_adjlist
  4927.          m.largestobj = 1
  4928.          
  4929.       ENDCASE
  4930.    ENDIF
  4931.    m.g_mercury = m.g_mercury + m.thermstep
  4932.    DO updtherm WITH m.g_mercury
  4933.    
  4934. ENDFOR
  4935. m.adjheight = m.adjheight + m.lineheight
  4936. LOCATE FOR platform = m.g_toplatform AND objtype = 1
  4937. IF FOUND()
  4938.    REPLACE WIDTH WITH WIDTH + m.adjwindwidth
  4939.    DO repoobjects WITH HEIGHT + m.adjheight
  4940. ENDIF
  4941.  
  4942. RETURN
  4943.  
  4944. *
  4945. * findWiderObjects - Find objects which have changed in size
  4946. *
  4947. *!*****************************************************************************
  4948. *!
  4949. *!      Procedure: FINDWIDEROBJECTS
  4950. *!
  4951. *!      Called by: CALCWINDOWDIMENSION(procedure in TRANSPRT.PRG)
  4952. *!
  4953. *!          Calls: HORIZBUTTON()      (function  in TRANSPRT.PRG)
  4954. *!               : SGN()              (function  in TRANSPRT.PRG)
  4955. *!               : ADJHPOS            (procedure in TRANSPRT.PRG)
  4956. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  4957. *!
  4958. *!*****************************************************************************
  4959. PROCEDURE findwiderobjects
  4960. PARAMETER m.adjwindowwidth
  4961. PRIVATE m.curcol, m.adjcol, m.i, m.rightalignflag, m.numitems, ;
  4962.    m.olduniqueid, m.oldwidth, m.buttonflag, m.newwidth, m.adjust, m.thermstep
  4963.  
  4964. m.thermstep = 10 / m.objindex
  4965.  
  4966. =ASORT(objectpos,6)   && sort on hpos
  4967. STORE 0 TO m.curcol, m.adjcol
  4968. m.rightalignflag = .F.
  4969.  
  4970. FOR m.i = 1 TO m.objindex
  4971.    * Start at the leftmost object
  4972.    IF objectpos[m.i,6] != m.curcol
  4973.       m.adjcol = 0
  4974.       m.rightalignflag = .F.
  4975.       m.curcol = objectpos[m.i,6]
  4976.    ENDIF
  4977.    
  4978.    DO CASE
  4979.    CASE objectpos[m.i, 4] = c_ottxtbut OR objectpos[m.i, 4] = c_otradbut
  4980.       * Count the objects in push buttons and radio buttons
  4981.       m.numitems = OCCURS(';',objectpos[m.i, 9]) + 1
  4982.       m.olduniqueid = objectpos[m.i, 3]
  4983.       
  4984.       IF horizbutton(objectpos[m.i, 9])
  4985.          m.oldwidth = (objectpos[m.i, 7] * m.numitems) + ;
  4986.             (objectpos[m.i, 8] * (m.numitems - 1))
  4987.          m.buttonflag = .T.
  4988.       ELSE
  4989.          m.buttonflag = .F.
  4990.          m.oldwidth = objectpos[m.i, 7]
  4991.       ENDIF
  4992.       
  4993.    OTHERWISE
  4994.       m.buttonflag = .F.
  4995.       m.oldwidth = objectpos[m.i, 7]
  4996.       m.olduniqueid = objectpos[m.i, 3]
  4997.       
  4998.    ENDCASE
  4999.    
  5000.    LOCATE FOR uniqueid = m.olduniqueid AND platform = m.g_toplatform
  5001.    IF FOUND()
  5002.       IF m.buttonflag
  5003.          m.newwidth = (WIDTH * m.numitems) + ;
  5004.             (spacing * (m.numitems - 1))
  5005.       ELSE
  5006.          m.newwidth = WIDTH
  5007.       ENDIF
  5008.       IF m.oldwidth != m.newwidth AND ;
  5009.             !(objtype = c_ottext ;
  5010.             AND ASC(SUBSTR(expr,2,1))>=179 ;
  5011.             AND ASC(SUBSTR(expr,2,1))<=218)
  5012.          m.adjust = m.newwidth - m.oldwidth
  5013.          IF ABS(m.adjust) > ABS(m.adjcol) OR sgn(m.adjust) <> sgn(m.adjcol)
  5014.             IF (!objectpos[m.i,5] OR !m.rightalignflag) AND m.adjust > 0
  5015.                * Move everything over
  5016.                DO adjhpos WITH m.adjust - m.adjcol, ;
  5017.                   IIF(objectpos[m.i,5], objectpos[m.i, 6], ;
  5018.                   objectpos[m.i, 6] + objectpos[m.i, 7] - 1)
  5019.                
  5020.                * Expand the window
  5021.                m.adjwindowwidth = m.adjwindowwidth + m.adjust - m.adjcol
  5022.                
  5023.                * AdjCol contains the cumulative adjustment
  5024.                m.adjcol = m.adjust
  5025.                
  5026.                IF objectpos[m.i, 5]
  5027.                   m.rightalignflag = .T.
  5028.                   REPLACE hpos WITH hpos + m.adjust - m.adjcol
  5029.                ENDIF
  5030.             ENDIF
  5031.          ENDIF
  5032.       ENDIF
  5033.    ENDIF
  5034.    m.g_mercury = m.g_mercury + m.thermstep
  5035.    DO updtherm WITH m.g_mercury
  5036. ENDFOR
  5037.  
  5038. *
  5039. * adjHpos - Adjust the horizontal position of objects across as other objects
  5040. *       become bigger or smaller.
  5041. *
  5042. *!*****************************************************************************
  5043. *!
  5044. *!      Procedure: ADJHPOS
  5045. *!
  5046. *!      Called by: FINDWIDEROBJECTS   (procedure in TRANSPRT.PRG)
  5047. *!
  5048. *!*****************************************************************************
  5049. PROCEDURE adjhpos
  5050. PARAMETER m.adjustment, m.position
  5051.  
  5052. SELECT (m.g_fromobjonlyalias)
  5053. SCAN FOR platform = m.g_fromplatform AND hpos >= m.position
  5054.    REPLACE &g_scrnalias..hpos WITH &g_scrnalias..hpos + m.adjustment
  5055. ENDSCAN
  5056.  
  5057. * Stretch lines that begin before the wider object and end after it starts.
  5058. SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND HEIGHT = 1 AND ;
  5059.       hpos < m.position AND hpos + WIDTH - 1 >= m.position
  5060.    REPLACE &g_scrnalias..width WITH &g_scrnalias..width + m.adjustment
  5061. ENDSCAN
  5062. SELECT (m.g_scrnalias)
  5063.  
  5064. *!*****************************************************************************
  5065. *!
  5066. *!       Function: SGN
  5067. *!
  5068. *!      Called by: FINDWIDEROBJECTS   (procedure in TRANSPRT.PRG)
  5069. *!
  5070. *!*****************************************************************************
  5071. FUNCTION sgn
  5072. PARAMETER num
  5073. DO CASE
  5074. CASE num = 0
  5075.    RETURN 0
  5076. CASE num > 0
  5077.    RETURN 1
  5078. CASE num < 0
  5079.    RETURN -1
  5080. ENDCASE
  5081.  
  5082.  
  5083. *
  5084. * repoObjects - Reposition objects to the relative positions on the new window.
  5085. *      This procedure assumes that the array objectpos is sorted on rows ([m.i, 2]).
  5086. *
  5087. *!*****************************************************************************
  5088. *!
  5089. *!      Procedure: REPOOBJECTS
  5090. *!
  5091. *!      Called by: CALCWINDOWDIMENSION(procedure in TRANSPRT.PRG)
  5092. *!
  5093. *!          Calls: GETLASTOBJECTLINE()(function  in TRANSPRT.PRG)
  5094. *!               : HORIZBUTTON()      (function  in TRANSPRT.PRG)
  5095. *!               : ADJBOX             (procedure in TRANSPRT.PRG)
  5096. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  5097. *!
  5098. *!*****************************************************************************
  5099. PROCEDURE repoobjects
  5100. PARAMETER m.windheight
  5101. PRIVATE m.windwidth, m.thermstep, m.rightalign, m.saverec, ;
  5102.    m.adjust, m.buttonadjust, m.numrb
  5103.  
  5104. m.saverec = RECNO()
  5105. m.windwidth = WIDTH
  5106. m.thermstep = 10 / m.objindex
  5107. STORE 0 TO m.adjust, m.buttonadjust, m.numrb
  5108.  
  5109. FOR m.i = 1 TO m.objindex
  5110.    
  5111.    IF objectpos[m.i,2] != m.curline
  5112.       IF m.numrb > 0
  5113.          m.adjust = m.adjust + c_vradbtn
  5114.          m.numrb = m.numrb - 1
  5115.       ENDIF
  5116.       m.adjust = m.adjust + m.buttonadjust
  5117.       STORE 0 TO m.buttonadjust
  5118.       m.curline = objectpos[m.i,2]
  5119.    ENDIF
  5120.    
  5121.    LOCATE FOR platform = m.g_toplatform AND uniqueid = objectpos[m.i,3]
  5122.    IF FOUND()
  5123.       
  5124.       g_lastobjectline[1] = getlastobjectline(g_lastobjectline[1], ;
  5125.          m.windheight * objectpos[m.i, 2] + m.adjust)
  5126.       
  5127.       REPLACE vpos WITH m.windheight * objectpos[m.i, 2] + m.adjust
  5128.       
  5129.       IF objectpos[m.i,5]
  5130.          m.rightalign = (m.windwidth * objectpos[m.i,1]) - WIDTH
  5131.          REPLACE hpos WITH IIF(m.rightalign < 0, 0, m.rightalign)
  5132.       ENDIF
  5133.       
  5134.       DO CASE
  5135.       CASE objectpos[m.i,4] = c_otfield
  5136.          REPLACE hpos WITH hpos + c_adjfld
  5137.          
  5138.       CASE objectpos[m.i,4] = c_otlist
  5139.          REPLACE vpos WITH vpos + c_vlist
  5140.          REPLACE HEIGHT WITH HEIGHT - c_listht
  5141.          
  5142.       CASE objectpos[m.i,4] = c_ottxtbut
  5143.          IF horizbutton(objectpos[m.i, 9])
  5144.             m.buttonadjust = c_adjtbtn
  5145.          ENDIF
  5146.          
  5147.       CASE objectpos[m.i,4] = c_otradbut
  5148.          IF m.buttonadjust < c_adjrbtn
  5149.             m.buttonadjust = c_adjrbtn
  5150.          ENDIF
  5151.          REPLACE vpos WITH vpos - c_vradbtn
  5152.          
  5153.       CASE objectpos[m.i,4] = c_otchkbox
  5154.          REPLACE vpos WITH vpos - c_vchkbox
  5155.          
  5156.       CASE objectpos[m.i,4] = c_otpopup
  5157.          REPLACE vpos WITH MAX(vpos + c_vpopup,0)
  5158.          REPLACE hpos WITH MAX(hpos + c_hpopup,0)
  5159.          
  5160.       CASE objectpos[m.i,4] = c_otbox
  5161.          DO adjbox WITH m.adjust
  5162.       ENDCASE
  5163.       
  5164.    ENDIF
  5165.    m.g_mercury = m.g_mercury + m.thermstep
  5166.    DO updtherm WITH m.g_mercury
  5167. ENDFOR
  5168. GOTO RECORD m.saverec
  5169.  
  5170. *
  5171. * adjItemsInBoxes - Adjust the location of objects within boxes
  5172. *
  5173. *!*****************************************************************************
  5174. *!
  5175. *!      Procedure: ADJITEMSINBOXES
  5176. *!
  5177. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  5178. *!
  5179. *!          Calls: ITEMSINBOXES       (procedure in TRANSPRT.PRG)
  5180. *!
  5181. *!*****************************************************************************
  5182. PROCEDURE adjitemsinboxes
  5183. PRIVATE m.subflag, m.emptybox, m.newlastline
  5184.  
  5185. DIMENSION boxdimension[4,2]
  5186. && 1 - Topmost
  5187. && 2 - Leftmost
  5188. && 3 - Bottommost
  5189. && 4 - Rightmost
  5190.  
  5191. SELECT (m.g_fromobjonlyalias)
  5192.  
  5193. SCAN FOR objtype = c_otbox AND HEIGHT != 1 AND WIDTH != 1
  5194.    STORE 999 TO boxdimension[1,1], boxdimension[2,1]
  5195.    STORE 0 TO boxdimension[3,1], boxdimension[4,1], boxdimension[4,2]
  5196.    STORE .F. TO m.subflag, m.emptybox, m.shrinkbox
  5197.    
  5198.    DO itemsinboxes WITH vpos, hpos, ;
  5199.       vpos + HEIGHT -1, hpos + WIDTH -1, m.emptybox, m.shrinkbox
  5200.    
  5201.    IF vpos + HEIGHT - 1 >= g_lastobjectline[1]
  5202.       m.newlastline = vpos + HEIGHT -1
  5203.       m.flag = .T.
  5204.       m.shrinkbox = .F.
  5205.    ELSE
  5206.       m.flag = .F.
  5207.    ENDIF
  5208.    
  5209.    boxdimension[1,1] = boxdimension[1,1] - vpos -.5
  5210.    boxdimension[2,1] = boxdimension[2,1] - hpos -.5
  5211.    boxdimension[3,1] = vpos + HEIGHT - 1 - boxdimension[3,1] - IIF(m.shrinkbox, .5 + c_vpopup, .5)
  5212.    boxdimension[4,1] = hpos + WIDTH - boxdimension[4,1] - 1.5
  5213.    
  5214.    SELECT (m.g_scrnalias)
  5215.    m.thisid = uniqueid
  5216.    LOCATE FOR uniqueid = m.thisid AND platform = m.g_toplatform
  5217.    IF FOUND() AND NOT m.emptybox
  5218.       REPLACE vpos WITH boxdimension[1,2] - boxdimension[1,1]
  5219.       REPLACE hpos WITH boxdimension[2,2] - boxdimension[2,1]
  5220.       REPLACE HEIGHT WITH boxdimension[3,2] - vpos + boxdimension[3,1]
  5221.       REPLACE WIDTH WITH boxdimension[4,2] - hpos + boxdimension[4,1]
  5222.       IF m.flag AND vpos + HEIGHT >= g_lastobjectline[2]
  5223.          g_lastobjectline[1] = m.newlastline
  5224.          g_lastobjectline[2] = vpos + HEIGHT
  5225.       ENDIF
  5226.    ENDIF
  5227.    
  5228.    SELECT (m.g_fromobjonlyalias)
  5229.    
  5230. ENDSCAN
  5231. SELECT (m.g_scrnalias)
  5232.  
  5233. *
  5234. * itemsInBoxes - Adjust objects which are within a box
  5235. *
  5236. *!*****************************************************************************
  5237. *!
  5238. *!      Procedure: ITEMSINBOXES
  5239. *!
  5240. *!      Called by: ADJITEMSINBOXES    (procedure in TRANSPRT.PRG)
  5241. *!
  5242. *!          Calls: FINDOTHERSONLINE() (function  in TRANSPRT.PRG)
  5243. *!               : WHATSTYLE()        (function  in TRANSPRT.PRG)
  5244. *!               : HORIZBUTTON()      (function  in TRANSPRT.PRG)
  5245. *!               : GETOBJWIDTH()      (function  in TRANSPRT.PRG)
  5246. *!
  5247. *!           Uses: M.G_FROMOBJONLYALIA
  5248. *!
  5249. *!*****************************************************************************
  5250. PROCEDURE itemsinboxes
  5251. PARAMETER m.top, m.left, m.bottom, m.right, m.emptybox, m.shrinkbox
  5252. PRIVATE m.rec, m.wasapopup, m.oldbottom, m.newbottom, m.twidth
  5253.  
  5254. m.rec = RECNO()
  5255. m.g_boxeditemsalias = "S" + SUBSTR(LOWER(SYS(3)),2,8)
  5256.  
  5257. SELECT vpos, hpos, HEIGHT, WIDTH, uniqueid, spacing, objtype, PICTURE, platform ;
  5258.    FROM (m.g_fromobjonlyalias) ;
  5259.    WHERE (vpos > m.top AND vpos < m.bottom) ;
  5260.    AND (hpos > m.left AND hpos < m.right) AND ;
  5261.    objtype <> c_otbox AND !(LEN(expr)=3 ;
  5262.    AND ASC(SUBSTR(CPTCOND(c_doscp,c_wincp,expr),2,1)) >= 179 ;
  5263.     AND ASC(SUBSTR(CPTCOND(c_doscp,c_wincp,expr),2,1)) <= 218);
  5264.    INTO CURSOR (m.g_boxeditemsalias)
  5265.  
  5266. STORE 0 TO m.oldbottom, m.newbottom
  5267. IF _TALLY > 0
  5268.    SET RELATION TO uniqueid+m.g_toplatform INTO (m.g_scrnalias) ADDITIVE
  5269.    LOCATE FOR .T.
  5270.    m.wasapopup = .F.
  5271.    
  5272.    DO WHILE NOT EOF()
  5273.       IF vpos < boxdimension[1,1] OR (m.wasapopup AND vpos = boxdimension[1,1])
  5274.          boxdimension[1,1] = vpos
  5275.          boxdimension[1,2] = &g_scrnalias..vpos
  5276.          IF objtype = c_otpopup
  5277.             m.wasapopup = .T.
  5278.          ELSE
  5279.             m.wasapopup = .F.
  5280.          ENDIF
  5281.       ENDIF
  5282.       
  5283.       IF hpos < boxdimension[2,1]
  5284.          boxdimension[2,1]= hpos
  5285.          boxdimension[2,2] = &g_scrnalias..hpos
  5286.       ENDIF
  5287.       
  5288.       DO CASE
  5289.       CASE objtype = c_ottext OR objtype = c_otchkbox ;
  5290.             OR (objtype = c_otfield AND HEIGHT = 1)
  5291.          IF vpos > m.oldbottom
  5292.             m.shrinkbox = .F.
  5293.             IF !findothersonline(vpos, @m.newbottom, @m.oldbottom, objtype)
  5294.                m.oldbottom = vpos + HEIGHT
  5295.                m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5296.             ENDIF
  5297.          ENDIF
  5298.          
  5299.          * Check TXTWIDTH for text strings
  5300.          IF m.g_tographic AND objtype = c_ottext
  5301.             m.twidth = TXTWIDTH(&g_scrnalias..expr,g_fontface,g_fontsize,whatstyle(g_boldstyle))
  5302.          ELSE
  5303.             m.twidth = &g_scrnalias..width
  5304.          ENDIF
  5305.          
  5306.          IF &g_scrnalias..hpos + m.twidth > boxdimension[4,2]
  5307.             boxdimension[4,1] = hpos + WIDTH - 1
  5308.             boxdimension[4,2] = &g_scrnalias..hpos + m.twidth
  5309.          ENDIF
  5310.          
  5311.       CASE objtype = c_otradbut OR objtype = c_ottxtbut OR objtype = c_otinvbut
  5312.          m.numitems = OCCURS(';',PICTURE) + 1
  5313.          
  5314.          IF horizbutton(PICTURE)
  5315.             
  5316.             IF vpos > m.oldbottom
  5317.                m.shrinkbox = .F.
  5318.                IF findothersonline(vpos, @m.newbottom, @m.oldbottom, ;
  5319.                      objtype)
  5320.                   IF objtype = c_ottxtbut
  5321.                      REPLACE &g_scrnalias..vpos WITH &g_scrnalias..vpos - 0.312
  5322.                   ENDIF
  5323.                ENDIF
  5324.                m.oldbottom = vpos + HEIGHT - 1
  5325.                m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5326.             ENDIF
  5327.             
  5328.             IF (hpos -1 + (WIDTH +spacing) * m.numitems - spacing) >= ;
  5329.                   boxdimension[4,1]
  5330.                boxdimension[4,1] = hpos - 1 + ;
  5331.                   getobjwidth(objtype, ;
  5332.                   PICTURE, ;
  5333.                   WIDTH, ;
  5334.                   spacing, ;
  5335.                   m.g_toplatform)
  5336.                boxdimension[4,2] = &g_scrnalias..hpos + ;
  5337.                   getobjwidth(&g_scrnalias..objtype, ;
  5338.                   &g_scrnalias..picture, ;
  5339.                   &g_scrnalias..width, ;
  5340.                   &g_scrnalias..spacing, ;
  5341.                   m.g_toplatform)
  5342.             ENDIF
  5343.             
  5344.          ELSE
  5345.             m.shrinkbox = .F.
  5346.             IF (vpos -1 + m.numitems + (spacing * (m.numitems -1))) >= ;
  5347.                   m.oldbottom
  5348.                m.oldbottom = vpos -1 + m.numitems + ;
  5349.                   (spacing * (m.numitems -1)) - 1
  5350.                m.newbottom = &g_scrnalias..vpos  + m.numitems + ;
  5351.                   (&g_scrnalias..spacing * (m.numitems -1))
  5352.             ENDIF
  5353.             
  5354.             IF hpos -1 + WIDTH >= boxdimension[4,1]
  5355.                boxdimension[4,1] = hpos -1 + WIDTH
  5356.                boxdimension[4,2] = &g_scrnalias..hpos  + ;
  5357.                   &g_scrnalias..width
  5358.             ENDIF
  5359.          ENDIF
  5360.          
  5361.       CASE objtype = c_otpopup
  5362.          IF vpos + HEIGHT - 2 > m.oldbottom
  5363.             IF !findothersonline(vpos + 1, @m.newbottom, @m.oldbottom, objtype)
  5364.                m.oldbottom = vpos + HEIGHT - 2
  5365.                m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5366.             ENDIF
  5367.             m.shrinkbox = IIF(m.bottom -1 = vpos + HEIGHT -1, .T., .F.)
  5368.          ENDIF
  5369.          
  5370.          IF hpos + WIDTH - 1 > boxdimension[4,1])
  5371.             boxdimension[4,1] = hpos + WIDTH - 1
  5372.             boxdimension[4,2] = &g_scrnalias..hpos + &g_scrnalias..width
  5373.          ENDIF
  5374.          
  5375.       CASE objtype = c_otfield OR ;
  5376.             objtype = c_otlist OR objtype = c_otbox
  5377.          
  5378.          IF vpos + HEIGHT - 1 > m.oldbottom
  5379.             m.shrinkbox = .F.
  5380.             IF !findothersonline(vpos, @m.newbottom, @m.oldbottom, objtype)
  5381.                m.oldbottom = vpos + HEIGHT - 1
  5382.                m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5383.             ENDIF
  5384.          ENDIF
  5385.          
  5386.          IF hpos + WIDTH - 1 > boxdimension[4,1])
  5387.             boxdimension[4,1] = hpos + WIDTH - 1
  5388.             boxdimension[4,2] = &g_scrnalias..hpos + &g_scrnalias..width
  5389.          ENDIF
  5390.          
  5391.       ENDCASE
  5392.       SKIP
  5393.    ENDDO
  5394.    
  5395.    m.emptybox = .F.
  5396.    boxdimension[3,1] = m.oldbottom
  5397.    boxdimension[3,2] = m.newbottom
  5398. ELSE
  5399.    m.emptybox = .T.
  5400. ENDIF
  5401.  
  5402. USE
  5403. SELECT (m.g_fromobjonlyalias)
  5404. GOTO RECORD m.rec
  5405.  
  5406. *
  5407. * findOthersOnLine - Find any other objects in the box and on the line with a text button
  5408. *
  5409. *!*****************************************************************************
  5410. *!
  5411. *!       Function: FINDOTHERSONLINE
  5412. *!
  5413. *!      Called by: ITEMSINBOXES       (procedure in TRANSPRT.PRG)
  5414. *!
  5415. *!*****************************************************************************
  5416. FUNCTION findothersonline
  5417. PARAMETER m.lineno, m.newbottom, m.oldbottom, m.curtype
  5418. PRIVATE m.saverec, m.prevtype, m.flag
  5419.  
  5420. m.prevtype = 0
  5421. m.flag = .F.
  5422. m.saverec = RECNO()
  5423. LOCATE FOR (objtype != c_otpopup AND vpos = m.lineno) OR ;
  5424.    (m.curtype != c_otpopup AND objtype = c_otpopup AND m.lineno = vpos + 1)
  5425.  
  5426. IF !FOUND()
  5427.    GOTO RECORD (m.saverec)
  5428.    RETURN m.flag
  5429. ENDIF
  5430.  
  5431. DO WHILE FOUND()
  5432.    DO CASE
  5433.    CASE objtype = c_ottxtbut
  5434.       IF m.curtype != objtype
  5435.          m.flag = .T.
  5436.          m.oldbottom = vpos + HEIGHT -1
  5437.          m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5438.          GOTO RECORD (m.saverec)
  5439.          RETURN m.flag
  5440.       ENDIF
  5441.       
  5442.    CASE objtype = c_otpopup
  5443.       m.flag = .T.
  5444.       m.oldbottom = vpos + HEIGHT - 2
  5445.       m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5446.       m.prevtype = c_otpopup
  5447.       
  5448.    CASE (objtype = c_otfield OR objtype = c_otlist OR objtype = c_otline) AND ;
  5449.          (m.prevtype != c_otpopup)
  5450.       m.flag = .T.
  5451.       m.oldbottom = vpos + HEIGHT - 1
  5452.       m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5453.       m.prevtype = objtype
  5454.       
  5455.    OTHERWISE
  5456.       m.flag = .T.
  5457.       m.oldbottom = vpos
  5458.       m.newbottom = &g_scrnalias..vpos + &g_scrnalias..height
  5459.       
  5460.    ENDCASE
  5461.    
  5462.    CONTINUE
  5463. ENDDO
  5464. GOTO RECORD (m.saverec)
  5465. RETURN m.flag
  5466.  
  5467. *
  5468. * StretchLinesToBorders - This procedure makes sure that any lines which stretched to the
  5469. *      edge of the from platform window will stretch to the edge of the to platform window.
  5470. *
  5471. *!*****************************************************************************
  5472. *!
  5473. *!      Procedure: ADJINVBTNS
  5474. *!
  5475. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  5476. *!
  5477. *!          Calls: HORIZBUTTON()      (function  in TRANSPRT.PRG)
  5478. *!               : ADJPOSTINV         (procedure in TRANSPRT.PRG)
  5479. *!               : UPDTHERM           (procedure in TRANSPRT.PRG)
  5480. *!
  5481. *!*****************************************************************************
  5482. PROCEDURE adjinvbtns
  5483. PRIVATE m.saverec, m.loop, m.horizontal, m.btnid, m.objid, m.flag, m.thermstep, m.leftmost, ;
  5484.    m.label, m.btnvpos, m.btnhpos, m.btnwidth, m.btnheight, m.btnspacing, m.btncount, ;
  5485.    m.ybtn, m.vbtn, m.xbtn, m.hbtn, m.defwidth, m.defwidthindex, m.defheight, m.defheightindex, ;
  5486.    m.topmargin, m.bottommargin, m.leftmargin, m.rightmargin, m.adjustment, m.totadjust, m.newhpos
  5487.  
  5488. m.saverec = RECNO()
  5489. m.totadjust = 0
  5490. m.leftmost = 0
  5491.  
  5492. COUNT TO m.thermstep FOR platform = m.g_fromplatform AND objtype = c_otinvbut
  5493. m.thermstep = 5/m.thermstep
  5494.  
  5495. SCAN FOR platform = m.g_fromplatform AND objtype = c_otinvbut
  5496.    m.horizontal = horizbutton(PICTURE)
  5497.    m.btnvpos = vpos
  5498.    m.btnhpos = hpos
  5499.    m.btnheight = HEIGHT
  5500.    m.btnwidth = WIDTH
  5501.    m.btnspacing = spacing
  5502.    m.btncount = OCCURS(";", PICTURE) + 1
  5503.    m.btnid = uniqueid
  5504.    
  5505.    STORE 0 TO m.defwidth, m.defwidthindex, m.defheight, m.defheightindex
  5506.    
  5507.    * This array is used to keep track of the rectangle which bounds the objects which
  5508.    * lie on top of each invisible button in the set.
  5509.    *
  5510.    *   sizes[x,1] = Minimum row on the FROM platform.
  5511.    *   sizes[x,2] = Minimum colum on the FROM platform.
  5512.    *   sizes[x,3] = Maximum row on the FROM platform.
  5513.    *   sizes[x,4] = Maximum colum on the FROM platform.
  5514.    *   sizes[x,5] = Minimum row on the TO platform.
  5515.    *   sizes[x,6] = Minimum colum on the TO platform.
  5516.    *   sizes[x,7] = Maximum row on the TO platform.
  5517.    *   sizes[x,8] = Maximum colum on the TO platform.
  5518.    *   sizes[x,9] = Comma delimeted list of uniqueid's for objects positioned on
  5519.    *               the button face.
  5520.    DIMENSION sizes[m.btnCount,9]
  5521.    
  5522.    FOR m.loop = 1 TO m.btncount
  5523.       m.ybtn = IIF(m.horizontal, m.btnvpos, m.btnvpos + ((m.loop-1) * m.btnheight) + ((m.loop-1) * m.btnspacing))
  5524.       m.vbtn = m.ybtn + m.btnheight
  5525.       m.xbtn = IIF(m.horizontal, m.btnhpos + ((m.loop-1) * m.btnwidth) + ((m.loop-1) * m.btnspacing), m.btnhpos)
  5526.       m.hbtn = m.xbtn + m.btnwidth
  5527.       
  5528.       STORE 0 TO sizes[m.loop,3], sizes[m.loop,4], sizes[m.loop,7], sizes[m.loop,8]
  5529.       STORE 99999999 TO sizes[m.loop,1], sizes[m.loop,2], sizes[m.loop,5], sizes[m.loop,6]
  5530.       
  5531.       sizes[m.loop,9] = ""
  5532.       
  5533.       SCAN FOR platform = m.g_fromplatform AND (objtype = c_ottext OR objtype = c_otfield  OR ;
  5534.             objtype = c_otbox OR objtype = c_otline) AND ;
  5535.             vpos >= m.ybtn AND vpos+HEIGHT <= m.vbtn AND hpos >= m.xbtn AND hpos+WIDTH <= m.hbtn
  5536.          m.objid = uniqueid
  5537.          sizes[m.loop,1] = MIN(sizes[m.loop,1], vpos)
  5538.          sizes[m.loop,2] = MIN(sizes[m.loop,2], hpos)
  5539.          sizes[m.loop,3] = MAX(sizes[m.loop,3], vpos+HEIGHT)
  5540.          sizes[m.loop,4] = MAX(sizes[m.loop,4], hpos+WIDTH)
  5541.          sizes[m.loop,9] = sizes[m.loop,9] + ;
  5542.             IIF(LEN(sizes[m.loop,9]) = 0, uniqueid, ","+uniqueid)
  5543.          
  5544.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  5545.          IF FOUND()
  5546.             sizes[m.loop,5] = MIN(sizes[m.loop,5], IIF(objtype = c_otbox OR objtype = c_otline, ;
  5547.                vpos-c_adjbox, vpos))
  5548.             sizes[m.loop,6] = MIN(sizes[m.loop,6], IIF(objtype = c_otbox OR objtype = c_otline, ;
  5549.                hpos-c_adjbox, hpos))
  5550.             sizes[m.loop,7] = MAX(sizes[m.loop,7], IIF(objtype = c_otbox OR objtype = c_otline, ;
  5551.                vpos+HEIGHT+c_adjbox, vpos+HEIGHT))
  5552.             sizes[m.loop,8] = MAX(sizes[m.loop,8], IIF(objtype = c_otbox OR objtype = c_otline, ;
  5553.                hpos+WIDTH+c_adjbox, hpos+WIDTH))
  5554.          ENDIF
  5555.          
  5556.          LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.objid
  5557.       ENDSCAN
  5558.       
  5559.       * The tallest button region will define where the button set gets
  5560.       * placed so we want to remember which region that was.
  5561.       IF (sizes[m.loop,7] - sizes[m.loop,5]) > m.defheight
  5562.          m.defheight      = sizes[m.loop,7] - sizes[m.loop,5]
  5563.          m.defheightindex = m.loop
  5564.          m.topmargin      = sizes[m.loop,1] - m.ybtn
  5565.          m.bottommargin   = m.vbtn - sizes[m.loop,3]
  5566.       ENDIF
  5567.       
  5568.       * The widest button region will define where the button set gets
  5569.       * placed so we want to remember which region that was.
  5570.       IF (sizes[m.loop,8] - sizes[m.loop,6]) > m.defwidth
  5571.          m.defwidth      = sizes[m.loop,8] - sizes[m.loop,6]
  5572.          m.defwidthindex = m.loop
  5573.          m.leftmargin    = sizes[m.loop,2] - m.xbtn
  5574.          m.rightmargin   = m.hbtn - sizes[m.loop,4]
  5575.       ENDIF
  5576.    ENDFOR
  5577.    
  5578.    IF m.defheightindex != 0 AND m.defwidthindex != 0
  5579.       LOCATE FOR platform = m.g_toplatform AND uniqueid = m.btnid
  5580.       IF FOUND()
  5581.          IF m.horizontal
  5582.             REPLACE vpos WITH sizes[m.defHeightIndex,5] - m.topmargin
  5583.          ELSE
  5584.             REPLACE hpos WITH sizes[m.defWidthIndex,6] - m.leftmargin
  5585.          ENDIF
  5586.          
  5587.          REPLACE HEIGHT WITH (sizes[m.defHeightIndex,7] - sizes[m.defHeightIndex,5]) + m.topmargin + m.bottommargin
  5588.          REPLACE WIDTH WITH (sizes[m.defWidthIndex,8] - sizes[m.defWidthIndex,6]) + m.leftmargin + m.rightmargin
  5589.       ENDIF
  5590.       
  5591.       IF m.horizontal AND WIDTH > m.btnwidth
  5592.          m.adjustment = WIDTH - m.btnwidth
  5593.          IF spacing > 1
  5594.             IF m.adjustment <= spacing-1
  5595.                REPLACE spacing WITH spacing - m.adjustment
  5596.             ELSE
  5597.                m.adjustment = m.adjustment - (spacing-1)
  5598.                REPLACE spacing WITH 1
  5599.                m.leftmost = MAX(m.leftmost, hpos + (m.btncount*WIDTH) + ((m.btncount-1)*spacing))
  5600.                
  5601.                m.totadjust = MAX(m.totadjust, m.btncount * m.adjustment)
  5602.                
  5603.                DO adjpostinv WITH vpos, vpos+HEIGHT, ;
  5604.                   m.btnhpos + (m.btncount*m.btnwidth) + ((m.btncount-1)*m.btnspacing), ;
  5605.                   m.btncount * m.adjustment
  5606.                
  5607.                FOR m.loop = 2 TO m.btncount
  5608.                   DO WHILE LEN(sizes[m.loop,9]) > 0
  5609.                      IF AT(",", sizes[m.loop,9]) != 0
  5610.                         m.label = LEFT(sizes[m.loop,9], AT(",", sizes[m.loop,9])-1)
  5611.                         sizes[m.loop,9] = SUBSTR(sizes[m.loop,9], AT(",", sizes[m.loop,9])+1)
  5612.                      ELSE
  5613.                         m.label = sizes[m.loop,9]
  5614.                         sizes[m.loop,9] = ""
  5615.                      ENDIF
  5616.                      
  5617.                      LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.label
  5618.                      IF FOUND()
  5619.                         m.newhpos = hpos + (m.adjustment * (m.loop-1))
  5620.                         LOCATE FOR platform = m.g_toplatform AND uniqueid = m.label
  5621.                         IF FOUND()
  5622.                            REPLACE hpos WITH IIF(objtype = c_otbox OR objtype = c_otline, ;
  5623.                               m.newhpos+c_adjbox, m.newhpos)
  5624.                         ENDIF
  5625.                      ENDIF
  5626.                   ENDDO
  5627.                ENDFOR
  5628.             ENDIF
  5629.          ENDIF
  5630.       ENDIF
  5631.    ENDIF
  5632.    
  5633.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  5634.    IF FOUND()
  5635.       IF m.totadjust > 0
  5636.          REPLACE WIDTH WITH WIDTH + m.totadjust
  5637.       ENDIF
  5638.       
  5639.       IF WIDTH < m.leftmost
  5640.          REPLACE WIDTH WITH m.leftmost + 1
  5641.       ENDIF
  5642.    ENDIF
  5643.    
  5644.    
  5645.    m.g_mercury = m.g_mercury + m.thermstep
  5646.    DO updtherm WITH m.g_mercury
  5647.    
  5648.    LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.btnid
  5649. ENDSCAN
  5650.  
  5651. IF m.saverec <= RECCOUNT()
  5652.    GOTO RECORD (m.saverec)
  5653. ELSE
  5654.    LOCATE FOR .F.
  5655. ENDIF
  5656.  
  5657. *
  5658. * adjPostInv - This procedure moves objects which lie to the right of a set of horizontal
  5659. *      invisible buttons so that they won't overlap.
  5660. *
  5661. *!*****************************************************************************
  5662. *!
  5663. *!      Procedure: ADJPOSTINV
  5664. *!
  5665. *!      Called by: ADJINVBTNS         (procedure in TRANSPRT.PRG)
  5666. *!
  5667. *!          Calls: FINDALIGNEND()     (function  in TRANSPRT.PRG)
  5668. *!
  5669. *!*****************************************************************************
  5670. PROCEDURE adjpostinv
  5671. PARAMETER m.ystart, m.yend, m.xstart, m.adjustment
  5672. PRIVATE m.saverec, m.saveid
  5673.  
  5674. m.saverec = RECNO()
  5675.  
  5676. m.ystart = findalignend(m.ystart, m.xstart, -1)
  5677. m.yend = findalignend(m.yend, m.xstart, 1)
  5678.  
  5679. SCAN FOR platform = m.g_fromplatform AND hpos >= m.xstart AND vpos >= m.ystart AND vpos <= m.yend AND ;
  5680.       (objtype = c_ottext   OR objtype = c_otline   OR objtype = c_otbox   OR objtype = c_list OR ;
  5681.       objtype = c_otradbut OR objtype = c_otchkbox OR objtype = c_otfield OR objtype = c_popup OR ;
  5682.       objtype = c_otinvbut)
  5683.    m.saveid = uniqueid
  5684.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.saveid
  5685.    IF FOUND()
  5686.       REPLACE hpos WITH hpos + m.adjustment
  5687.    ENDIF
  5688.    
  5689.    LOCATE FOR platform = m.g_fromplatform AND uniqueid = m.saveid
  5690. ENDSCAN
  5691.  
  5692. IF m.saverec <= RECCOUNT()
  5693.    GOTO RECORD m.saverec
  5694. ELSE
  5695.    LOCATE FOR .F.
  5696. ENDIF
  5697.  
  5698. *
  5699. * FindAlignEnd - Given a position to start with and a direction, this routine looks for the
  5700. *      last line where right aligned objects extend to from the starting position.
  5701. *
  5702. *!*****************************************************************************
  5703. *!
  5704. *!       Function: FINDALIGNEND
  5705. *!
  5706. *!      Called by: ADJPOSTINV         (procedure in TRANSPRT.PRG)
  5707. *!
  5708. *!*****************************************************************************
  5709. FUNCTION findalignend
  5710. PARAMETER m.ystart, m.xstart, m.increment
  5711. PRIVATE m.saverec, m.ytemp, m.xtemp, m.result
  5712.  
  5713. m.result = m.ystart
  5714.  
  5715. SCAN FOR platform = m.g_fromplatform AND hpos >= m.xstart AND vpos = m.ystart
  5716.    m.saverec = RECNO()
  5717.    
  5718.    m.ytemp = vpos + m.increment
  5719.    m.xtemp = hpos
  5720.    LOCATE FOR platform = m.g_fromplatform AND vpos = m.ytemp AND hpos = m.xtemp AND ;
  5721.       (objtype = c_ottext   OR objtype = c_otline   OR objtype = c_otbox   OR objtype = c_list OR ;
  5722.       objtype = c_otradbut OR objtype = c_otchkbox OR objtype = c_otfield OR objtype = c_popup OR ;
  5723.       objtype = c_otinvbut)
  5724.    DO WHILE FOUND()
  5725.       m.result = IIF(m.increment < 0, MIN(m.result, m.ytemp), MAX(m.result, m.ytemp))
  5726.       m.ytemp = m.ytemp + m.increment
  5727.       LOCATE FOR platform = m.g_fromplatform AND vpos = m.ytemp AND hpos = m.xtemp AND ;
  5728.          (objtype = c_ottext   OR objtype = c_otline   OR objtype = c_otbox   OR objtype = c_list OR ;
  5729.          objtype = c_otradbut OR objtype = c_otchkbox OR objtype = c_otfield OR objtype = c_popup OR ;
  5730.          objtype = c_otinvbut)
  5731.    ENDDO
  5732.    GOTO RECORD m.saverec
  5733. ENDSCAN
  5734.  
  5735. RETURN m.result
  5736.  
  5737. *
  5738. * StretchLinesToBorders - This procedure makes sure that any lines which stretched to the
  5739. *      edge of the from platform window will stretch to the edge of the to platform window.
  5740. *
  5741. *!*****************************************************************************
  5742. *!
  5743. *!      Procedure: STRETCHLINESTOBORDERS
  5744. *!
  5745. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  5746. *!
  5747. *!*****************************************************************************
  5748. PROCEDURE stretchlinestoborders
  5749. PRIVATE m.saverec, m.objid, m.objrec, m.objwidth, m.fromheight, m.fromwidth
  5750.  
  5751. IF m.g_filetype = c_report OR m.g_filetype = c_label
  5752.    RETURN
  5753. ENDIF
  5754.  
  5755. m.saverec = RECNO()
  5756.  
  5757. LOCATE FOR platform = m.g_fromplatform AND objtype = c_otheader
  5758. IF FOUND()
  5759.    IF BORDER = 0 OR STYLE = 0
  5760.       m.fromheight = HEIGHT
  5761.       m.fromwidth = WIDTH
  5762.    ELSE
  5763.       m.fromheight = HEIGHT - 2
  5764.       m.fromwidth = WIDTH - 2
  5765.    ENDIF
  5766.    
  5767.    SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND ;
  5768.          ((WIDTH = 1 AND vpos+HEIGHT = m.fromheight) OR (HEIGHT = 1 AND hpos+WIDTH = m.fromwidth))
  5769.       
  5770.       m.objrec = RECNO()
  5771.       m.objid = uniqueid
  5772.       m.objwidth = WIDTH
  5773.       LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  5774.       IF FOUND()
  5775.          m.toheight = HEIGHT
  5776.          m.towidth = WIDTH
  5777.          
  5778.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  5779.          IF FOUND()
  5780.             IF m.objwidth = 1
  5781.                REPLACE HEIGHT WITH m.toheight-vpos
  5782.             ELSE
  5783.                REPLACE WIDTH WITH m.towidth-hpos
  5784.             ENDIF
  5785.          ENDIF
  5786.       ENDIF
  5787.       
  5788.       GOTO RECORD m.objrec
  5789.    ENDSCAN
  5790. ENDIF
  5791.  
  5792. IF m.saverec > RECCOUNT()
  5793.    LOCATE FOR .F.
  5794. ELSE
  5795.    GOTO RECORD m.saverec
  5796. ENDIF
  5797. RETURN
  5798.  
  5799. *
  5800. * JoinLines -This procedure examines each line to see where it meets other lines in the
  5801. *      from platform and constructs an array of these positons.  This array can then
  5802. *      be used to make the lines/boxes meet in the from platform.
  5803. *
  5804. *!*****************************************************************************
  5805. *!
  5806. *!      Procedure: JOINLINES
  5807. *!
  5808. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  5809. *!
  5810. *!          Calls: UPDTHERM           (procedure in TRANSPRT.PRG)
  5811. *!               : JOINHORIZONTAL     (procedure in TRANSPRT.PRG)
  5812. *!               : JOINVERTICAL       (procedure in TRANSPRT.PRG)
  5813. *!               : MEETBOXCHAR        (procedure in TRANSPRT.PRG)
  5814. *!               : ZAPBOXCHAR         (procedure in TRANSPRT.PRG)
  5815. *!               : REJOINBOXES        (procedure in TRANSPRT.PRG)
  5816. *!
  5817. *!*****************************************************************************
  5818. PROCEDURE joinlines
  5819. PRIVATE m.saverec, m.joincount, m.linerec, m.lineid, m.i, m.thermstep, ;
  5820.    m.objvpos, m.objhpos, m.objright, m.objbottom, m.objid, m.objrec, m.objcode, ;
  5821.    m.fromvpos, m.fromhpos, m.fromheight, m.fromwidth, m.fromend, m.fromcode, ;
  5822.    m.tovpos, m.tohpos, m.toheight, m.towidth, ;
  5823.    m.joinvpos, m.joinhpos, m.vlevel, m.hlevel
  5824.  
  5825. DIMENSION joins[1,5]
  5826. && Joins[X,2] - toVpos
  5827. && Joins[X,3] - toHpos
  5828. && Joins[X,4] - Vpos match level
  5829. && Joins[X,5] - Hpos match level
  5830. m.joincount = 0
  5831. m.saverec = RECNO()
  5832.  
  5833. COUNT TO m.thermstep FOR platform = m.g_fromplatform AND objtype = c_otbox AND (WIDTH=1 OR HEIGHT=1)
  5834. IF m.thermstep <> 0
  5835.    m.thermstep = 10 / m.thermstep
  5836. ELSE
  5837.    m.g_mercury = m.g_mercury + 10
  5838.    DO updtherm WITH m.g_mercury
  5839. ENDIF
  5840.  
  5841. SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND (WIDTH=1 OR HEIGHT=1)
  5842.    m.fromvpos = vpos
  5843.    m.fromhpos = hpos
  5844.    m.fromheight = HEIGHT
  5845.    m.fromwidth = WIDTH
  5846.    m.fromcode = objcode
  5847.    m.lineid = uniqueid
  5848.    m.linerec = RECNO()
  5849.    
  5850.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.lineid
  5851.    IF FOUND()
  5852.       m.tovpos = vpos
  5853.       m.tohpos = hpos
  5854.       m.toheight = HEIGHT
  5855.       m.towidth = WIDTH
  5856.       
  5857.       SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND uniqueid <> m.lineid
  5858.          IF m.fromheight = 1 AND HEIGHT <> 1 AND (m.fromvpos >= vpos AND m.fromvpos <= vpos+HEIGHT-1)
  5859.             m.fromend = m.fromhpos + m.fromwidth - 1
  5860.             
  5861.             ** Horizontal line which starts on a vertical line/box side.
  5862.             IF m.fromhpos = hpos OR m.fromhpos = hpos+WIDTH-1
  5863.                DO joinhorizontal WITH m.fromvpos, m.fromhpos, m.fromhpos, m.tovpos, m.toheight, m.fromcode
  5864.             ENDIF
  5865.             
  5866.             ** Horizontal line which ends on a vertical line/box side.
  5867.             IF m.fromend = hpos OR m.fromend = hpos+WIDTH-1
  5868.                DO joinhorizontal WITH m.fromvpos, m.fromend, m.fromend, m.tovpos, m.toheight, m.fromcode
  5869.             ENDIF
  5870.             
  5871.             ** Horizontal line which starts one to the right of a vertical line/box side
  5872.             IF m.fromhpos-1 = hpos OR m.fromhpos = hpos+WIDTH
  5873.                DO joinhorizontal WITH m.fromvpos, m.fromhpos-1, m.fromhpos, m.tovpos, m.toheight, m.fromcode
  5874.             ENDIF
  5875.             
  5876.             ** Horizontal line which ends one left of a vertical line/box side
  5877.             IF m.fromend+1 = hpos OR  m.fromend = hpos+WIDTH-2
  5878.                DO joinhorizontal WITH m.fromvpos, m.fromend+1, m.fromend, m.tovpos, m.toheight, m.fromcode
  5879.             ENDIF
  5880.          ENDIF
  5881.          
  5882.          IF m.fromwidth = 1 AND WIDTH <> 1 AND (m.fromhpos >= hpos AND m.fromhpos <= hpos+WIDTH-1)
  5883.             m.fromend = m.fromvpos + m.fromheight - 1
  5884.             
  5885.             ** Vertical line which starts on a horizontical line/box side.
  5886.             IF m.fromvpos = vpos OR m.fromvpos = vpos+HEIGHT-1
  5887.                DO joinvertical WITH m.fromvpos, m.fromvpos, m.fromhpos, m.tohpos, m.fromcode
  5888.             ENDIF
  5889.             
  5890.             ** Vertical line which ends on a horizontical line/box side.
  5891.             IF m.fromend = vpos OR m.fromend = vpos+HEIGHT-1
  5892.                DO joinvertical WITH m.fromend, m.fromend, m.fromhpos, m.tohpos, m.fromcode
  5893.             ENDIF
  5894.             
  5895.             ** Vertical line which starts one below a horizontal line/box side
  5896.             IF m.fromvpos-1 = vpos OR m.fromvpos = vpos+HEIGHT
  5897.                DO joinvertical WITH m.fromvpos-1, m.fromvpos, m.fromhpos, m.tohpos, m.fromcode
  5898.             ENDIF
  5899.             
  5900.             ** Vertical line which ends one above a horizontal line/box side
  5901.             IF m.fromend+1 = vpos OR m.fromend = vpos+HEIGHT-2
  5902.                DO joinvertical WITH m.fromend+1, m.fromend, m.fromhpos, m.tohpos, m.fromcode
  5903.             ENDIF
  5904.          ENDIF
  5905.       ENDSCAN
  5906.    ENDIF
  5907.    
  5908.    m.g_mercury = m.g_mercury + m.thermstep
  5909.    DO updtherm WITH m.g_mercury
  5910.    
  5911.    GOTO RECORD m.linerec
  5912. ENDSCAN
  5913.  
  5914. DO meetboxchar
  5915. DO zapboxchar
  5916.  
  5917. m.thermstep = 10/m.joincount
  5918. FOR m.i = 1 TO m.joincount
  5919.    DO rejoinboxes WITH VAL(LEFT(joins[m.i, 1], 3)), VAL(RIGHT(joins[m.i, 1], 3)), joins[m.i, 2], joins[m.i, 3]
  5920.    
  5921.    m.g_mercury = m.g_mercury + m.thermstep
  5922.    DO updtherm WITH m.g_mercury
  5923. ENDFOR
  5924.  
  5925. IF m.saverec > RECCOUNT()
  5926.    LOCATE FOR .F.
  5927. ELSE
  5928.    GOTO RECORD m.saverec
  5929. ENDIF
  5930. RETURN
  5931.  
  5932. *
  5933. * joinHorizontal - This procedure adds a join for a horizontal line which has been determined to
  5934. *               intersect something vertical.
  5935. *
  5936. *!*****************************************************************************
  5937. *!
  5938. *!      Procedure: JOINHORIZONTAL
  5939. *!
  5940. *!      Called by: JOINLINES          (procedure in TRANSPRT.PRG)
  5941. *!
  5942. *!          Calls: GETLINEWIDTH()     (function  in TRANSPRT.PRG)
  5943. *!               : ADDJOIN            (procedure in TRANSPRT.PRG)
  5944. *!
  5945. *!*****************************************************************************
  5946. PROCEDURE joinhorizontal
  5947. PARAMETER m.fromvpos, m.oldhpos1, m.oldhpos2, m.tovpos, m.tothickness, m.fromcode
  5948. PRIVATE m.objvpos, m.objhpos, m.objright, m.objbottom, m.objcode, m.objid, m.objrec
  5949.  
  5950. m.objvpos = vpos
  5951. m.objhpos = hpos
  5952. m.objright = hpos + WIDTH - 1
  5953. m.objbottom = vpos + HEIGHT - 1
  5954. m.objcode = objcode
  5955. m.objid = uniqueid
  5956. m.objrec = RECNO()
  5957.  
  5958. LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  5959. IF FOUND()
  5960.    DO CASE
  5961.    CASE m.fromvpos = m.objvpos OR m.fromvpos = m.objbottom
  5962.       IF objtype = c_otline
  5963.          m.joinvpos = m.tovpos - c_adjbox + (m.tothickness/2)
  5964.          STORE 2 TO m.vlevel, m.hlevel
  5965.       ELSE
  5966.          IF m.fromvpos = m.objvpos
  5967.             m.joinvpos = vpos - c_adjbox + (getlinewidth(m.objcode, .T.)/2)
  5968.          ELSE
  5969.             m.joinvpos = vpos+HEIGHT - c_adjbox - (getlinewidth(m.objcode, .T.)/2)
  5970.          ENDIF
  5971.          STORE 4 TO m.vlevel, m.hlevel
  5972.       ENDIF
  5973.       
  5974.    OTHERWISE
  5975.       m.joinvpos = m.tovpos - c_adjbox + (getlinewidth(m.fromcode, .T.)/2)
  5976.       m.vlevel = 0
  5977.       m.hlevel = IIF(objtype = c_otline, 1, 3)
  5978.    ENDCASE
  5979.    
  5980.    IF m.oldhpos1 = m.objhpos OR objtype = c_otline
  5981.       m.joinhpos = hpos - c_adjbox + (getlinewidth(m.objcode, .F.)/2)
  5982.    ELSE
  5983.       m.joinhpos = hpos+WIDTH - c_adjbox - (getlinewidth(m.objcode, .F.)/2)
  5984.    ENDIF
  5985.    
  5986.    DO addjoin WITH m.fromvpos, m.oldhpos1, m.joinvpos, m.joinhpos, m.vlevel, m.hlevel
  5987.    IF m.oldhpos1 <> m.oldhpos2
  5988.       DO addjoin WITH m.fromvpos, m.oldhpos2, m.joinvpos, m.joinhpos, m.vlevel, m.hlevel
  5989.    ENDIF
  5990. ENDIF
  5991.  
  5992. GOTO RECORD m.objrec
  5993. RETURN
  5994.  
  5995. *
  5996. * joinVertical - This procedure adds a join for a vertical line which has been determined to
  5997. *               intersect something horizontal.
  5998. *
  5999. *!*****************************************************************************
  6000. *!
  6001. *!      Procedure: JOINVERTICAL
  6002. *!
  6003. *!      Called by: JOINLINES          (procedure in TRANSPRT.PRG)
  6004. *!
  6005. *!          Calls: GETLINEWIDTH()     (function  in TRANSPRT.PRG)
  6006. *!               : ADDJOIN            (procedure in TRANSPRT.PRG)
  6007. *!
  6008. *!*****************************************************************************
  6009. PROCEDURE joinvertical
  6010. PARAMETER m.oldvpos1, m.oldvpos2, m.fromhpos, m.tohpos, m.fromcode
  6011. PRIVATE m.objvpos, m.objhpos, m.objright, m.objbottom, m.objcode, m.objid, m.objrec
  6012.  
  6013. m.objvpos = vpos
  6014. m.objhpos = hpos
  6015. m.objright = hpos + WIDTH - 1
  6016. m.objbottom = vpos + HEIGHT - 1
  6017. m.objcode = objcode
  6018. m.objid = uniqueid
  6019. m.objrec = RECNO()
  6020.  
  6021. LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  6022. IF FOUND()
  6023.    DO CASE
  6024.    CASE m.fromhpos = m.objhpos OR m.fromhpos = m.objright
  6025.       IF objtype = c_otline
  6026.          m.joinhpos = IIF(m.fromhpos = m.objhpos, hpos, hpos+WIDTH-1)
  6027.          STORE 2 TO m.vlevel, m.hlevel
  6028.       ELSE
  6029.          IF m.fromhpos = m.objhpos
  6030.             m.joinhpos = hpos - c_adjbox + (getlinewidth(m.objcode, .F.)/2)
  6031.          ELSE
  6032.             m.joinhpos = hpos+WIDTH - c_adjbox - (getlinewidth(m.objcode, .F.)/2)
  6033.          ENDIF
  6034.          STORE 4 TO m.vlevel, m.hlevel
  6035.       ENDIF
  6036.       
  6037.    OTHERWISE
  6038.       m.joinhpos = m.tohpos - c_adjbox + (getlinewidth(m.fromcode, .F.)/2)
  6039.       m.vlevel = IIF(objtype = c_otline, 1, 3)
  6040.       m.hlevel = 0
  6041.    ENDCASE
  6042.    
  6043.    IF m.oldvpos1 = m.objvpos OR objtype = c_otline
  6044.       m.joinvpos = vpos - c_adjbox + (getlinewidth(m.objcode, .T.)/2)
  6045.    ELSE
  6046.       m.joinvpos = vpos+HEIGHT - c_adjbox - (getlinewidth(m.objcode, .T.)/2)
  6047.    ENDIF
  6048.    
  6049.    DO addjoin WITH m.oldvpos1, m.fromhpos, m.joinvpos, m.joinhpos, m.vlevel, m.hlevel
  6050.    IF m.oldvpos1 <> m.oldvpos2
  6051.       DO addjoin WITH m.oldvpos2, m.fromhpos, m.joinvpos, m.joinhpos, m.vlevel, m.hlevel
  6052.    ENDIF
  6053. ENDIF
  6054. GOTO RECORD m.objrec
  6055.  
  6056. *
  6057. * MeetBoxChar - This procedure looks at suspected box join characters and adds a join position for each
  6058. *            line which ends one short of it.
  6059. *
  6060. *!*****************************************************************************
  6061. *!
  6062. *!      Procedure: MEETBOXCHAR
  6063. *!
  6064. *!      Called by: JOINLINES          (procedure in TRANSPRT.PRG)
  6065. *!
  6066. *!          Calls: ADDJOIN            (procedure in TRANSPRT.PRG)
  6067. *!
  6068. *!*****************************************************************************
  6069. PROCEDURE meetboxchar
  6070. PRIVATE m.saverec, m.fromvpos, m.fromhpos, m.tovpos, m.tohpos, m.joinrec, m.joinid
  6071. m.saverec = RECNO()
  6072.  
  6073. SCAN FOR platform = m.g_fromplatform AND objtype = c_ottext AND LEN(expr)=3 AND ;
  6074.       ASC(SUBSTR(CPTCOND(c_doscp,c_wincp,expr),2,1)) >= 179 ;
  6075.       AND ASC(SUBSTR(CPTCOND(c_doscp,c_wincp,expr),2,1)) <= 218
  6076.    m.fromvpos = vpos
  6077.    m.fromhpos = hpos
  6078.    m.joinid = uniqueid
  6079.    m.joinrec = RECNO()
  6080.    
  6081.    LOCATE FOR platform = m.g_toplatform AND uniqueid = m.joinid
  6082.    IF FOUND()
  6083.       m.tovpos = vpos
  6084.       m.tohpos = hpos
  6085.       
  6086.       SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND (WIDTH = 1 OR HEIGHT = 1)
  6087.          IF WIDTH = 1 AND hpos = m.fromhpos
  6088.             DO CASE
  6089.             CASE vpos = m.fromvpos + 1
  6090.                DO addjoin WITH vpos, hpos, m.tovpos, m.tohpos, 2, 2
  6091.                
  6092.             CASE vpos+HEIGHT = m.fromvpos
  6093.                DO addjoin WITH vpos+HEIGHT-1, hpos, m.tovpos, m.tohpos, 2, 2
  6094.             ENDCASE
  6095.          ENDIF
  6096.          
  6097.          IF HEIGHT = 1 AND vpos = m.fromvpos
  6098.             DO CASE
  6099.             CASE hpos = m.fromhpos + 1
  6100.                DO addjoin WITH vpos, hpos, m.tovpos, m.tohpos, 2, 2
  6101.                
  6102.             CASE hpos+WIDTH = m.fromhpos
  6103.                DO addjoin WITH vpos, hpos+WIDTH-1, m.tovpos, m.tohpos, 2, 2
  6104.             ENDCASE
  6105.          ENDIF
  6106.       ENDSCAN
  6107.    ENDIF
  6108.    
  6109.    GOTO RECORD m.joinrec
  6110. ENDSCAN
  6111.  
  6112. IF m.saverec > RECCOUNT()
  6113.    LOCATE FOR .F.
  6114. ELSE
  6115.    GOTO RECORD m.saverec
  6116. ENDIF
  6117. RETURN
  6118.  
  6119. *
  6120. * zapBoxChar - This procedure looks for any text record which is probably a box join
  6121. *            character and replaces it with a transparent space.
  6122. *
  6123. *!*****************************************************************************
  6124. *!
  6125. *!      Procedure: ZAPBOXCHAR
  6126. *!
  6127. *!      Called by: JOINLINES          (procedure in TRANSPRT.PRG)
  6128. *!
  6129. *!*****************************************************************************
  6130. PROCEDURE zapboxchar
  6131. PRIVATE m.recno, m.fromvpos, m.fromhpos
  6132. m.recno = RECNO()
  6133.  
  6134. * See if we can find any single text box/line joining characters in a group.
  6135. SCAN FOR platform = m.g_toplatform AND objtype = c_ottext ;
  6136.       AND boxjoin(objtype,recno(),platform)
  6137.    REPLACE expr WITH '" "'
  6138.    REPLACE mode WITH 1
  6139. ENDSCAN
  6140.  
  6141. IF m.recno > RECCOUNT()
  6142.    GOTO RECCOUNT()
  6143.    SKIP
  6144. ELSE
  6145.    GOTO RECORD m.recno
  6146. ENDIF
  6147.  
  6148. *
  6149. * AddJoin - This routine adds the position for a join character, or modifies a previous join
  6150. *      at the same from position if it has a lower priority.
  6151. *
  6152. *!*****************************************************************************
  6153. *!
  6154. *!      Procedure: ADDJOIN
  6155. *!
  6156. *!      Called by: JOINHORIZONTAL     (procedure in TRANSPRT.PRG)
  6157. *!               : JOINVERTICAL       (procedure in TRANSPRT.PRG)
  6158. *!               : MEETBOXCHAR        (procedure in TRANSPRT.PRG)
  6159. *!
  6160. *!*****************************************************************************
  6161. PROCEDURE addjoin
  6162. PARAMETER m.fromvpos, m.fromhpos, m.tovpos, m.tohpos, m.vmatch, m.hmatch
  6163. PRIVATE m.row, m.key
  6164. m.key = STR(m.fromvpos, 3)+STR(m.fromhpos, 3)
  6165. m.row = ASCAN(joins, m.key)
  6166. IF m.row = 0
  6167.    m.joincount = m.joincount + 1
  6168.    DIMENSION joins[m.joinCount, 5]
  6169.    joins[m.joinCount, 1] = m.key
  6170.    joins[m.joinCount, 2] = m.tovpos
  6171.    joins[m.JoinCount, 3] = m.tohpos
  6172.    joins[m.JoinCount, 4] = m.vmatch
  6173.    joins[m.JoinCount, 5] = m.hmatch
  6174. ELSE
  6175.    m.row = ASUBSCRIPT(joins, m.row, 1)
  6176.    
  6177.    IF m.vmatch > joins[m.row, 4]
  6178.       joins[m.row, 2] = m.tovpos
  6179.       joins[m.row, 4] = m.vmatch
  6180.    ENDIF
  6181.    
  6182.    IF m.hmatch > joins[m.JoinCount, 5]
  6183.       joins[m.row, 3] = m.tohpos
  6184.       joins[m.row, 5] = m.hmatch
  6185.    ENDIF
  6186. ENDIF
  6187.  
  6188. RETURN
  6189.  
  6190. *
  6191. * RejoinBoxes - This routine stretches lines so that they meet the join characters
  6192. *      they did in the from platform.
  6193. *
  6194. *!*****************************************************************************
  6195. *!
  6196. *!      Procedure: REJOINBOXES
  6197. *!
  6198. *!      Called by: JOINLINES          (procedure in TRANSPRT.PRG)
  6199. *!
  6200. *!          Calls: JOINLINEWIDTH()    (function  in TRANSPRT.PRG)
  6201. *!               : GETLINEWIDTH()     (function  in TRANSPRT.PRG)
  6202. *!
  6203. *!*****************************************************************************
  6204. PROCEDURE rejoinboxes
  6205. PARAMETER m.fromvpos, m.fromhpos, m.tovpos, m.tohpos
  6206. PRIVATE m.objectcode, m.objend, m.saverecno, m.objid, m.joinwidth, m.objrec
  6207.  
  6208. m.saverecno = RECNO()
  6209.  
  6210. SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox
  6211.    IF WIDTH = 1 OR HEIGHT = 1
  6212.       m.objid = uniqueid
  6213.       m.objectcode = objcode
  6214.       m.objrec = RECNO()
  6215.       
  6216.       DO CASE
  6217.          ** A Vertical line which starts at a join character
  6218.       CASE m.fromvpos = vpos AND m.fromhpos = hpos AND WIDTH = 1
  6219.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  6220.          IF FOUND()
  6221.             m.objend = vpos + HEIGHT
  6222.             m.joinwidth = joinlinewidth(m.fromvpos, m.fromhpos, .T., m.objid)
  6223.             REPLACE vpos WITH m.tovpos + c_adjbox - (m.joinwidth/2)
  6224.             REPLACE HEIGHT WITH m.objend - vpos
  6225.             REPLACE hpos WITH m.tohpos + c_adjbox - (getlinewidth(m.objectcode, .F.)/2)
  6226.          ENDIF
  6227.          
  6228.          ** A Horizontal line which starts at a join character
  6229.       CASE m.fromvpos = vpos AND m.fromhpos = hpos AND HEIGHT = 1
  6230.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  6231.          IF FOUND()
  6232.             m.objend = hpos + WIDTH
  6233.             m.joinwidth = joinlinewidth(m.fromvpos, m.fromhpos, .F., m.objid)
  6234.             REPLACE hpos WITH m.tohpos + c_adjbox - (m.joinwidth/2)
  6235.             REPLACE WIDTH WITH m.objend - hpos
  6236.             REPLACE vpos WITH m.tovpos + c_adjbox - (getlinewidth(m.objectcode, .T.)/2)
  6237.          ENDIF
  6238.          
  6239.          ** A Vertical line which ends at a join character
  6240.       CASE m.fromvpos = (vpos+HEIGHT-1) AND m.fromhpos = hpos AND WIDTH = 1
  6241.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  6242.          IF FOUND()
  6243.             m.joinwidth = joinlinewidth(m.fromvpos, m.fromhpos, .T., m.objid)
  6244.             REPLACE HEIGHT WITH (m.tovpos + c_adjbox + (m.joinwidth/2)) - vpos
  6245.             REPLACE hpos WITH m.tohpos + c_adjbox - (getlinewidth(m.objectcode, .F.)/2)
  6246.          ENDIF
  6247.          
  6248.          ** A Horizontal line which ends at a join character
  6249.       CASE m.fromhpos = (hpos+WIDTH-1) AND m.fromvpos = vpos AND HEIGHT = 1
  6250.          LOCATE FOR platform = m.g_toplatform AND uniqueid = m.objid
  6251.          IF FOUND()
  6252.             m.joinwidth = joinlinewidth(m.fromvpos, m.fromhpos, .F., m.objid)
  6253.             REPLACE WIDTH WITH (m.tohpos + c_adjbox + (m.joinwidth/2)) - hpos
  6254.             REPLACE vpos WITH m.tovpos + c_adjbox - (getlinewidth(m.objectcode, .T.)/2)
  6255.          ENDIF
  6256.       ENDCASE
  6257.       
  6258.       GOTO RECORD m.objrec
  6259.    ENDIF
  6260. ENDSCAN
  6261.  
  6262. IF m.saverecno > RECCOUNT()
  6263.    LOCATE FOR .F.
  6264. ELSE
  6265.    GOTO RECORD m.saverecno
  6266. ENDIF
  6267.  
  6268. RETURN
  6269.  
  6270. *
  6271. * JoinLineWidth - Looks for the thickest line or box which goes through a given point and
  6272. *      Returns either its horizontal or vertical Width.
  6273. *
  6274. *!*****************************************************************************
  6275. *!
  6276. *!       Function: JOINLINEWIDTH
  6277. *!
  6278. *!      Called by: REJOINBOXES        (procedure in TRANSPRT.PRG)
  6279. *!
  6280. *!          Calls: GETLINEWIDTH()     (function  in TRANSPRT.PRG)
  6281. *!
  6282. *!*****************************************************************************
  6283. FUNCTION joinlinewidth
  6284. PARAMETERS m.joinvpos, m.joinhpos, m.horizontal, m.skipid
  6285. PRIVATE m.i, m.saverecno, m.thickness
  6286. m.saverecno = RECNO()
  6287. m.thickness = 0
  6288.  
  6289. SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND uniqueid <> m.skipid
  6290.    DO CASE
  6291.    CASE m.horizontal AND WIDTH <> 1 AND ;
  6292.          (ABS(m.joinvpos - vpos) <= 1 OR ABS(m.joinvpos - (vpos+HEIGHT-1)) <= 1) AND ;
  6293.          (m.joinhpos >= hpos AND m.joinhpos <= (hpos+WIDTH-1))
  6294.       m.thickness = MAX(getlinewidth(objcode, .T.), m.thickness)
  6295.       
  6296.    CASE !m.horizontal AND HEIGHT <> 1 AND ;
  6297.          (ABS(m.joinhpos - hpos) <= 1 OR ABS(m.joinhpos - (hpos+WIDTH-1)) <= 1) AND ;
  6298.          (m.joinvpos >= vpos AND m.joinvpos <= (vpos+WIDTH-1))
  6299.       m.thickness = MAX(getlinewidth(objcode, .F.), m.thickness)
  6300.    ENDCASE
  6301. ENDSCAN
  6302.  
  6303. IF m.thickness = 0
  6304.    SCAN FOR platform = m.g_fromplatform AND objtype = c_otbox AND uniqueid <> m.skipid
  6305.       IF (HEIGHT = 1 OR WIDTH = 1) AND ;
  6306.             (ABS(m.joinvpos - vpos) <= 1 OR ABS(m.joinvpos - (vpos+HEIGHT-1)) <= 1) AND ;
  6307.             (ABS(m.joinhpos - hpos) <= 1 OR ABS(m.joinhpos - (hpos+WIDTH-1)) <= 1)
  6308.          m.thickness = MAX(getlinewidth(objcode, m.horizontal), m.thickness)
  6309.       ENDIF
  6310.    ENDSCAN
  6311. ENDIF
  6312.  
  6313. GOTO RECORD m.saverecno
  6314. RETURN m.thickness
  6315.  
  6316. *
  6317. * getLastObjectLine - Determine if this object is the lowest object.
  6318. *
  6319. *!*****************************************************************************
  6320. *!
  6321. *!       Function: GETLASTOBJECTLINE
  6322. *!
  6323. *!      Called by: REPOOBJECTS        (procedure in TRANSPRT.PRG)
  6324. *!
  6325. *!          Calls: HORIZBUTTON()      (function  in TRANSPRT.PRG)
  6326. *!
  6327. *!*****************************************************************************
  6328. FUNCTION getlastobjectline
  6329. PARAMETER m.currentlastline, m.newposition
  6330. PRIVATE m.numitems, m.max
  6331.  
  6332. DO CASE
  6333. CASE objtype = c_ottext OR objtype = c_otchkbox
  6334.    IF vpos > m.currentlastline
  6335.       g_lastobjectline[2] = m.newposition + HEIGHT
  6336.       RETURN vpos + HEIGHT
  6337.    ELSE
  6338.       RETURN m.currentlastline
  6339.    ENDIF
  6340.    
  6341. CASE objtype = c_otradbut OR objtype = c_ottxtbut OR objtype = c_otinvbut
  6342.    IF horizbutton(PICTURE)
  6343.       IF vpos + HEIGHT >= m.currentlastline
  6344.          g_lastobjectline[2] = m.newposition + HEIGHT
  6345.          RETURN vpos
  6346.       ELSE
  6347.          RETURN m.currentlastline
  6348.       ENDIF
  6349.    ELSE
  6350.       m.numitems = OCCURS(';',PICTURE)
  6351.       m.max = vpos + m.numitems + (m.numitems * spacing)
  6352.       IF m.max >= m.currentlastline AND (objtype = c_ottxtbut OR objtype = c_otinvbut) OR ;
  6353.             m.max > m.currentlastline AND objtype = c_otradbut
  6354.          g_lastobjectline[2] = m.newposition + (HEIGHT * (m.numitems + 1)) + ;
  6355.             (spacing * m.numitems)
  6356.          RETURN m.max + 1
  6357.       ELSE
  6358.          RETURN m.currentlastline
  6359.       ENDIF
  6360.    ENDIF
  6361.    
  6362. CASE objtype = c_otpopup
  6363.    IF vpos + 2 > m.currentlastline
  6364.       g_lastobjectline[2] = m.newposition + 2
  6365.       RETURN vpos +1
  6366.    ELSE
  6367.       RETURN m.currentlastline
  6368.    ENDIF
  6369.    
  6370. CASE objtype = c_otfield
  6371.    IF vpos + HEIGHT -1 > m.currentlastline
  6372.       g_lastobjectline[2] = m.newposition + HEIGHT
  6373.       RETURN vpos + HEIGHT -1
  6374.    ELSE
  6375.       RETURN m.currentlastline
  6376.    ENDIF
  6377.    
  6378. CASE objtype = c_otlist OR ;
  6379.       objtype = c_otbox OR objtype = c_otline
  6380.    IF vpos + HEIGHT - 1 > m.currentlastline
  6381.       g_lastobjectline[2] = m.newposition + HEIGHT
  6382.       RETURN vpos + HEIGHT - 1
  6383.    ELSE
  6384.       RETURN m.currentlastline
  6385.    ENDIF
  6386.    
  6387. OTHERWISE
  6388.    RETURN m.currentlastline
  6389.    
  6390. ENDCASE
  6391.  
  6392. *
  6393. * adjobjcode - Adjust object code field for Objtype = 1.
  6394. *
  6395. *!*****************************************************************************
  6396. *!
  6397. *!      Procedure: ADJOBJCODE
  6398. *!
  6399. *!      Called by: ALLENVIRONS        (procedure in TRANSPRT.PRG)
  6400. *!
  6401. *!*****************************************************************************
  6402. PROCEDURE adjobjcode
  6403. * Stuff the right version code into the object code field for the header record
  6404. DO CASE
  6405. CASE objtype = c_otheader OR (m.g_filetype=c_label AND objtype = c_ot20label)
  6406.    REPLACE objcode WITH IIF(m.g_filetype=c_screen,c_25scx,c_25frx)
  6407. CASE objtype = c_otgroup
  6408.    REPLACE objcode WITH 0
  6409. ENDCASE
  6410.  
  6411. *!*****************************************************************************
  6412. *!
  6413. *!      Procedure: GETWINDFONT
  6414. *!
  6415. *!      Called by: NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  6416. *!
  6417. *!          Calls: WHATSTYLE()        (function  in TRANSPRT.PRG)
  6418. *!
  6419. *!*****************************************************************************
  6420. PROCEDURE getwindfont
  6421. * Get the default font for this window, if one has been defined
  6422. IF m.g_tographic
  6423.    * Get font information from header
  6424.    GOTO TOP
  6425.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  6426.    IF FOUND() AND !EMPTY(fontface)
  6427.       m.g_fontface  = fontface
  6428.       m.g_fontsize  = fontsize
  6429.       m.g_fontstyle = whatstyle(fontstyle)
  6430.    ENDIF
  6431. ENDIF
  6432.  
  6433. *
  6434. * adjHeightAndWidth - Adjust the Height and width of objects.
  6435. *
  6436. *!*****************************************************************************
  6437. *!
  6438. *!      Procedure: ADJHEIGHTANDWIDTH
  6439. *!
  6440. *!      Called by: NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  6441. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  6442. *!
  6443. *!          Calls: WHATSTYLE()        (function  in TRANSPRT.PRG)
  6444. *!               : DOSSIZE()          (function  in TRANSPRT.PRG)
  6445. *!               : COLUMNAR()         (function  in TRANSPRT.PRG)
  6446. *!               : ADJTEXT            (procedure in TRANSPRT.PRG)
  6447. *!               : ADJBITMAPCTRL      (procedure in TRANSPRT.PRG)
  6448. *!               : MAXBTNWIDTH()      (function  in TRANSPRT.PRG)
  6449. *!               : ADJBOX             (procedure in TRANSPRT.PRG)
  6450. *!
  6451. *!*****************************************************************************
  6452. PROCEDURE adjheightandwidth
  6453. PRIVATE m.txtwidthratio, m.boldtxtratio, m.chkboxwidth, m.saverec, ;
  6454.    m.oldwidth, m.newheight, m.newwidth, ;
  6455.    m.wndface, m.wndsize, m.wndstyle, m.alignment
  6456.  
  6457. IF m.g_tographic
  6458.    m.saverec = RECNO()
  6459.    * Get font information from header
  6460.    LOCATE FOR platform = m.g_toplatform AND objtype = c_otheader
  6461.    IF FOUND()
  6462.       m.wndface  = fontface
  6463.       m.wndsize  = fontsize
  6464.       m.wndstyle = fontstyle
  6465.    ELSE
  6466.       m.wndface  = m.g_fontface
  6467.       m.wndsize  = m.g_fontsize
  6468.       m.wndstyle = m.g_fontstyle
  6469.    ENDIF
  6470.    GOTO m.saverec
  6471.    
  6472.    * This is the ratio of character size for the window font to that for the current object font
  6473.    m.txtwidthratio = FONTMETRIC(6, m.wndface, m.wndsize, whatstyle(m.wndstyle)) / ;
  6474.       FONTMETRIC(6,fontface,fontsize,whatstyle(fontstyle))
  6475.    m.boldtxtratio = FONTMETRIC(6, m.wndface, m.wndsize, whatstyle(m.wndstyle)) / ;
  6476.       FONTMETRIC(6,m.g_fontface,m.g_fontsize,whatstyle(m.g_boldstyle))
  6477.    m.chkboxwidth = c_chkpixel / FONTMETRIC(6,m.g_fontface,m.g_fontsize,whatstyle(m.g_boldstyle))
  6478.    m.chkboxwidth = m.chkboxwidth + (m.chkboxwidth / 2)
  6479. ELSE
  6480.    m.saverec = RECNO()
  6481.    LOCATE FOR platform = m.g_fromplatform AND objtype = c_otheader
  6482.    IF FOUND()
  6483.       m.wndface = fontface
  6484.       m.wndsize = fontsize
  6485.       m.wndstyle = fontstyle
  6486.    ELSE
  6487.       m.wndface  = "MS Sans Serif"
  6488.       m.wndsize  = 8
  6489.       m.wndstyle = "B"
  6490.    ENDIF
  6491.    GOTO m.saverec
  6492. ENDIF
  6493.  
  6494. DO CASE
  6495. CASE objtype = c_ottext
  6496.    IF m.g_tographic
  6497.       m.oldwidth = WIDTH
  6498.       REPLACE WIDTH WITH TXTWIDTH(SUBSTR(expr, 2,LEN(expr)-2), fontface, ;
  6499.          fontsize, whatstyle(fontstyle)) && * m.txtwidthratio
  6500.    ELSE
  6501.       m.oldwidth = ROUND(dossize(WIDTH, fontsize, m.wndsize), 0)
  6502.       m.newheight = 1
  6503.       m.newwidth = LEN(expr)-2
  6504.       
  6505.       m.alignment = columnar(vpos, hpos, WIDTH, objtype)
  6506.       DO CASE
  6507.       CASE m.alignment = 2
  6508.          REPLACE hpos WITH hpos + WIDTH - m.newwidth
  6509.          
  6510.       CASE m.alignment = 0
  6511.          REPLACE vpos WITH vpos + ((HEIGHT - m.newheight) / 2)
  6512.          REPLACE hpos WITH hpos + ((WIDTH - m.newwidth) / 2)
  6513.       ENDCASE
  6514.       
  6515.       REPLACE HEIGHT WITH MAX(m.newheight,1)
  6516.       REPLACE WIDTH WITH MAX(m.newwidth,1)
  6517.       
  6518.       DO adjtext WITH m.oldwidth
  6519.    ENDIF
  6520.    
  6521. CASE objtype = c_otchkbox
  6522.    IF m.g_tographic
  6523.       m.oldwidth = WIDTH
  6524.       REPLACE WIDTH WITH (TXTWIDTH(SUBSTR(PICTURE, 6,LEN(PICTURE)-6) + SPACE(1), fontface, ;
  6525.          fontsize, whatstyle(fontstyle)) * m.boldtxtratio) + m.chkboxwidth
  6526.       REPLACE HEIGHT WITH c_chkhght
  6527.    ELSE
  6528.       DO adjbitmapctrl
  6529.       
  6530.       REPLACE HEIGHT WITH 1
  6531.       REPLACE WIDTH WITH maxbtnwidth(PICTURE, "", "", "")+4
  6532.    ENDIF
  6533.    
  6534. CASE objtype = c_otradbut
  6535.    IF m.g_tographic
  6536.       m.oldwidth = WIDTH
  6537.       DO adjbitmapctrl
  6538.       REPLACE HEIGHT WITH c_radhght
  6539.    ELSE
  6540.       REPLACE HEIGHT WITH 1
  6541.       REPLACE spacing WITH ROUND(dossize(spacing, fontsize, m.wndsize), 0)
  6542.       REPLACE WIDTH WITH MAX(maxbtnwidth(PICTURE, "", "", "")+4, dossize(WIDTH, fontsize, m.wndsize))
  6543.    ENDIF
  6544.    
  6545. CASE objtype = c_otpopup
  6546.    IF m.g_tographic
  6547.       REPLACE HEIGHT WITH c_pophght
  6548.    ELSE
  6549.       m.newheight = 3
  6550.       REPLACE vpos WITH MAX(vpos + ((HEIGHT - m.newheight) / 2),0)
  6551.       REPLACE HEIGHT WITH m.newheight
  6552.       REPLACE WIDTH WITH dossize(WIDTH, fontsize, m.wndsize)
  6553.    ENDIF
  6554.    
  6555. CASE objtype = c_ottxtbut
  6556.    IF m.g_tographic
  6557.       REPLACE HEIGHT WITH HEIGHT + c_adjtbtn
  6558.    ELSE
  6559.       DO adjbitmapctrl
  6560.       
  6561.       REPLACE HEIGHT WITH 1
  6562.       REPLACE spacing WITH ROUND(dossize(spacing, fontsize, m.wndsize), 0)
  6563.       REPLACE WIDTH WITH MAX(maxbtnwidth(PICTURE, "", "", "")+2, dossize(WIDTH, fontsize, m.wndsize))
  6564.    ENDIF
  6565.    
  6566. CASE objtype = c_otfield
  6567.    IF m.g_tographic
  6568.       REPLACE HEIGHT WITH HEIGHT + c_adjfld
  6569.    ELSE
  6570.       IF INLIST(objcode,0,1)
  6571.          REPLACE height WITH 1
  6572.       ELSE
  6573.          REPLACE HEIGHT WITH MAX(dossize(HEIGHT, fontsize, m.wndsize),1)
  6574.       ENDIF
  6575.       REPLACE WIDTH WITH MAX(dossize(WIDTH, fontsize, m.wndsize),1)
  6576.    ENDIF
  6577.    
  6578. CASE objtype = c_otline OR objtype = c_otbox
  6579.    IF !m.g_tographic
  6580.       DO adjbox
  6581.    ENDIF
  6582. ENDCASE
  6583.  
  6584. IF !g_tographic
  6585.    REPLACE vpos WITH MAX(vpos,0)
  6586.    REPLACE hpos WITH MAX(hpos,0)
  6587. ENDIF
  6588.  
  6589. *
  6590. * Columnar - This function takes and object and checks to see if it
  6591. *      is right or left aligned with other objects in a column.
  6592. *      Return values are:
  6593. *         0 - Not aligned
  6594. *         1 - Left aligned
  6595. *         2 - Right aligned
  6596. *
  6597. *!*****************************************************************************
  6598. *!
  6599. *!       Function: COLUMNAR
  6600. *!
  6601. *!      Called by: ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  6602. *!
  6603. *!*****************************************************************************
  6604. FUNCTION columnar
  6605. PARAMETER m.vpos, m.hpos, m.type, m.otype
  6606. PRIVATE m.saverec
  6607.  
  6608. m.saverec = RECNO()
  6609.  
  6610. LOCATE FOR platform = m.g_fromplatform AND objtype = m.type AND ;
  6611.    hpos = m.hpos AND ABS(vpos - m.vpos) < m.vpos * 2
  6612. IF FOUND()
  6613.    GOTO RECORD (m.saverec)
  6614.    RETURN 1
  6615. ENDIF
  6616.  
  6617. LOCATE FOR platform = m.g_fromplatform AND objtype = m.type AND ;
  6618.    hpos + WIDTH = m.hpos + m.width  AND ;
  6619.    ABS(vpos - m.vpos) < m.vpos * 2
  6620. IF FOUND()
  6621.    GOTO RECORD (m.saverec)
  6622.    RETURN 2
  6623. ENDIF
  6624.  
  6625. GOTO RECORD (m.saverec)
  6626. RETURN 0
  6627.  
  6628. *
  6629. * DOSSize - This function attempts to normalize a dimension of an object to the font used for the
  6630. *      window it lies in.  Unfortunately, we can't use FONTMETRIC since this needs to run on a character
  6631. *      platform.  We use the ratio of point sizes.
  6632. *
  6633. *!*****************************************************************************
  6634. *!
  6635. *!       Function: DOSSIZE
  6636. *!
  6637. *!      Called by: ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  6638. *!
  6639. *!*****************************************************************************
  6640. FUNCTION dossize
  6641. PARAMETER m.size, m.objsize, m.scrnsize
  6642. RETURN m.size * (m.objsize / m.scrnsize)
  6643.  
  6644. *
  6645. * AdjBitmapCtrl - Take the Picture clause for a control, see if it is a bitmap and
  6646. *      turn it into something that a character platform can handle.
  6647. *
  6648. *!*****************************************************************************
  6649. *!
  6650. *!      Procedure: ADJBITMAPCTRL
  6651. *!
  6652. *!      Called by: ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  6653. *!
  6654. *!          Calls: STRIPPATH()        (function  in TRANSPRT.PRG)
  6655. *!
  6656. *!*****************************************************************************
  6657. PROCEDURE adjbitmapctrl
  6658. PRIVATE m.function, m.oldpicture, m.newpicture, m.temp
  6659.  
  6660. m.function = ALLTRIM(SUBSTR(PICTURE, 1, AT(" ", PICTURE)))
  6661.  
  6662. IF AT("B", m.function) <> 0
  6663.    m.function = CHRTRAN(m.function, "B", "")
  6664.    m.oldpicture = ALLTRIM(SUBSTR(PICTURE, AT(" ", PICTURE)))
  6665.    m.newpicture = ""
  6666.    
  6667.    DO WHILE LEN(m.oldpicture) > 0
  6668.       IF AT(";", m.oldpicture) = 0
  6669.          m.temp = LEFT(m.oldpicture, LEN(m.oldpicture)-1)
  6670.          m.oldpicture = ""
  6671.       ELSE
  6672.          m.temp = LEFT(m.oldpicture, AT(";", m.oldpicture)-1)
  6673.          m.oldpicture = SUBSTR(m.oldpicture, AT(";", m.oldpicture)+1)
  6674.       ENDIF
  6675.       
  6676.       IF LEN(m.newpicture) = 0
  6677.          m.newpicture = ALLTRIM(strippath(m.temp))
  6678.       ELSE
  6679.          m.newpicture = m.newpicture + ";" + ALLTRIM(strippath(m.temp))
  6680.       ENDIF
  6681.    ENDDO
  6682.    
  6683.    REPLACE PICTURE WITH m.function + " " + m.newpicture + '"'
  6684. ENDIF
  6685.  
  6686. RETURN
  6687. *
  6688. * AdjColor - Adjust color fields in the database.
  6689. *
  6690. *!*****************************************************************************
  6691. *!
  6692. *!      Procedure: ADJCOLOR
  6693. *!
  6694. *!      Called by: ALLENVIRONS        (procedure in TRANSPRT.PRG)
  6695. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  6696. *!               : RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  6697. *!               : LABELLINES         (procedure in TRANSPRT.PRG)
  6698. *!
  6699. *!          Calls: CONVERTCOLORPAIR   (procedure in TRANSPRT.PRG)
  6700. *!               : RGBTOX()           (function  in TRANSPRT.PRG)
  6701. *!
  6702. *!*****************************************************************************
  6703. PROCEDURE adjcolor
  6704. IF m.g_tographic
  6705.    IF m.g_filetype = c_report OR m.g_filetype = c_label OR EMPTY(colorpair)
  6706.       IF m.g_filetype = c_screen
  6707.          REPLACE colorpair WITH ""
  6708.          REPLACE penred    WITH -1
  6709.          REPLACE pengreen  WITH -1
  6710.          REPLACE penblue   WITH -1
  6711.          REPLACE fillred   WITH -1
  6712.          REPLACE fillgreen WITH -1
  6713.          REPLACE fillblue  WITH -1
  6714.       ELSE
  6715.          REPLACE penred    WITH 0
  6716.          REPLACE pengreen  WITH 0
  6717.          REPLACE penblue   WITH 0
  6718.          IF objtype = c_otline
  6719.             REPLACE fillred   WITH 0
  6720.             REPLACE fillgreen WITH 0
  6721.             REPLACE fillblue  WITH 0
  6722.          ELSE
  6723.             REPLACE fillred   WITH 255
  6724.             REPLACE fillgreen WITH 255
  6725.             REPLACE fillblue  WITH 255
  6726.          ENDIF
  6727.       ENDIF
  6728.    ELSE
  6729.       DO convertcolorpair
  6730.    ENDIF
  6731. ELSE
  6732.    IF m.g_filetype = c_screen
  6733.       DO CASE
  6734.       CASE objtype = c_otheader
  6735.          DO CASE
  6736.          CASE STYLE = c_user
  6737.             IF SCHEME + scheme2 = 0
  6738.                REPLACE SCHEME WITH 1
  6739.                REPLACE scheme2 WITH 2
  6740.             ENDIF
  6741.             
  6742.          CASE STYLE = c_system
  6743.             REPLACE SCHEME WITH 8
  6744.             REPLACE scheme2 WITH 9
  6745.             
  6746.          CASE STYLE = c_dialog
  6747.             REPLACE SCHEME WITH 5
  6748.             REPLACE scheme2 WITH 6
  6749.             
  6750.          CASE STYLE = c_alert
  6751.             REPLACE SCHEME WITH 7
  6752.             REPLACE SCHEME WITH 12
  6753.          ENDCASE
  6754.          
  6755.       CASE c_maptextcolor AND INLIST(objtype,c_otbox, c_otline,c_ottext)
  6756.          IF penred <> -1 OR fillred <> -1
  6757.             REPLACE colorpair WITH rgbtox(penred, penblue, pengreen) + "/" + ;
  6758.                rgbtox(fillred, fillblue, fillgreen)
  6759.             * Don't let it map to black on black
  6760.             IF colorpair = "N/N" OR TRIM(colorpair) == "/"
  6761.                REPLACE colorpair WITH ""
  6762.             ENDIF
  6763.          ENDIF
  6764.       OTHERWISE
  6765.           REPLACE scheme WITH 0   && default color scheme for everything else
  6766.       ENDCASE
  6767.    ENDIF
  6768. ENDIF
  6769.  
  6770. *
  6771. * RGBToX - Convert an RGB triplet to a traditional xBase color letter
  6772. *
  6773. *!*****************************************************************************
  6774. *!
  6775. *!       Function: RGBTOX
  6776. *!
  6777. *!      Called by: ADJCOLOR           (procedure in TRANSPRT.PRG)
  6778. *!
  6779. *!*****************************************************************************
  6780. FUNCTION rgbtox
  6781. PARAMETERS m.red, m.blue, m.green
  6782. PRIVATE m.color
  6783.  
  6784. *
  6785. * If it is automatic, we skip it.
  6786. *
  6787. IF m.red < 0 OR m.blue < 0 OR m.green < 0
  6788.    RETURN ""
  6789. ENDIF
  6790.  
  6791. *
  6792. * We use a special triplet for Light Gray which makes it a special case.
  6793. *
  6794. IF m.red = 192 AND m.blue = 192 AND m.green = 192
  6795.    RETURN "W"
  6796. ENDIF
  6797.  
  6798. *
  6799. * This division makes sure that we give a letter for any possible triplet
  6800. *
  6801. m.red   = ROUND(m.red / 127, 0)
  6802. m.blue = ROUND(m.blue / 127, 0)
  6803. m.green = ROUND(m.green / 127, 0)
  6804.  
  6805. *
  6806. * Save some time by getting a number we can make a single comparison against
  6807. *
  6808. m.color = (m.red * 100) + (m.blue * 10) + m.green
  6809.  
  6810. DO CASE
  6811. CASE m.color = 222      && White
  6812.    RETURN "W+"
  6813. CASE m.color = 0        && Black
  6814.    RETURN "N"
  6815. CASE m.color = 111      && Dark Gray
  6816.    RETURN "N+"
  6817. CASE m.color = 200      && Light Red
  6818.    RETURN "R+"
  6819. CASE m.color = 100      && Dark Red
  6820.    RETURN "R"
  6821. CASE m.color = 220      && Yellow
  6822.    RETURN "GR+"
  6823. CASE m.color = 110      && Brown
  6824.    RETURN "GR"
  6825. CASE m.color = 2        && Light green
  6826.    RETURN "G+"
  6827. CASE m.color = 1        && Dark Green
  6828.    RETURN "G"
  6829. CASE m.color = 22       && Light Magenta
  6830.    RETURN "BG+"
  6831. CASE m.color = 11       && Dark Magenta
  6832.    RETURN "BG"
  6833. CASE m.color = 20       && Light Blue
  6834.    RETURN "B+"
  6835. CASE m.color = 10       && Dark Blue
  6836.    RETURN "B"
  6837. CASE m.color = 202      && Light Purple
  6838.    RETURN "RB+"
  6839. CASE m.color = 101      && Dark Purple
  6840.    RETURN "RB"
  6841. ENDCASE
  6842.  
  6843. RETURN ""      && It shouldn't be possible to reach this point.
  6844.  
  6845. *
  6846. * \ - Adjust pen attributes.
  6847. *
  6848. *!*****************************************************************************
  6849. *!
  6850. *!      Procedure: ADJPEN
  6851. *!
  6852. *!      Called by: FILLININFO         (procedure in TRANSPRT.PRG)
  6853. *!
  6854. *!*****************************************************************************
  6855. PROCEDURE adjpen
  6856. IF m.g_tographic
  6857.    DO CASE
  6858.    CASE objtype = c_ottext
  6859.       REPLACE pensize WITH 1
  6860.       REPLACE penpat  WITH 0
  6861.       REPLACE fillpat WITH 0
  6862.       
  6863.    OTHERWISE
  6864.       REPLACE pensize WITH 0
  6865.       REPLACE penpat  WITH 0
  6866.       REPLACE fillpat WITH 0
  6867.    ENDCASE
  6868. ENDIF
  6869.  
  6870. *
  6871. * adjfont - Adjust font fields in the SCX or FRX database.
  6872. *
  6873. *!*****************************************************************************
  6874. *!
  6875. *!      Procedure: ADJFONT
  6876. *!
  6877. *!      Called by: ALLENVIRONS        (procedure in TRANSPRT.PRG)
  6878. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  6879. *!               : RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  6880. *!               : LABELLINES         (procedure in TRANSPRT.PRG)
  6881. *!
  6882. *!*****************************************************************************
  6883. PROCEDURE adjfont
  6884. PRIVATE m.i
  6885.  
  6886. IF m.g_tographic
  6887.    DO CASE
  6888.    CASE objtype = c_ottxtbut OR ;
  6889.          objtype = c_otradbut OR ;
  6890.          objtype = c_otchkbox OR ;
  6891.          objtype = c_otheader OR ;
  6892.          objtype = c_otinvbut OR ;
  6893.          objtype = c_otspinner OR ;
  6894.          objtype = c_otbox OR ;
  6895.          objtype = c_otline
  6896.       
  6897.       REPLACE fontface  WITH m.g_cfontface
  6898.       REPLACE fontsize  WITH m.g_cfontsize
  6899.       REPLACE fontstyle WITH m.g_boldstyle
  6900.       
  6901.    CASE objtype = c_otpopup
  6902.       REPLACE fontface  WITH m.g_cfontface
  6903.       REPLACE fontsize  WITH m.g_cfontsize
  6904.       REPLACE fontstyle WITH m.g_normstyle
  6905.       
  6906.    CASE objtype = c_ottext
  6907.       REPLACE fontface  WITH m.g_fontface
  6908.       REPLACE fontsize  WITH m.g_fontsize
  6909.       REPLACE fontstyle WITH m.g_boldstyle
  6910.       
  6911.    CASE objtype = c_otfield
  6912.       REPLACE fontface  WITH m.g_fontface
  6913.       REPLACE fontsize  WITH m.g_fontsize
  6914.       REPLACE fontstyle WITH m.g_normstyle
  6915.       
  6916.    OTHERWISE
  6917.       REPLACE fontface  WITH m.g_fontface
  6918.       REPLACE fontsize  WITH m.g_fontsize
  6919.       REPLACE fontstyle WITH m.g_normstyle
  6920.    ENDCASE
  6921. ENDIF
  6922.  
  6923. *
  6924. * convertColorPair - Convert the color pair to appropriate RGB pen
  6925. *               and fill values.
  6926. *
  6927. *!*****************************************************************************
  6928. *!
  6929. *!      Procedure: CONVERTCOLORPAIR
  6930. *!
  6931. *!      Called by: ADJCOLOR           (procedure in TRANSPRT.PRG)
  6932. *!
  6933. *!          Calls: GETCOLOR()         (function  in TRANSPRT.PRG)
  6934. *!
  6935. *!*****************************************************************************
  6936. PROCEDURE convertcolorpair
  6937. PRIVATE m.oldscheme, m.rgbvalue, m.comma, m.frg, m.bkg
  6938.  
  6939. * Translate foreground colors
  6940. m.frg = UPPER(CHRTRAN(LEFT(colorpair,AT('/',colorpair)-1),'-*/, ',''))
  6941. REPLACE penred    WITH -1
  6942. REPLACE pengreen  WITH -1
  6943. REPLACE penblue   WITH -1
  6944. IF "W" $ m.frg
  6945.    REPLACE penred    WITH IIF('+' $ m.frg,255,128)
  6946.    REPLACE pengreen  WITH IIF('+' $ m.frg,255,128)
  6947.    REPLACE penblue   WITH IIF('+' $ m.frg,255,128)
  6948. ENDIF
  6949. IF "N" $ m.frg
  6950.    REPLACE penred    WITH 0
  6951.    REPLACE pengreen  WITH 0
  6952.    REPLACE penblue   WITH 0
  6953. ENDIF
  6954. IF "R" $ m.frg    && red
  6955.    REPLACE penred    WITH IIF('+' $ m.frg,255,128)
  6956. ENDIF
  6957. IF "G" $ m.frg    && green
  6958.    REPLACE pengreen  WITH IIF('+' $ m.frg,255,128)
  6959. ENDIF
  6960. IF "B" $ m.frg    && blue
  6961.    REPLACE penblue   WITH IIF('+' $ m.frg,255,128)
  6962. ENDIF
  6963. REPLACE penred   WITH IIF(penred < 0,0,penred)
  6964. REPLACE pengreen WITH IIF(pengreen < 0,0,pengreen)
  6965. REPLACE penblue  WITH IIF(penblue < 0,0,penblue)
  6966.  
  6967. m.bkg = UPPER(CHRTRAN(SUBSTR(colorpair,AT('/',colorpair)+1,3),'-*/, ',''))
  6968. REPLACE fillred    WITH -1
  6969. REPLACE fillgreen  WITH -1
  6970. REPLACE fillblue   WITH -1
  6971. DO CASE
  6972. CASE m.bkg = "W" OR m.bkg = "W+"    && white
  6973.    REPLACE fillred    WITH IIF('+' $ m.bkg,255,128)
  6974.    REPLACE fillgreen  WITH IIF('+' $ m.bkg,255,128)
  6975.    REPLACE fillblue   WITH IIF('+' $ m.bkg,255,128)
  6976. CASE m.bkg = "N" OR m.bkg = "N+"    && black
  6977.    REPLACE fillred    WITH 0
  6978.    REPLACE fillgreen  WITH 0
  6979.    REPLACE fillblue   WITH 0
  6980. CASE "R" $ m.bkg OR "G" $ m.bkg OR "B" $ m.bkg
  6981.    IF "R" $ m.bkg    && red
  6982.       REPLACE fillred    WITH IIF('+' $ m.bkg,255,128)
  6983.    ENDIF
  6984.    IF "G" $ m.bkg    && green
  6985.       REPLACE fillgreen  WITH IIF('+' $ m.bkg,255,128)
  6986.    ENDIF
  6987.    IF "B" $ m.bkg    && blue
  6988.       REPLACE fillblue   WITH IIF('+' $ m.bkg,255,128)
  6989.    ENDIF
  6990.    REPLACE fillred   WITH IIF(fillred < 0,0,fillred)
  6991.    REPLACE fillgreen WITH IIF(fillgreen < 0,0,fillgreen)
  6992.    REPLACE fillblue  WITH IIF(fillblue < 0,0,fillblue)
  6993. ENDCASE
  6994. RETURN
  6995.  
  6996. * getColor - Return the color value for a specified RGB value.
  6997. *
  6998. *!*****************************************************************************
  6999. *!
  7000. *!       Function: GETCOLOR
  7001. *!
  7002. *!      Called by: CONVERTCOLORPAIR   (procedure in TRANSPRT.PRG)
  7003. *!
  7004. *!*****************************************************************************
  7005. FUNCTION getcolor
  7006. PARAMETER m.rgbstring, m.occurence
  7007. PRIVATE m.comma, m.value
  7008. m.comma = ATC(',', m.rgbstring, m.occurence)
  7009. m.value = SUBSTR(m.rgbstring, m.comma +1, ;
  7010.    ATC(',', m.rgbstring, m.occurence + 1)-m.comma -1)
  7011. RETURN m.value
  7012.  
  7013. *
  7014. *whatStyle - Return the style string which corresponds to the style
  7015. *         stored in screen database.
  7016. *
  7017. *!*****************************************************************************
  7018. *!
  7019. *!       Function: WHATSTYLE
  7020. *!
  7021. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  7022. *!               : FILLININFO         (procedure in TRANSPRT.PRG)
  7023. *!               : ITEMSINBOXES       (procedure in TRANSPRT.PRG)
  7024. *!               : GETWINDFONT        (procedure in TRANSPRT.PRG)
  7025. *!               : ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  7026. *!
  7027. *!*****************************************************************************
  7028. FUNCTION whatstyle
  7029. PARAMETER m.stylenum
  7030. DO CASE
  7031. CASE TYPE("m.stylenum") = "C"
  7032.    * already a character.  Do nothing.
  7033.    RETURN m.stylenum
  7034. CASE !EMPTY(stylenum)
  7035.    DO CASE
  7036.    CASE m.stylenum = 1
  7037.       RETURN "B"
  7038.    CASE m.stylenum = 2
  7039.       RETURN "I"
  7040.    CASE m.stylenum = 3
  7041.       RETURN "BI"
  7042.    ENDCASE
  7043. OTHERWISE
  7044.    RETURN ""
  7045. ENDCASE
  7046.  
  7047. *
  7048. * AdjText - Takes the current record and, if it is a multi-line text object, converts it into
  7049. *      multiple single line text objects.
  7050. *
  7051. *!*****************************************************************************
  7052. *!
  7053. *!      Procedure: ADJTEXT
  7054. *!
  7055. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  7056. *!               : ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  7057. *!
  7058. *!*****************************************************************************
  7059. PROCEDURE adjtext
  7060. PARAMETER m.oldwidth
  7061.  
  7062. PRIVATE m.saverec
  7063.  
  7064. IF objtype <> c_ottext OR AT(CHR(13), expr) = 0 OR ;
  7065.       m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  7066.    RETURN
  7067. ENDIF
  7068.  
  7069. m.saverec = RECNO()
  7070. SCATTER MEMVAR MEMO
  7071.  
  7072. * Update the original records
  7073. m.expr = SUBSTR(m.expr, 2, LEN(m.expr)-2)
  7074. m.pos = AT(CHR(13), m.expr)
  7075. REPLACE expr WITH '"' + LEFT(m.expr, m.pos-1) + '"'
  7076. REPLACE WIDTH WITH LEN(expr)-2
  7077. DO CASE
  7078. CASE m.picture = '"@J"'                        && Right aligned
  7079.    REPLACE hpos WITH hpos + m.oldwidth - WIDTH
  7080. CASE m.picture = '"@I"'                        && Centered
  7081.    REPLACE hpos WITH hpos + (m.oldwidth - WIDTH)/2
  7082. ENDCASE
  7083. m.expr = SUBSTR(m.expr, m.pos+1)
  7084. m.pos = AT(CHR(13), m.expr)
  7085. REPLACE hpos WITH MAX(0,hpos)
  7086.  
  7087. * Write all records but the last
  7088. DO WHILE m.pos > 0
  7089.    m.vpos = m.vpos + IIF(spacing = 1, m.height * 2, m.height)
  7090.    APPEND BLANK
  7091.    GATHER MEMVAR MEMO
  7092.    REPLACE platform WITH LOWER(platform)
  7093.    REPLACE uniqueid WITH SYS(2015)
  7094.    REPLACE expr WITH '"' + LEFT(m.expr, m.pos-1) + '"'
  7095.    REPLACE WIDTH WITH LEN(expr)-2
  7096.    DO CASE
  7097.    CASE m.picture = '"@J"'                     && Right aligned
  7098.       REPLACE hpos WITH hpos + m.oldwidth - WIDTH
  7099.    CASE m.picture = '"@I"'                     && Centered
  7100.       REPLACE hpos WITH hpos + (m.oldwidth - WIDTH)/2
  7101.    ENDCASE
  7102.    
  7103.    m.expr = SUBSTR(m.expr, m.pos+1)
  7104.    m.pos = AT(CHR(13), m.expr)
  7105.    REPLACE hpos WITH MAX(0,hpos)
  7106. ENDDO
  7107.  
  7108. * Write the last record.
  7109. IF LEN(ALLTRIM(m.expr)) <> 0
  7110.    m.vpos = m.vpos + IIF(spacing = 1, m.height * 2, m.height)
  7111.    APPEND BLANK
  7112.    GATHER MEMVAR MEMO
  7113.    REPLACE platform WITH LOWER(platform)
  7114.    REPLACE uniqueid WITH SYS(2015)
  7115.    REPLACE expr WITH '"' + m.expr + '"'
  7116.    REPLACE WIDTH WITH LEN(expr)-2
  7117.    DO CASE
  7118.    CASE m.picture = '"@J"'                     && Right aligned
  7119.       REPLACE hpos WITH hpos + m.oldwidth - WIDTH
  7120.    CASE m.picture = '"@I"'                     && Centered
  7121.       REPLACE hpos WITH hpos + (m.oldwidth - WIDTH)/2
  7122.    ENDCASE
  7123.    REPLACE hpos WITH MAX(0,hpos)
  7124. ENDIF
  7125.  
  7126. GOTO m.saverec
  7127.  
  7128. *
  7129. *
  7130. * AdjBox - Converts a box/line record from character to graphic or graphic to character
  7131. *
  7132. *!*****************************************************************************
  7133. *!
  7134. *!      Procedure: ADJBOX
  7135. *!
  7136. *!      Called by: RPTOBJCONVERT      (procedure in TRANSPRT.PRG)
  7137. *!               : REPOOBJECTS        (procedure in TRANSPRT.PRG)
  7138. *!               : ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  7139. *!
  7140. *!          Calls: GETLINEWIDTH()     (function  in TRANSPRT.PRG)
  7141. *!
  7142. *!*****************************************************************************
  7143. PROCEDURE adjbox
  7144. PARAMETER m.adjust
  7145. IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  7146.    DO CASE
  7147.    CASE objcode = c_sgboxd
  7148.       REPLACE pensize WITH 4
  7149.    CASE objcode = c_sgboxp
  7150.       REPLACE pensize WITH 6
  7151.    OTHERWISE
  7152.       REPLACE pensize WITH 1
  7153.    ENDCASE
  7154.    
  7155.    DO CASE
  7156.    CASE HEIGHT = 1
  7157.       REPLACE HEIGHT WITH getlinewidth(objcode, .T.)
  7158.       REPLACE vpos WITH vpos + c_adjbox - (HEIGHT/2)
  7159.       IF m.g_filetype = c_screen
  7160.          REPLACE STYLE WITH c_lnhorizontal
  7161.       ENDIF
  7162.       
  7163.       REPLACE penpat  WITH 8
  7164.       REPLACE fillpat WITH 0
  7165.       REPLACE objtype WITH c_otline
  7166.       REPLACE objcode WITH 0
  7167.       
  7168.    CASE WIDTH = 1
  7169.       REPLACE WIDTH WITH getlinewidth(objcode, .F.)
  7170.       REPLACE hpos WITH hpos + c_adjbox - (WIDTH/2)
  7171.       IF m.g_filetype = c_screen
  7172.          REPLACE STYLE WITH c_lnvertical
  7173.       ENDIF
  7174.       
  7175.       REPLACE penpat  WITH 8
  7176.       REPLACE fillpat WITH 0
  7177.       REPLACE objtype WITH c_otline
  7178.       REPLACE objcode WITH 0
  7179.       
  7180.    OTHERWISE
  7181.       REPLACE vpos WITH vpos + c_adjbox - (getlinewidth(objcode, .T.)/2) + m.adjust
  7182.       REPLACE hpos WITH hpos + c_adjbox - (getlinewidth(objcode, .F.)/2) + m.adjust
  7183.       REPLACE HEIGHT WITH HEIGHT + getlinewidth(objcode, .T.) - 1
  7184.       REPLACE WIDTH WITH WIDTH + getlinewidth(objcode, .F.) - 1
  7185.       
  7186.       REPLACE penpat  WITH 8
  7187.       REPLACE fillpat WITH 0
  7188.       REPLACE objcode WITH 4
  7189.    ENDCASE
  7190.    
  7191.    IF m.g_filetype = c_screen
  7192.       IF BORDER > 4
  7193.          REPLACE BORDER WITH 1
  7194.       ELSE
  7195.          REPLACE BORDER WITH 0
  7196.       ENDIF
  7197.    ENDIF
  7198. ELSE
  7199.    ******************* Start Graphic to Character Conversion ******************
  7200.    IF fillpat = 0
  7201.       REPLACE fillchar WITH CHR(0)
  7202.    ELSE
  7203.       REPLACE fillchar WITH " "
  7204.    ENDIF
  7205.    
  7206.    DO CASE
  7207.    CASE pensize = 4
  7208.       REPLACE objcode WITH c_sgboxd
  7209.    CASE pensize = 6
  7210.       REPLACE objcode WITH c_sgboxp
  7211.    OTHERWISE
  7212.       REPLACE objcode WITH c_sgbox
  7213.    ENDCASE
  7214.    
  7215.    DO CASE
  7216.    CASE (m.g_filetype = c_screen AND objtype = c_otline and style = c_lnhorizontal) ;
  7217.         OR (objtype = c_otbox and height <=1)
  7218.       REPLACE vpos WITH vpos - c_adjbox
  7219.       REPLACE HEIGHT WITH 1
  7220.    CASE (m.g_filetype = c_screen AND objtype = c_otline and style = c_lnvertical) ;
  7221.         OR (objtype = c_otbox and width <=1)
  7222.       REPLACE hpos WITH hpos-c_adjbox
  7223.       REPLACE width WITH 1
  7224.    OTHERWISE
  7225.       REPLACE vpos WITH vpos-c_adjbox
  7226.       REPLACE hpos WITH hpos-c_adjbox
  7227.       REPLACE HEIGHT WITH HEIGHT+(c_adjbox*2)
  7228.       REPLACE WIDTH WITH WIDTH+(c_adjbox*2)
  7229.    ENDCASE
  7230. ENDIF
  7231.  
  7232. *
  7233. * GetLineWidth - Given an object code for a box or line and a flag indicating
  7234. *      if we want the thickness of a horizontal or vertical size, we return
  7235. *      the thickness of the side.
  7236. *
  7237. *!*****************************************************************************
  7238. *!
  7239. *!       Function: GETLINEWIDTH
  7240. *!
  7241. *!      Called by: JOINHORIZONTAL     (procedure in TRANSPRT.PRG)
  7242. *!               : JOINVERTICAL       (procedure in TRANSPRT.PRG)
  7243. *!               : REJOINBOXES        (procedure in TRANSPRT.PRG)
  7244. *!               : JOINLINEWIDTH()    (function  in TRANSPRT.PRG)
  7245. *!               : ADJBOX             (procedure in TRANSPRT.PRG)
  7246. *!
  7247. *!*****************************************************************************
  7248. FUNCTION getlinewidth
  7249. PARAMETERS m.objcode, m.horizontal
  7250.  
  7251. IF _WINDOWS OR _MAC
  7252.    DO CASE
  7253.    CASE m.objcode = c_sgboxd
  7254.       IF m.g_filetype = c_report
  7255.          RETURN 4 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_rptfface, m.g_rptfsize, m.g_rpttxtfontstyle)
  7256.       ELSE
  7257.          RETURN 4 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_fontface, m.g_fontsize, "B")
  7258.       ENDIF
  7259.       
  7260.    CASE m.objcode = c_sgboxp
  7261.       IF m.g_filetype = c_report
  7262.          RETURN 6 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_rptfface, m.g_rptfsize, m.g_rpttxtfontstyle)
  7263.       ELSE
  7264.          RETURN 6 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_fontface, m.g_fontsize, "B")
  7265.       ENDIF
  7266.       
  7267.    OTHERWISE
  7268.       IF m.g_filetype = c_report
  7269.          RETURN 1 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_rptfface, m.g_rptfsize, m.g_rpttxtfontstyle)
  7270.       ELSE
  7271.          RETURN 1 / FONTMETRIC(IIF(m.horizontal, 1, 6), m.g_fontface, m.g_fontsize, "B")
  7272.       ENDIF
  7273.    ENDCASE
  7274. ELSE
  7275.    RETURN 1
  7276. ENDIF
  7277.  
  7278. *
  7279. * HorizButton - Will return a .T. if the ojbect passed in is a series of
  7280. *            horizontal buttons.  If they are vertical buttons, it
  7281. *            returns .F.
  7282. *
  7283. *!*****************************************************************************
  7284. *!
  7285. *!       Function: HORIZBUTTON
  7286. *!
  7287. *!      Called by: CALCWINDOWDIMENSION(procedure in TRANSPRT.PRG)
  7288. *!               : FINDWIDEROBJECTS   (procedure in TRANSPRT.PRG)
  7289. *!               : REPOOBJECTS        (procedure in TRANSPRT.PRG)
  7290. *!               : ITEMSINBOXES       (procedure in TRANSPRT.PRG)
  7291. *!               : ADJINVBTNS         (procedure in TRANSPRT.PRG)
  7292. *!               : GETLASTOBJECTLINE()(function  in TRANSPRT.PRG)
  7293. *!               : GETOBJWIDTH()      (function  in TRANSPRT.PRG)
  7294. *!               : GETOBJHEIGHT()     (function  in TRANSPRT.PRG)
  7295. *!
  7296. *!*****************************************************************************
  7297. FUNCTION horizbutton
  7298. PARAMETER m.pictclause
  7299.  
  7300. IF OCCURS(';', m.pictclause) = 0 OR ;
  7301.       AT("H", LEFT(m.pictclause, AT(" ", m.pictclause))) != 0
  7302.    RETURN .T.
  7303. ELSE
  7304.    RETURN .F.
  7305. ENDIF
  7306.  
  7307. *
  7308. * MaxBtnWidth - Given the Picture clause for a set of buttons (text or
  7309. *      radio) along with its font information and returns the Width in
  7310. *      foxels of the widest label.
  7311. *
  7312. *!*****************************************************************************
  7313. *!
  7314. *!       Function: MAXBTNWIDTH
  7315. *!
  7316. *!      Called by: ADJHEIGHTANDWIDTH  (procedure in TRANSPRT.PRG)
  7317. *!
  7318. *!*****************************************************************************
  7319. FUNCTION maxbtnwidth
  7320. PARAMETERS m.picture, m.face, m.size, m.style
  7321. PRIVATE m.max, m.label
  7322.  
  7323. m.max = 0
  7324. m.picture = SUBSTR(m.picture, AT(" ", m.picture))
  7325.  
  7326. m.picture = STRTRAN(m.picture, "\\", "")
  7327. m.picture = STRTRAN(m.picture, "\<", "")
  7328. m.picture = STRTRAN(m.picture, "\!", "")
  7329. m.picture = STRTRAN(m.picture, "\?", "")
  7330.  
  7331. DO WHILE LEN(m.picture) != 0
  7332.    IF AT(";", m.picture) != 0
  7333.       m.label = ALLTRIM(LEFT(m.picture, AT(";", m.picture)-1))
  7334.       m.picture = SUBSTR(m.picture, AT(";", m.picture)+1)
  7335.    ELSE
  7336.       m.label = ALLTRIM(LEFT(m.picture, LEN(m.picture)-1))
  7337.       m.picture = ""
  7338.    ENDIF
  7339.    
  7340.    IF m.g_tographic
  7341.       m.max = MAX(m.max, TXTWIDTH(m.label, m.face, m.size, m.style))
  7342.    ELSE
  7343.       m.max = MAX(m.max, LEN(m.label))
  7344.    ENDIF
  7345. ENDDO
  7346.  
  7347. RETURN m.max
  7348.  
  7349. *
  7350. * GetObjWidth - Given a screen object, this function returns its Width.
  7351. *
  7352. *!*****************************************************************************
  7353. *!
  7354. *!       Function: GETOBJWIDTH
  7355. *!
  7356. *!      Called by: ITEMSINBOXES       (procedure in TRANSPRT.PRG)
  7357. *!               : GETRIGHTMOST       (procedure in TRANSPRT.PRG)
  7358. *!
  7359. *!          Calls: HORIZBUTTON()      (function  in TRANSPRT.PRG)
  7360. *!
  7361. *!*****************************************************************************
  7362. FUNCTION getobjwidth
  7363. PARAMETERS m.objtype, m.picture, m.width, m.spacing, m.platform
  7364. PRIVATE m.numitems
  7365.  
  7366. DO CASE
  7367. CASE m.objtype = c_ottext OR m.objtype = c_otfield OR ;
  7368.       m.objtype = c_otline OR m.objtype = c_otbox OR ;
  7369.       m.objtype = c_otlist OR m.objtype = c_otchkbox OR ;
  7370.       m.objtype = c_otpopup OR m.objtype = c_otpicture OR ;
  7371.       m.objtype = c_otspinner OR m.objtype = c_otrepfld
  7372.    RETURN m.width
  7373.    
  7374. CASE m.objtype = c_ottxtbut OR m.objtype = c_otradbut OR m.objtype = c_otinvbut
  7375.    m.numitems = OCCURS(";", m.picture) + 1
  7376.    IF !horizbutton(m.picture) OR m.numitems = 1
  7377.       RETURN m.width
  7378.    ELSE
  7379.       RETURN (m.width * m.numitems) + (m.spacing * (m.numitems - 1))
  7380.    ENDIF
  7381.    
  7382. CASE (m.objtype = c_otbox OR m.objtype = c_otline) AND ;
  7383.       (m.platform = "MAC" OR m.platform = "WINDOWS")
  7384.    RETURN m.width
  7385.    
  7386. CASE (m.objtype = c_otbox OR m.objtype = c_otline) AND ;
  7387.       (m.platform = "DOS" OR m.platform = "UNIX")
  7388.    RETURN m.width-1
  7389.    
  7390. OTHERWISE
  7391.    RETURN m.width
  7392. ENDCASE
  7393.  
  7394. *
  7395. * GetObjHeight - Given a screen object, this function returns its Height.
  7396. *
  7397. *!*****************************************************************************
  7398. *!
  7399. *!       Function: GETOBJHEIGHT
  7400. *!
  7401. *!      Called by: GETLOWEST          (procedure in TRANSPRT.PRG)
  7402. *!
  7403. *!          Calls: HORIZBUTTON()      (function  in TRANSPRT.PRG)
  7404. *!
  7405. *!*****************************************************************************
  7406. FUNCTION getobjheight
  7407. PARAMETERS m.objtype, m.picture, m.height, m.spacing, m.platform
  7408. PRIVATE m.numitems
  7409.  
  7410. DO CASE
  7411. CASE m.objtype = c_ottext OR m.objtype = c_otfield OR ;
  7412.       m.objtype = c_otline OR m.objtype = c_otbox OR ;
  7413.       m.objtype = c_otlist OR m.objtype = c_otchkbox OR ;
  7414.       m.objtype = c_otpopup OR m.objtype = c_otpicture OR ;
  7415.       m.objtype = c_otspinner OR m.objtype = c_otrepfld
  7416.    RETURN m.height
  7417.    
  7418. CASE m.objtype = c_ottxtbut OR m.objtype = c_otradbut OR ;
  7419.       m.objtype = c_otinvbut
  7420.    m.numitems = OCCURS(";", m.picture) + 1
  7421.    
  7422.    IF horizbutton(m.picture) OR m.numitems = 1
  7423.       RETURN m.height
  7424.    ELSE
  7425.       RETURN (m.height * m.numitems) + (m.spacing * (m.numitems - 1))
  7426.    ENDIF
  7427.    
  7428. CASE (m.objtype = c_otbox OR m.objtype = c_otline) AND ;
  7429.       (m.platform = "MAC" OR m.platform = "WINDOWS")
  7430.    RETURN m.height
  7431.    
  7432. CASE (m.objtype = c_otbox OR m.objtype = c_otline) AND ;
  7433.       (m.platform = "DOS" OR m.platform = "UNIX")
  7434.    RETURN m.height-1
  7435.    
  7436. OTHERWISE
  7437.    RETURN m.height
  7438. ENDCASE
  7439.  
  7440. *
  7441. * GetRightmost - Takes a platform and returns the rightmost position occupied by an object
  7442. *      in that platform
  7443. *!*****************************************************************************
  7444. *!
  7445. *!      Procedure: GETRIGHTMOST
  7446. *!
  7447. *!      Called by: MAKECHARFIT        (procedure in TRANSPRT.PRG)
  7448. *!
  7449. *!          Calls: GETOBJWIDTH()      (function  in TRANSPRT.PRG)
  7450. *!
  7451. *!*****************************************************************************
  7452. PROCEDURE getrightmost
  7453. PARAMETER m.platform
  7454. PRIVATE m.right
  7455.  
  7456. m.right = 0
  7457.  
  7458. SCAN FOR platform = m.platform AND !DELETED() AND ;
  7459.       (objtype = c_ottext OR objtype = c_otline OR ;
  7460.       objtype = c_otbox OR objtype = c_otrepfld OR ;
  7461.       objtype = c_otlist OR objtype = c_ottxtbut OR ;
  7462.       objtype = c_otradbut OR objtype = c_otchkbox OR ;
  7463.       objtype = c_otfield OR objtype = c_otpopup OR ;
  7464.       objtype = c_otpicture OR objtype = c_otinvbut OR ;
  7465.       objtype = c_otspinner)
  7466.    m.right = MAX(m.right, hpos + getobjwidth(objtype, PICTURE, WIDTH, spacing, m.g_toplatform))
  7467. ENDSCAN
  7468.  
  7469. RETURN m.right
  7470.  
  7471. *
  7472. * GetLowest - Takes a platform and returns the lowest position occupied by an object
  7473. *      in that platform
  7474. *!*****************************************************************************
  7475. *!
  7476. *!      Procedure: GETLOWEST
  7477. *!
  7478. *!      Called by: MAKECHARFIT        (procedure in TRANSPRT.PRG)
  7479. *!
  7480. *!          Calls: GETOBJHEIGHT()     (function  in TRANSPRT.PRG)
  7481. *!
  7482. *!*****************************************************************************
  7483. PROCEDURE getlowest
  7484. PARAMETER m.platform
  7485. PRIVATE m.bottom
  7486.  
  7487. m.bottom = 0
  7488.  
  7489. SCAN FOR platform = m.platform AND !DELETED() AND ;
  7490.       (objtype = c_ottext OR objtype = c_otline OR ;
  7491.       objtype = c_otbox OR objtype = c_otrepfld OR ;
  7492.       objtype = c_otlist OR objtype = c_ottxtbut OR ;
  7493.       objtype = c_otradbut OR objtype = c_otchkbox OR ;
  7494.       objtype = c_otfield OR objtype = c_otpopup OR ;
  7495.       objtype = c_otpicture OR objtype = c_otinvbut OR ;
  7496.       objtype = c_otspinner)
  7497.    m.bottom = MAX(m.bottom, vpos + getobjheight(objtype, PICTURE, HEIGHT, spacing, m.g_toplatform))
  7498. ENDSCAN
  7499.  
  7500. RETURN m.bottom
  7501.  
  7502. *
  7503. * DoCreate - Creates an empty cursor with either a report or screen structure and a given name.
  7504. *
  7505. *!*****************************************************************************
  7506. *!
  7507. *!      Procedure: DOCREATE
  7508. *!
  7509. *!      Called by: cvrt102FRX()    (function  in TRANSPRT.PRG)
  7510. *!               : cvrtfbpRPT      (procedure in TRANSPRT.PRG)
  7511. *!               : MAKECURSOR         (procedure in TRANSPRT.PRG)
  7512. *!               : WRITERESULT        (procedure in TRANSPRT.PRG)
  7513. *!
  7514. *!*****************************************************************************
  7515. PROCEDURE docreate
  7516. PARAMETER m.name, m.type
  7517. DO CASE
  7518. CASE m.type = c_screen
  7519.    CREATE CURSOR (m.name) (platform C(8), uniqueid C(10), timestamp N(10), objtype N(2), objcode N(3), ;
  7520.       name m, expr m, vpos N(7,3), hpos N(7,3), HEIGHT N(7,3), WIDTH N(7,3), ;
  7521.       STYLE N(2), PICTURE m, ORDER m, UNIQUE l, comment m, ENVIRON l, ;
  7522.       boxchar C(1), fillchar C(1), TAG m, tag2 m, penred N(5), pengreen N(5), ;
  7523.       penblue N(5), fillred N(5), fillgreen N(5), fillblue N(5), pensize N(5), ;
  7524.       penpat N(5), fillpat N(5), fontface m, fontstyle N(3), fontsize N(3), ;
  7525.       mode N(3), ruler N(1), rulerlines N(1), grid l, gridv N(2), gridh N(2), ;
  7526.       SCHEME N(2), scheme2 N(2), colorpair C(8), lotype N(1), rangelo m, ;
  7527.       hitype N(1), rangehi m, whentype N(1), WHEN m, validtype N(1), VALID m, ;
  7528.       errortype N(1), ERROR m, messtype N(1), MESSAGE m, showtype N(1), SHOW m, ;
  7529.       activtype N(1), ACTIVATE m, deacttype N(1), DEACTIVATE m, proctype N(1), ;
  7530.       proccode m, setuptype N(1), setupcode m, FLOAT l, CLOSE l, MINIMIZE l, ;
  7531.       BORDER N(1), SHADOW l, CENTER l, REFRESH l, disabled l, scrollbar l, ;
  7532.       addalias l, TAB l, initialval m, initialnum N(3), spacing N(6,3), curpos l)
  7533.    
  7534. CASE m.type = c_report OR m.type = c_label
  7535.    CREATE CURSOR (m.name) (platform C(8), uniqueid C(10), timestamp N(10), objtype N(2), objcode N(3), ;
  7536.       name m, expr m, vpos N(9,3), hpos N(9,3), HEIGHT N(9,3), WIDTH N(9,3), ;
  7537.       STYLE m, PICTURE m, ORDER m, UNIQUE l, comment m, ENVIRON l, ;
  7538.       boxchar C(1), fillchar C(1), TAG m, tag2 m, penred N(5), pengreen N(5), ;
  7539.       penblue N(5), fillred N(5), fillgreen N(5), fillblue N(5), pensize N(5), ;
  7540.       penpat N(5), fillpat N(5), fontface m, fontstyle N(3), fontsize N(3), ;
  7541.       mode N(3), ruler N(1), rulerlines N(1), grid l, gridv N(2), gridh N(2), ;
  7542.       FLOAT l, STRETCH l, stretchtop l, TOP l, BOTTOM l, suptype N(1), suprest N(1), ;
  7543.       norepeat l, resetrpt N(2), pagebreak l, colbreak l, resetpage l, GENERAL N(3), ;
  7544.       spacing N(3), DOUBLE l, swapheader l, swapfooter l, ejectbefor l, ejectafter l, ;
  7545.       PLAIN l, SUMMARY l, addalias l, offset N(3), topmargin N(3), botmargin N(3), ;
  7546.       totaltype N(2), resettotal N(2), resoid N(3), curpos l, supalways l, supovflow l, ;
  7547.       suprpcol N(1), supgroup N(2), supvalchng l, supexpr m)
  7548. CASE m.type = c_project
  7549.    CREATE CURSOR (m.name) ;
  7550.       (name m, ;
  7551.       TYPE C(1), ;
  7552.       timestamp N(10), ;
  7553.       outfile m, ;
  7554.       homedir m, ;
  7555.       setid N(4), ;
  7556.       exclude l, ;
  7557.       mainprog l, ;
  7558.       arranged m, ;
  7559.       savecode l, ;
  7560.       defname l, ;
  7561.       openfiles l, ;
  7562.       closefiles l, ;
  7563.       defwinds l, ;
  7564.       relwinds l, ;
  7565.       readcycle l, ;
  7566.       multreads l, ;
  7567.       NOLOCK l, ;
  7568.       MODAL l, ;
  7569.       assocwinds m, ;
  7570.       DEBUG l, ;
  7571.       ENCRYPT l, ;
  7572.       nologo l, ;
  7573.       scrnorder N(3), ;
  7574.       cmntstyle N(1), ;
  7575.       objrev N(5), ;
  7576.       commands m, ;
  7577.       devinfo m, ;
  7578.       symbols m, ;
  7579.       OBJECT m, ;
  7580.       ckval N(6) ;
  7581.       )
  7582. ENDCASE
  7583.  
  7584. *
  7585. * makecursor - Create a cursor with the structure we need for this file on the 2.5 platform.
  7586. *
  7587. *!*****************************************************************************
  7588. *!
  7589. *!      Procedure: MAKECURSOR
  7590. *!
  7591. *!      Called by: TRANSPRT.PRG                      
  7592. *!               : CONVERTER          (procedure in TRANSPRT.PRG)
  7593. *!
  7594. *!          Calls: DOCREATE           (procedure in TRANSPRT.PRG)
  7595. *!
  7596. *!*****************************************************************************
  7597. PROCEDURE makecursor
  7598. PRIVATE m.temp20alias, m.in_del
  7599.  
  7600. m.temp20alias = "S"+SUBSTR(LOWER(SYS(3)),2,8)
  7601. DO docreate WITH m.temp20alias, m.g_filetype
  7602. m.in_del = SET("DELETED")
  7603. SET DELETED ON
  7604. APPEND FROM (m.g_scrndbf)
  7605. SET DELETED &in_del
  7606.  
  7607. m.g_20alias = m.g_scrnalias
  7608. m.g_scrnalias = m.temp20alias
  7609.  
  7610.  
  7611. *
  7612. * AddGraphicalLabelGroups - Add page and column header records for a label.
  7613. *
  7614. *!*****************************************************************************
  7615. *!
  7616. *!      Procedure: ADDGRAPHICALLABELGROUPS
  7617. *!
  7618. *!      Called by: ALLCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  7619. *!               : UPDATELABELDATA    (procedure in TRANSPRT.PRG)
  7620. *!
  7621. *!*****************************************************************************
  7622. PROCEDURE addgraphicallabelgroups
  7623.  
  7624. IF m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  7625.    * First make sure that we don't already have these headers.  Check for a page header.
  7626.    LOCATE FOR objtype = c_otband AND objcode = 1
  7627.    IF FOUND()
  7628.       * We already have a page header.  We don't want two.  Reports, like people, function
  7629.       * best with only a single head.
  7630.       RETURN
  7631.    ENDIF
  7632.    
  7633.    APPEND BLANK
  7634.    REPLACE objtype WITH c_otband
  7635.    REPLACE objcode WITH 1
  7636.    REPLACE HEIGHT WITH 0
  7637.    REPLACE pagebreak WITH .F.
  7638.    REPLACE colbreak WITH .F.
  7639.    REPLACE resetpage WITH .F.
  7640.    REPLACE platform WITH m.g_toplatform
  7641.    REPLACE uniqueid WITH SYS(2015)
  7642.    
  7643.    APPEND BLANK
  7644.    REPLACE objtype WITH c_otband
  7645.    REPLACE objcode WITH 2
  7646.    REPLACE HEIGHT WITH 0
  7647.    REPLACE pagebreak WITH .F.
  7648.    REPLACE colbreak WITH .F.
  7649.    REPLACE resetpage WITH .F.
  7650.    REPLACE platform WITH m.g_toplatform
  7651.    REPLACE uniqueid WITH SYS(2015)
  7652.    
  7653.    APPEND BLANK
  7654.    REPLACE objtype WITH c_otband
  7655.    REPLACE objcode WITH 6
  7656.    REPLACE HEIGHT WITH 0
  7657.    REPLACE pagebreak WITH .F.
  7658.    REPLACE colbreak WITH .F.
  7659.    REPLACE resetpage WITH .F.
  7660.    REPLACE platform WITH m.g_toplatform
  7661.    REPLACE uniqueid WITH SYS(2015)
  7662.    
  7663.    APPEND BLANK
  7664.    REPLACE objtype WITH c_otband
  7665.    REPLACE objcode WITH 7
  7666.    REPLACE HEIGHT WITH 0
  7667.    REPLACE pagebreak WITH .F.
  7668.    REPLACE colbreak WITH .F.
  7669.    REPLACE resetpage WITH .F.
  7670.    REPLACE platform WITH m.g_toplatform
  7671.    REPLACE uniqueid WITH SYS(2015)
  7672. ENDIF
  7673.  
  7674. *
  7675. * UpdateLabelData - Labels live in report dataases now and we need to add at least one band
  7676. *            record if we are coming from a 2.0 label.
  7677. *
  7678. *!*****************************************************************************
  7679. *!
  7680. *!      Procedure: UPDATELABELDATA
  7681. *!
  7682. *!      Called by: CONVERTER          (procedure in TRANSPRT.PRG)
  7683. *!
  7684. *!          Calls: ADDGRAPHICALLABELGR(procedure in TRANSPRT.PRG)
  7685. *!
  7686. *!*****************************************************************************
  7687. PROCEDURE updatelabeldata
  7688. PARAMETER m.lbxnumacross, m.lbxlmargin, m.lbxspacesbet, m.lbxlinesbet, m.lbxheight
  7689.  
  7690. DO addgraphicallabelgroups
  7691.  
  7692. * We need a detail band for any platform.
  7693. APPEND BLANK
  7694. REPLACE objtype WITH c_otband
  7695. REPLACE objcode WITH 4
  7696. REPLACE HEIGHT WITH m.lbxheight
  7697. REPLACE pagebreak WITH .F.
  7698. REPLACE colbreak WITH .F.
  7699. REPLACE resetpage WITH .F.
  7700.  
  7701. LOCATE FOR objtype = c_ot20label
  7702. IF FOUND()
  7703.    REPLACE vpos WITH m.lbxnumacross
  7704.    REPLACE hpos WITH m.lbxlmargin
  7705.    REPLACE HEIGHT WITH m.lbxspacesbet
  7706.    REPLACE penblue WITH m.lbxlinesbet
  7707. ENDIF
  7708.  
  7709. *
  7710. * PlatformDefaults - Writes information to a record that would not exist on the source platform and
  7711. *         we don't add elsewhere.
  7712. *
  7713. *!*****************************************************************************
  7714. *!
  7715. *!      Procedure: PLATFORMDEFAULTS
  7716. *!
  7717. *!      Called by: CONVERTER          (procedure in TRANSPRT.PRG)
  7718. *!               : NEWCHARTOGRAPHIC   (procedure in TRANSPRT.PRG)
  7719. *!               : NEWGRAPHICTOCHAR   (procedure in TRANSPRT.PRG)
  7720. *!
  7721. *!*****************************************************************************
  7722. PROCEDURE platformdefaults
  7723. PARAMETER m.timestamp
  7724.  
  7725. IF m.timestamp > 0
  7726.    REPLACE uniqueid WITH SYS(2015)
  7727.    REPLACE timestamp WITH m.timestamp
  7728.    REPLACE platform WITH m.g_fromplatform
  7729. ENDIF
  7730.  
  7731. IF m.g_toplatform = "MAC" OR m.g_toplatform = "WINDOWS"
  7732.    REPLACE ruler WITH 1             && inches
  7733.    REPLACE rulerlines WITH 1
  7734.    REPLACE grid WITH .T.
  7735.    REPLACE gridv WITH 9
  7736.    REPLACE gridh WITH 9
  7737. ENDIF
  7738.  
  7739. *
  7740. * converter - Convert a 2.0 screen or report to 2.5 format and fill in the
  7741. *            appropriate fields.
  7742. *
  7743. *!*****************************************************************************
  7744. *!
  7745. *!      Procedure: CONVERTER
  7746. *!
  7747. *!      Called by: TRANSPRT.PRG                      
  7748. *!
  7749. *!          Calls: MAKECURSOR         (procedure in TRANSPRT.PRG)
  7750. *!               : UPDATELABELDATA    (procedure in TRANSPRT.PRG)
  7751. *!               : CONVERTPROJECT     (procedure in TRANSPRT.PRG)
  7752. *!               : STAMPVAL()         (function  in TRANSPRT.PRG)
  7753. *!               : PLATFORMDEFAULTS   (procedure in TRANSPRT.PRG)
  7754. *!               : UPDATEVERSION      (procedure in TRANSPRT.PRG)
  7755. *!
  7756. *!*****************************************************************************
  7757. PROCEDURE converter
  7758. PRIVATE m.lbxnumacross, m.lbxlmargin, m.lbxspacesbet, m.lbxlinesbet, m.lbxheight, m.timestamp
  7759.  
  7760. DO CASE
  7761. CASE m.g_filetype = c_label
  7762.    LOCATE FOR objtype = c_ot20label
  7763.    IF FOUND()
  7764.       m.lbxnumacross   = numacross
  7765.       m.lbxlmargin     = lmargin
  7766.       m.lbxspacesbet   = spacesbet
  7767.       m.lbxlinesbet    = linesbet
  7768.       m.lbxheight      = HEIGHT
  7769.    ENDIF
  7770. ENDCASE
  7771.  
  7772. DO makecursor
  7773.  
  7774. DO CASE
  7775. CASE m.g_filetype = c_label
  7776.    DO updatelabeldata WITH m.lbxnumacross, m.lbxlmargin, m.lbxspacesbet, m.lbxlinesbet, m.lbxheight
  7777. CASE m.g_filetype = c_project
  7778.    DO convertproject
  7779.    RETURN
  7780. ENDCASE
  7781.  
  7782. m.timestamp = stampval()
  7783. SCAN
  7784.    DO platformdefaults WITH m.timestamp
  7785. ENDSCAN
  7786.  
  7787. DO updateversion
  7788.  
  7789. *
  7790. * UpdateVersion - Places the correct version number in the m.g_fromPlatfrom
  7791. *      records.
  7792. *!*****************************************************************************
  7793. *!
  7794. *!      Procedure: UPDATEVERSION
  7795. *!
  7796. *!      Called by: CONVERTER          (procedure in TRANSPRT.PRG)
  7797. *!
  7798. *!*****************************************************************************
  7799. PROCEDURE updateversion
  7800. LOCATE FOR platform = "DOS" AND objtype = c_otheader
  7801. IF FOUND()
  7802.    DO CASE
  7803.    CASE m.g_filetype = c_screen
  7804.       REPLACE objcode WITH c_25scx
  7805.    OTHERWISE
  7806.       REPLACE objcode WITH c_25frx
  7807.    ENDCASE
  7808. ENDIF
  7809.  
  7810. *
  7811. * SynchTime - Takes the names of two platforms and makes the timestamp of the header (objectype = 1)
  7812. *      record for the first platfrom match the timestamp of the header record of the second.
  7813. *
  7814. *!*****************************************************************************
  7815. *!
  7816. *!      Procedure: SYNCHTIME
  7817. *!
  7818. *!      Called by: TRANSPRT.PRG                      
  7819. *!
  7820. *!*****************************************************************************
  7821. PROCEDURE synchtime
  7822. PARAMETER m.convertedplatform, m.matchplatform
  7823. PRIVATE m.timestamp
  7824. LOCATE FOR platform = m.matchplatform AND objtype = c_otheader
  7825. IF FOUND()
  7826.    m.timestamp = timestamp
  7827.    LOCATE FOR platform = m.convertedplatform AND objtype = c_otheader
  7828.    IF FOUND()
  7829.       REPLACE timestamp WITH m.timestamp
  7830.    ENDIF
  7831. ENDIF
  7832.  
  7833. *
  7834. * Get a timestamp value based on the current date and time.
  7835. *
  7836. *!*****************************************************************************
  7837. *!
  7838. *!       Function: STAMPVAL
  7839. *!
  7840. *!      Called by: CONVERTER          (procedure in TRANSPRT.PRG)
  7841. *!
  7842. *!          Calls: SHIFTL()           (function  in TRANSPRT.PRG)
  7843. *!               : SHIFTR()           (function  in TRANSPRT.PRG)
  7844. *!
  7845. *!*****************************************************************************
  7846. FUNCTION stampval
  7847. PRIVATE m.dateval, m.timeval
  7848.  
  7849. m.dateval = DAY(DATE()) + ;
  7850.    shiftl(MONTH(DATE()), 5) + ;
  7851.    shiftl(YEAR(DATE())-1980, 9)
  7852.  
  7853. m.timeval = shiftr(VAL(RIGHT(TIME(),2)),1) + ;
  7854.    shiftl(VAL(SUBSTR(TIME(),3,2)),5) + ;
  7855.    shiftl(VAL(LEFT(TIME(),2)),11)
  7856.  
  7857. RETURN shiftl(m.dateval,16)+m.timeval
  7858.  
  7859. *
  7860. * Shift a value x times to the left.  (This isn't a true match for
  7861. * a shift since we keep extending the value without truncating it,
  7862. * but it works for us.)
  7863. *
  7864. *!*****************************************************************************
  7865. *!
  7866. *!       Function: SHIFTL
  7867. *!
  7868. *!      Called by: STAMPVAL()         (function  in TRANSPRT.PRG)
  7869. *!
  7870. *!*****************************************************************************
  7871. FUNCTION shiftl
  7872. PARAMETER m.value, m.times
  7873. PRIVATE m.loop
  7874.  
  7875. FOR m.loop = 1 TO m.times
  7876.    m.value = m.value * 2
  7877. ENDFOR
  7878. RETURN m.value
  7879.  
  7880. *
  7881. * Shift a value x times to the right.  (This isn't a true match for
  7882. * a shift since we keep extending the value without truncating it,
  7883. * but it works for us.)
  7884. *
  7885. *!*****************************************************************************
  7886. *!
  7887. *!       Function: SHIFTR
  7888. *!
  7889. *!      Called by: STAMPVAL()         (function  in TRANSPRT.PRG)
  7890. *!
  7891. *!*****************************************************************************
  7892. FUNCTION shiftr
  7893. PARAMETER m.value, m.times
  7894. PRIVATE m.loop
  7895.  
  7896. FOR m.loop = 1 TO m.times
  7897.    m.value = INT(m.value / 2)
  7898. ENDFOR
  7899. RETURN m.value
  7900.  
  7901. *
  7902. * EmptyPlatform - Takes a platform ID and returns .T. if no records for that platform
  7903. *       are in the file or .F. if some are present.
  7904. *
  7905. *!*****************************************************************************
  7906. *!
  7907. *!       Function: EMPTYPLATFORM
  7908. *!
  7909. *!      Called by: IMPORT             (procedure in TRANSPRT.PRG)
  7910. *!
  7911. *!*****************************************************************************
  7912. FUNCTION emptyplatform
  7913. PARAMETER m.platform
  7914. PRIVATE m.count
  7915. SELECT (m.g_scrnalias)
  7916.  
  7917. IF (FCOUNT() = c_20scxfld OR FCOUNT() = c_20frxfld OR FCOUNT() = c_20lbxfld)
  7918.    RETURN .T.
  7919. ENDIF
  7920.  
  7921. COUNT TO m.count FOR platform = m.platform
  7922. IF m.count > 0
  7923.    RETURN .F.
  7924. ELSE
  7925.    RETURN .T.
  7926. ENDIF
  7927.  
  7928. **
  7929. ** Code Associated With Displaying the 2.0 to 2.5 conversion dialog.
  7930. **
  7931. *!*****************************************************************************
  7932. *!
  7933. *!       Function: STRUCTDIALOG
  7934. *!
  7935. *!      Called by: DOUPDATE()         (function  in TRANSPRT.PRG)
  7936. *!
  7937. *!          Calls: ERRORHANDLER       (procedure in TRANSPRT.PRG)
  7938. *!               : CURPOS()           (function  in TRANSPRT.PRG)
  7939. *!
  7940. *!*****************************************************************************
  7941. FUNCTION structdialog
  7942. PARAMETER m.textline
  7943. PRIVATE m.choice, m.ftype
  7944.  
  7945. DO CASE
  7946. CASE m.g_filetype = c_screen
  7947.    m.ftype = "screen "
  7948. CASE m.g_filetype = c_report
  7949.    m.ftype = "report "
  7950. CASE m.g_filetype = c_label
  7951.    m.ftype = "label "
  7952. CASE m.g_filetype = c_project
  7953.    m.ftype = "project "
  7954. OTHERWISE
  7955.    m.ftype = ""
  7956. ENDCASE
  7957.  
  7958. DO CASE
  7959. CASE m.g_toplatform = "WINDOWS" OR m.g_toplatform = "MAC"
  7960.    IF NOT WEXIST("_q3p0w5ixe")
  7961.       DEFINE WINDOW _q3p0w5ixe ;
  7962.          AT 0,0 ;
  7963.          SIZE 5.076,58.333 ;
  7964.          TITLE "Converter" ;
  7965.          FONT c_dlgface, c_dlgsize ;
  7966.          STYLE c_dlgstyle ;
  7967.          FLOAT ;
  7968.          CLOSE ;
  7969.          MINIMIZE ;
  7970.          SYSTEM
  7971.       MOVE WINDOW _q3p0w5ixe CENTER
  7972.    ENDIF
  7973.    
  7974.    IF WVISIBLE("_q3p0w5ixe")
  7975.       ACTIVATE WINDOW _q3p0w5ixe SAME
  7976.    ELSE
  7977.       ACTIVATE WINDOW _q3p0w5ixe NOSHOW
  7978.    ENDIF
  7979.    
  7980.    @ 1.000, (58.333 - TXTWIDTH(m.textline, c_dlgface, c_dlgsize, c_dlgstyle)) / 2 ;
  7981.       SAY m.textline ;
  7982.       SIZE 1.154,TXTWIDTH(m.textline, c_dlgface, c_dlgsize, c_dlgstyle) ;
  7983.       FONT c_dlgface, c_dlgsize ;
  7984.       STYLE c_dlgstyle
  7985.    
  7986.    @ 2.750,13.512 GET m.choice ;
  7987.       PICTURE "@*HT \!\<Yes;\?\<Cancel" ;
  7988.       SIZE 1.769,13.500,4.308 ;
  7989.       DEFAULT 1 ;
  7990.       FONT c_dlgface, 9 ;
  7991.       STYLE c_dlgstyle
  7992.    
  7993. CASE m.g_toplatform = "DOS" OR m.g_toplatform = "UNIX"
  7994.    IF NOT WEXIST("_q3p0w5ixe")
  7995.       DEFINE WINDOW _q3p0w5ixe ;
  7996.          FROM INT((SROW()-7)/2),INT((SCOL()-47)/2) ;
  7997.          TO INT((SROW()-7)/2)+7,INT((SCOL()-47)/2)+46 ;
  7998.          FLOAT ;
  7999.          NOCLOSE ;
  8000.          SHADOW ;
  8001.          DOUBLE ;
  8002.          COLOR SCHEME 7
  8003.    ENDIF
  8004.    
  8005.    IF WVISIBLE("_q3p0w5ixe")
  8006.       ACTIVATE WINDOW _q3p0w5ixe SAME
  8007.    ELSE
  8008.       ACTIVATE WINDOW _q3p0w5ixe NOSHOW
  8009.    ENDIF
  8010.    
  8011.    * Format the file name for display
  8012.    m.msg = "File: "+m.g_scrndbf
  8013.    IF LEN(m.msg) > 44
  8014.       m.msg = m.g_scrndbf
  8015.       IF LEN(m.msg) > 44
  8016.          m.msg = justfname(m.g_scrndbf)
  8017.       ENDIF
  8018.    ENDIF
  8019.    
  8020.    @ 1,(WCOLS()-LEN(m.msg))/2 SAY m.msg
  8021.    @ 2,(WCOLS()-LEN(m.textline))/2 SAY m.textline
  8022.    @ 4,2 GET m.choice ;
  8023.       PICTURE "@*HT \<Yes;\!\?\<No" ;
  8024.       SIZE 1,12,18 ;
  8025.       DEFAULT 1
  8026.    
  8027. OTHERWISE
  8028.    DO errorhandler WITH "Unknown Version.", LINENO(), c_error3
  8029.    RETURN .F.
  8030. ENDCASE
  8031.  
  8032. IF NOT WVISIBLE("_q3p0w5ixe")
  8033.    ACTIVATE WINDOW _q3p0w5ixe
  8034. ENDIF
  8035.  
  8036. READ CYCLE MODAL WHEN curpos()
  8037.  
  8038. RELEASE WINDOW _q3p0w5ixe
  8039.  
  8040. IF m.choice = 1
  8041.    RETURN .T.
  8042. ELSE
  8043.    RETURN .F.
  8044. ENDIF
  8045. RETURN
  8046.  
  8047. *!*****************************************************************************
  8048. *!
  8049. *!       Function: CURPOS
  8050. *!
  8051. *!      Called by: STRUCTDIALOG()     (function  in TRANSPRT.PRG)
  8052. *!
  8053. *!*****************************************************************************
  8054. FUNCTION curpos
  8055. IF _DOS OR _UNIX
  8056.    _CUROBJ = 2
  8057. ENDIF
  8058. RETURN .T.
  8059.  
  8060. **
  8061. ** Code Associated With Displaying the Screen Convert Dialog Box
  8062. **
  8063. *!*****************************************************************************
  8064. *!
  8065. *!       Function: SCXFRXDIALOG
  8066. *!
  8067. *!      Called by: CONVERTTYPE()      (function  in TRANSPRT.PRG)
  8068. *!
  8069. *!          Calls: HASRECORDS()       (function  in TRANSPRT.PRG)
  8070. *!               : STRIPPATH()        (function  in TRANSPRT.PRG)
  8071. *!               : SCRNCTRL()         (function  in TRANSPRT.PRG)
  8072. *!               : TRANSPRMPT()       (function  in TRANSPRT.PRG)
  8073. *!               : PVALID()           (function  in TRANSPRT.PRG)
  8074. *!               : ASKFONT()          (function  in TRANSPRT.PRG)
  8075. *!               : ERRORHANDLER       (procedure in TRANSPRT.PRG)
  8076. *!               : RDVALID()          (function  in TRANSPRT.PRG)
  8077. *!               : DEACCLAU()         (function  in TRANSPRT.PRG)
  8078. *!               : SHOWCLAU()         (function  in TRANSPRT.PRG)
  8079. *!
  8080. *!*****************************************************************************
  8081. FUNCTION scxfrxdialog
  8082. PARAMETER ftype
  8083. PRIVATE m.choice, m.fromplatform, m.dlgnum
  8084. m.choice = 0
  8085. DO CASE
  8086. CASE (_WINDOWS OR _MAC)
  8087.    IF m.ftype <> "LBX" AND (hasrecords("WINDOWS") OR hasrecords("MAC"))
  8088.       * No partial transport of labels
  8089.       
  8090.       m.fromplatform = "FoxPro for MS-DOS"
  8091.       m.dlgnum = 1
  8092.       m.g_allobjects = .F.
  8093.       
  8094.       * already contains some records for Windows or Mac
  8095.       DEFINE WINDOW transdlg ;
  8096.          AT  0.000, 0.000  ;
  8097.          SIZE 22.385,76.167 ;
  8098.          TITLE " FoxPro Transporter" ;
  8099.          FONT c_dlgface, c_dlgsize ;
  8100.          STYLE c_dlgsty1;
  8101.          FLOAT ;
  8102.          CLOSE ;
  8103.          NOMINIMIZE ;
  8104.          DOUBLE 
  8105.       MOVE WINDOW transdlg CENTER
  8106.       
  8107.       IF WVISIBLE("transdlg")
  8108.          ACTIVATE WINDOW transdlg SAME
  8109.       ELSE
  8110.          ACTIVATE WINDOW transdlg NOSHOW
  8111.       ENDIF
  8112.       
  8113.       @ 14.077,1.667 TO 21.385,50.167 ;
  8114.          PEN 1, 8 ;
  8115.          STYLE "T"
  8116.       @ 13.615,2.667 SAY "Transport" ;
  8117.          SIZE 1.000, 9.167, 0.000 ;
  8118.          FONT c_dlgface, c_dlgsize ;
  8119.          STYLE c_dlgsty1
  8120.       @ 1.000,2.667 SAY IIF(m.ftype = "SCX","Screen File:","Report File:") ;
  8121.          SIZE 1.000,13.500, 0.000 ;
  8122.          FONT c_dlgface, c_dlgsize ;
  8123.          STYLE c_dlgstyle
  8124.       @ 1.000,16.667 SAY LOWER(strippath(m.g_scrndbf)) ;
  8125.          SIZE 1.000,21.833 ;
  8126.          FONT c_dlgface, c_dlgsize ;
  8127.          STYLE c_dlgsty1
  8128.       @ 3.077,2.667 SAY "There are objects in this file defined " + CHR(13) + ;
  8129.          "for a platform other than Windows." ;
  8130.          SIZE 2.000,35.000, 0.000 ;
  8131.          FONT c_dlgface, c_dlgsize ;
  8132.          STYLE c_dlgsty1
  8133.       @ 8.077,2.667 SAY "By transporting this file, you add, update, or " + CHR(13) + ;
  8134.          "replace Windows definitions for objects in the file." ;
  8135.          SIZE 2.000,48.167, 0.000 ;
  8136.          FONT c_dlgface, c_dlgsize ;
  8137.          STYLE c_dlgsty1
  8138.       @ 11.385,2.667 SAY "Transport Objects From: " ;
  8139.          SIZE 1.000,23.500 ;
  8140.          FONT c_dlgface, c_dlgsize ;
  8141.          STYLE c_dlgsty1
  8142.       @ 5.615,2.667 SAY "The objects are new to Windows, or more " + CHR(13) + ;
  8143.          "recently modified than their Windows equivalents." ;
  8144.          SIZE 2.000,47.833 ;
  8145.          FONT c_dlgface, c_dlgsize ;
  8146.          STYLE c_dlgsty1
  8147.       @ 17.846,7.500 SAY "Than Windows Equivalent Objects" ;
  8148.          SIZE 1.000,32.667 ;
  8149.          FONT c_dlgface, c_dlgsize ;
  8150.          STYLE c_dlgsty1
  8151.       @ 11.231,25.833 GET m.fromplatform ;
  8152.          PICTURE "@^ FoxPro for MS-DOS;\FoxPro for Macintosh;\FoxPro for UNIX" ;
  8153.          SIZE 1.538,24.333 ;
  8154.          DEFAULT 1 ;
  8155.          FONT c_dlgface, c_dlgsize ;
  8156.          STYLE c_dlgsty1
  8157.       @ 14.923,4.500 GET m.g_newobjects ;
  8158.          PICTURE "@*C Objects New to Windows" ;
  8159.          SIZE 1.308,28.167 ;
  8160.          DEFAULT .T. ;
  8161.          FONT c_dlgface, c_dlgsize ;
  8162.          STYLE c_dlgsty1 ;
  8163.          VALID scrnctrl()
  8164.       @ 16.538,4.500 GET m.g_snippets ;
  8165.          PICTURE "@*C Objects More Recently Modified" ;
  8166.          SIZZE 1.308m   _dlgsaSe.R,SoTvaID sc
  8167.     ZE  ;
  8168.          SIZE       : PVALID() 8 ;
  8169.    CLODOS;\FoU(s ;
  8170.          ALID() 8 ;
  8171.    CL in TRANSPRT.PRG)RANSPRT.PRG)RANSP + CHR(13) + ;
  8172.  '  FONT c_dlgface,TvaID sc
  8173.   T.PRG)JUSTFN3.6TYLE c_dlMPT() 833 fi IFZE  (i.e., noently)g_scrn"fi Modi   .923,4.500 GET m....................................................o Windows" ;
  8174.          SIZE 1.308,ASKFOJUSTFN3.6         DEFAULT .T. ;
  8175.          FONT c_dlgface, c_dlgsize ;
  8176.          STYLE c_dlgstyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyRT.PRG)
  8177. *!
  8178. *PT()f sc
  8179.     ;
  8180.       m.fi Modi    ZE  ;
  8181.     m.dRice \00,4fi Modi167, 0.000 ;fi Modi + CHR(13) +fi Modi,Rice \00,4fi Modiodified thFONT c_choice :00,4fi Modi167, 0.000 ;fi Modi + CHR(13) +fi Modi,ice :00,4fi Modi1dified thFONT c_       DEFAULT LID() 8 fi Modi1     FONT JUSTPATSTYLE c_dlgsPT() 833        A 14.923,4.500 GETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT         SIZE 1.308,ASKFOJUSTPATS         DEFAULT .T. ;
  8182.          FONT c_dlgface, c_dlgsize ;
  8183.          STYLE c_dlgstyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyRT.PRG)
  8184. *!
  8185. *PT(t    e, youc_dlMPT() 833 ntly Modig_scrn"fi Modi     ;
  8186.       m.fi Modi    ZE  ;
  8187.     1.fi Modi + DEFAULT LID() 8 fi Modi1   rm =\Pro fofi Modi  000 ;fi Modi + CHR(13) +fi Modi,1,Rice \00,4fi Modi1   
  8188.      (s ;
  8189.   fi Modi,1
  8190.    =\Pr  CLY IIF(fi Modi167,1or Mac
  8191.        CLCHR(13) +fi Modi,Y IIF(fi Modi1-3 G "S>  :0     FONT fi Modi + CHR(13) +fi Modi,1,Y IIF(fi Modi1-3 ;
  8192.      TLE " Fdlgface, fi Modi      E c_dlgsty1''  FONT c_  FONT         nt Ford, fi IFZE  in havlgsentricular extens28. 14.923,4.500 GETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT         SIZE 1.308,28.16                 DEFAULT s in thicvrt102FRXFONT c_dlace, c_dlgsize ;
  8193.          STYL^ FoxPro for MShicvrtfbpRPTT c_dlaprocfin
  8194.    ze ;
  8195.          ST       SIZE 1objectssFOJUSTPATSFONT c_dlgface, c_dlgsize ;
  8196.          STYL^ FoxPro for MShiJUSTFN3.6FONT c_dlgace, c_dlgsize ;
  8197.          STYL^ FoxPro for MShic_dlgFONT c_dlgfdlgace, c_dlgsize ;
  8198.          STYL923,4.500 GETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTyyyyyyyyyyRT.PRG)       ford,extONT  ord, 833 extens28.    "fi Modi  in bcinhatever extxPr 14  ;
  8199.       m.fi Modifm.extON  ZE  ;
  8200.     m.dCHR(13) +ext,1,
  8201.    ".
  8202.     m.ext     @ 17.84ext,2,3 thFONT c_     Modi + PT(t     8 fi Modi1  1.fi Modi + PT()f sc
  8203. ALID() sporting tfi Modi1 DOS;\Fice .00,4fi Modi167, 0 000 ;fi Modi + CHR(13) +fi Modi,1,ice .00,4fi Modi1;
  8204.  ;
  8205. .' ;m.extON    E c_d ;fi Modi +  ;fi Modi ;
  8206. .' ;m.extON ONT c_dlgfacePICTU 8 ;Modi16;m.fi Modi  923,4.500 GETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT         SIZE 1.308,2SKFOCVTLONGST       SIZE 1objectssFOCVTSHOR FONT c_dlgface, c_dlgsize ;
  8207.          STYL923,4.5000000000000000000000000000000000000000000000000000000000000000000000ets ;
  8208.          cvtlongdlgsaSe.R,SoTitext,SoTioffc_dlgfacecvtshort) +itext,oTioff
  8209.  ;(65536 *ecvtshort) +itext,oTioff+21     F,4.50000000000000000000000000000000000000000000000000000000000000000TTTTTTTTTT         SIZE 1.308,2SKFOCVTSHOR          DEFAULT .T. ;
  8210.  GETOLDREPOR TYP6FONace, c_dlgsize ;
  8211.          STYL^ FoxPro for MShicvrtfbpRPTT c_dlaprocfin
  8212.    ze ;
  8213.          STYL^ FoxPro for MShiCVTLONGFONT c_dlgfdace, c_dlgsize ;
  8214.          STYL923  SIZE 1objectssFOCVTBYT6FONT c_dlgfdace, c_dlgsize ;
  8215.          STYL9 F,4.5000000000000000000000000000000000000000000000000000000000000000000000ets ;
  8216.          cvtshortdlgsaSe.R,SoTitext,SoTioffc_dlgfa  cvtbyte) +itext,oTioff
  8217.  ;(256 *ecvtbyte) +itext,oTioff+11     F,4.500000000000000000000000000000000000000000000000000000000000000000000000000         SIZE 1.308,2SKFOCVTBYT6         DEFAULT s in thicvrtfbpRPTT c_dlaprocfin
  8218.    ze ;
  8219.          STYL^ FoxPro for MShiCVTSHOR FONT c_dlgface, c_dlgsize ;
  8220.          STYL9 F,000000000000000000000000000000000000000000000000000000000000000000000000ets ;
  8221.          cvtbytedlgsaSe.R,SoTitext,SoTioffc_dlgfa  DSC(CHR(13) +itext,oTioff+1LID     F,4.5000000000000000000000000000000000000000000000000000000000000000000000ets ;        SIZE 1.308,ASKFOOBJ2BASEFON          DEFAULT .T. ;
  8222.   ILLININFONT c_dlgfaprocfin
  8223.    ze ;
  8224.          STYL9 F,000000000000ets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0000ets ;
  8225.       
  8226. *obj2basefontdlgsaSe.R,Sowidth, bfontface, bfontsize, bfontstyle, ofontface, r Macofontsize, ofontstyleONT Mapgsewidthg_scrnonig_ont in ano833rnoni
  8227. DO CASE
  8228. CASE0 ;g_tographicE " Fdlgface, owidth *eFON 
  8229.   RIC(60,4ofontface,,4ofontsize,,4ofontstyle)or Mac
  8230.   /eFON 
  8231.   RIC(60,4bfontface,,4bfontsize,,4bfontstyle STCASE0LID() 8 ofontface
  8232.     "MS S
  8233.   SERIF"   CLr Mac
  8234.   LID() 8 bfontface
  8235.     "MS S
  8236.   SERIF"   CLr Mac
  8237.   ,4ofontsize +  ;bfontsize   CLr Mac
  8238.   !("B"ro foofontstyle)o  CLr Mac
  8239.   "B"ro fobfontstyleE c_d* We can't useeFON 
  8240.   RICnon DOS, so we useeheuristics  zstead.  MostONc_d*    833 tidi we will bciconverting bctween MS Sans Serif 8 Bold andE c_d* MS Sans Serif Regular.  I  83atxPr 833 caseehere, usee833 5/6iconvers28.E c_d* factor 83atxPr 833 relativlgwidths    833 chars  z 833see8wog_ont styler 14" Fdlgface, owidth *e5/6
  8241. OTHERWI  E c_dlgsty1, owidthON ONCASE
  8242.     F,4.500000000000000000000000000000000000000000000000000000000000;;;;;;0000ets ;
  8243.        SIZE 1.308,28.16V      CAP         DEFAULT .T. ;
  8244.  RDVALIDFONT c_dlgfdace, c_dlgsize ;
  8245.          STYL^ FoxPro for MShiSELECTOBJNT c_dlgfdaprocfin
  8246.    ze ;
  8247.          STYL9 F,00;;;;;;0000ets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0000ets ;
  8248.          vers28.capdlgsaSe.R,SoTstrgdlDO CASE
  8249. CASE0strg   "DOS
  8250.     lgsty1"MS-DOS
  8251.  CASE0strg   "WINDOWS
  8252.     lgsty1"Windows
  8253.  CASE0strg   "MAC
  8254.     lgsty1"Macintosh
  8255.  CASE0strg   "UNIX
  8256.     lgsty1"UNIX
  8257.  OTHERWI  E c_dlgsty1strgdl ONCASE
  8258.     F,4.....................................................................00ets ;
  8259.        SIZE 1.308,2SKFOBLACKBOXSTYL9 F,00;;;;;;000000000000000000000000000000000000000000000000000000000000000000000PRG)       blackboxdlgsaSe.R,Sotype ,Sored,Soblue, mgreen,So   ter.E * Ir 83Pr a black box?OS;\F! ;g_tographic   CL,4otype = c_otbox   CLr Mac
  8260.   ,4ored + 0   CL,4oblue + 0   CL,4ogreen + 0 r Mac
  8261.     CL,4o   ter. + 0
  8262.     lgsty1.T 14    E c_dlgsty1.F 14 ONT c_  F,00;;;;;;0000000000000000000000000000000000000000000000000000000000....00ets ;
  8263.        DEFAUProcfin
  8264.  hiSELECTOBJ         DEFAULT .T. ;
  8265.  GRAPHICTOCHAR_dlgfdaprocfin
  8266.    ze ;
  8267.          STYL^ FoxPro for MShiCHARTOGRAPHIC_dlgfdaprocfin
  8268.    ze ;
  8269.          STYL923  SIZE 1objectssFOINITSEL^ FoxPro foraprocfin
  8270.    ze ;
  8271.          STYL^ FoxPro for MShiISOBJECTFONT c_dlgface, c_dlgsize ;
  8272.          STYL^ FoxPro for MShiADDSEL^ FoxPro forraprocfin
  8273.    ze ;
  8274.          STYL^ FoxPro for MShiV      CAPFONT c_dlace, c_dlgsize ;
  8275.          STYL^ FoxPro for MShiTPSELECTFoxPro forraprocfin
  8276.    ze ;
  8277.          STYL923  SIZEac
  8278.   LsesFOM.G_SCRNALIASE 1objSTYL923  SIZEacIndexesFOID^ FoxPro for MST c_dlatag STYL9 F,00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8279. PROCEDURE0selectobjONT Fign
  8280.   out w3atxin transportdlDO initsel
  8281.   ;\F ;g_snippets
  8282.      ;g_teo  lias   "S" ;CHR(13)LOW() SYS(3)),2,8 STE 1SELECTF*eFROM  8 g_scrn lias)or Mac
  8283.   WHERE !DELETEDFON  CLplatform +  ;g__scrplatform r Mac
  8284.   
  8285.     CLoktransport(comment)or Mac
  8286.   INTO CURSOR  8 g_teo  lias STE 1;\F_TALLY > 0
  8287.     
  8288.   INDEX    uniqueid TAG idE c_d Mac
  8289.   SELECTF 8 g_scrn lias) Mac
  8290.   SET lgLA     TO uniqueid INTO  8 g_teo  lias iADDITIV E c_d DELOCATEeFOR.T 14 DEFAUDO CASE
  8291.  DEFAULASE0 ;g_filetype = c_screen Mac
  8292.   
  8293.   SCANeFORplatform +  ;g_toplatform r Mac
  8294.  xPro for M  CL(isobject(objtype) OR objtype = c_othead3rnOR objtype = c_otworkar)or Mac
  8295.   ac
  8296.   
  8297.     CL&g_teo  lias..tidistamp > tidistamp Mac
  8298.   ac
  8299.   DO addsel WITH "Upd
  8300.      DEFAU ONSCAN
  8301.  DEFAULASE0 ;g_filetype = c_reportdlac
  8302.   
  8303.   SCANeFORplatform +  ;g_toplatform   CLr Mac
  8304.   xPro for INLIST(objtype,c_othead3r,c_otfield,c_otpictn
  8305.  , r Mac^ FoxPro for Mc_otrepfld,c_otband,c_otrepvar,c_ottext,c_otline,c_otbox,c_otworkar)or Mac
  8306.   ac
  8307.   
  8308.     CL&g_teo  lias..tidistamp > tidistamp Mac
  8309.   ac
  8310.   DO addsel WITH "Upd
  8311.      DEFAU ONSCAN
  8312.  DEFAU ONCASE
  8313.  DEFAUSELECTF 8 g_teo  lias STE 1
  8314.   L  E c_d ONT c_
  8315.   SELECTF 8 g_scrn lias) M ONT c_  ;\F ;g_newobjects
  8316.      ;junk   "S" ;CHR(13)LOW() SYS(3)),2,8 STE 1;\F ;g_tographicE " 
  8317.   SELECTF*eFROM  8 g_scrn lias)or Mac
  8318.   
  8319.   WHERE !DELETEDFON  CLplatform +  ;g__scrplatform   CLr Mac
  8320.   xPr!(objtype = c_otfontdata)o  CLr Mac
  8321.    DEuniqueid NOTOIN (SELECTFuniqueid FROM  8 g_scrn lias)or Mac
  8322.   
  8323.   WHERE platform +  ;g_toplatform)or Mac
  8324.   ac
  8325.     CLoktransport(comment)or Mac
  8326.    DEORDR,SBY objtype r Mac
  8327.   
  8328.   INTO CURSOR  8 junk STE 1    E c_d
  8329.   SELECTF*eFROM  8 g_scrn lias)or Mac
  8330.   
  8331.   WHERE !DELETEDFON  CLplatform +  ;g__scrplatform   CLr Mac
  8332.   xPr!(objtype = c_otband   CLINLIST(objcode,2,6))o  CLr Mac
  8333.    Dr!(objtype = c_otpictn
  8334.  )o  CLr Mac
  8335.    Dr!(objtype = c_otfontdata)o  CLr Mac
  8336.    Dr!blackbox(objtype,fillred,fillblue,fillgreen,fill   )o  CLr Mac
  8337.    DEuniqueid NOTOIN (SELECTFuniqueid FROM  8 g_scrn lias)or Mac
  8338.   
  8339.   WHERE platform +  ;g_toplatform)or Mac
  8340.   ac
  8341.     CLoktransport(comment)or Mac
  8342.    DEINTO CURSOR  8 junk STE 1 ONT c_
  8343.   ;\F_TALLY > 0
  8344.     
  8345.   SCAN Mac
  8346.    DEDO addsel WITH "New
  8347.      DE ONSCAN
  8348.  DEFAUL    && discard 83e cursorE c_d ONT c_ ONT c_  ;\F ;g_tpselcnt > 0 DE&& T3Pr variabl   s  zcremented  zeaddsel( STE 1m.tpcancel = 1
  8349.     *UPrompt us3rnin designate atxany iteos 3e does not want transportedE c_dDO tpselect WITH tparray,So.tpcancel,vers28.cap 8 g__scrplatform),vers28.cap 8 g_toplatform)E c_dDO CASE
  8350.  DELASE0 ;tpcancel = 1 DE&& us3rnpressed OK, so let's getxin it 14 DELASE0 ;tpcancel = 2 DE&& us3rnpressed "cancel" dlg83e select_dlgdialog 14 DEFAU ;g_status   314 DEFAU ;g_retn
  8351. ncode = c_cancel Mac
  8352.   lgsty1TO transprtdlacLASE0 ;tpcancel > 2 Mac
  8353.   * T3e
  8354.   aren'txany objects 83atxqu lify for transporting.  Lser deselected T . of 83em 14 DEFAU*UPretend like we'
  8355.   done 14 DEFAU ;g_status   314 DEFAU ;g_retn
  8356. ncode = c_yes
  8357.     
  8358.   lgsty1TO transprtdlac ONCASE
  8359.     E c_d* T3e
  8360.   aren'txany objects 83atxqu lify for transporting.
  8361.     *UPretend like we'
  8362.   done 14 DE ;g_status   314 AU ;g_retn
  8363. ncode = c_yes
  8364.     lgsty1TO transprtdl ONT c_  lgsty1c_  F,00;;;;;;000000000000000000000000000000000000000000000000000000;;;;;;;;;;;;;;;
  8365.        DEFAUProcfin
  8366.  hiINITSEL         DEFAULT .T. ;
  8367.  SELECTOBJoxPro forraprocfin
  8368.    ze ;
  8369.          STYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8370. PROCEDURE0initsel
  8371. *Initialize 83e tparray select_dlgarray
  8372.  ;g_tpselcnt = 0
  8373.  lgsty1c_  F,00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8374.        DEFAUProcfin
  8375.  hiADDSEL         DEFAULT .T. ;
  8376.  SELECTOBJoxPro forraprocfin
  8377.    ze ;
  8378.          STYL923  SIZEaEFAULT .sFOASSEMBLEFONMST c_dlafunct_dlg  ze ;
  8379.          STYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8380. PROCEDURE0addsel
  8381. PARAMETER STATUSONT Don'txus3 lgCCOUNTFON3e
  8382.   s zce 83e open "database" will often be a cursor 14;\F_WINDOWSnOR _MAC
  8383.      ;g_tpselcnt =  ;g_tpselcnt + 1
  8384.     DIMENS    tparray[ ;g_tpselcnt,3]STE 1tparray[ ;g_tpselcnt,1] = '√ '+assembl (STATUS STE 1tparray[ ;g_tpselcnt,2] = uniqueidSTE 1tparray[ ;g_tpselcnt,3] = objtypeE c_d M    E c_d ;g_tpselcnt =  ;g_tpselcnt + 1
  8385.     DIMENS    tparray[ ;g_tpselcnt,3]STE 1tparray[ ;g_tpselcnt,1] = '√ '+assembl (STATUS STE 1tparray[ ;g_tpselcnt,2] = uniqueidSTE 1tparray[ ;g_tpselcnt,3] = objtypeE  ONT c_lgsty1c_  F,00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8386.        DEFA  Funct_dlhiISSELECTEDSTYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8387. FUNCT    isselectedONT Retn
  8388. ns .T. if 83Pr uniqueid passed  zeidnum corresponds 8oxan iteoONT marked dlg83e tparray list 14PARAMETER idnum,mobjtype, mobjcode
  8389. DO CASE
  8390. LASE0 ;mobjtype = c_otfontdata
  8391.     lgsty1.T.
  8392. OTHERWI  E c_d ;pos   ASCAN(tparray,m.idnum STE 1;\F ;pos > 0
  8393.     
  8394.   * Check pos-1 s zce 83 s  s a two dimens28.algarray.  ASCAN retn
  8395. ns an element numberE c_dc_d* but w  are reT .y interested  ze83e column before 83e one 83atx83e matchxinok plac   z 14 DEFAUlgsty1IIF(LEFT(tparray[ ;pos-1],1) <> ' ',.T.,.F. STE 1    E c_d
  8396.   lgsty1.F 14 DE ONT c_ ONCASE
  8397. 923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8398.        DEFA  Funct_dlhiASSEMBLE         DEFAULT .T. ;
  8399.  ADDSELac
  8400.   ac
  8401.   raprocfin
  8402.    ze ;
  8403.          STYL923  SIZEaEFAULT .s: TYPE2NAMEFONMST c_dafunct_dlg  ze ;
  8404.          STYLac
  8405.   ac
  8406.   r  : CLEANPICTFONMST c_dafunct_dlg  ze ;
  8407.          STYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8408. FUNCT    assembl ONT Form 83e string us3d for us3rnselect_dlgof objects 8o transport
  8409. PARAMETER statstrg
  8410. PRIVATE0 ;strg
  8411. DO CASE
  8412. LASE0INLIST(objtype,c_ottxtbut,c_otradbut,c_otchkbox STE 1m.strg = PADR(statstrg,5)r Mac
  8413.   + PADR(type2name(objtype),15)or Mac
  8414.   + PADR(name,15)or Mac
  8415.   + PADR(cleanpict(PICTURE),30 STLASE0objtype = c_otfieldo  CLEMPTY(nameONMST&& it's a SAY express_dlSTE 1m.strg = PADR(statstrg,5)r Mac
  8416.   + PADR(type2name(objtype),15)or Mac
  8417.   + PADR(expr,45 STLASE0INLIST(objtype,c_otbox,c_otline STE 1;\F ;g_tographic14 DEFAU ;strg = PADR(statstrg,5)r Mac
  8418.   
  8419.   + PADR(type2name(objtype),15)or Mac
  8420.   
  8421.   + PADR("",15)or Mac
  8422.   
  8423.   + PADR("From "+ALLTRIM(STR(vpos,3))+","+ALLTRIM(STR(hpos,3))+"xin "or Mac
  8424.   
  8425.   + ALLTRIM(STR(vpos+HEIGHT,3))+","+ALLTRIM(STR(hpos+WIDTH,3)),45 STE 1    E c_d
  8426.    ;strg = PADR(statstrg,5)r Mac
  8427.   
  8428.   + PADR(type2name(objtype),15)or Mac
  8429.   
  8430.   + PADR("",15)or Mac
  8431.   
  8432.   + PADR("At: "or Mac
  8433.   
  8434.   + ALLTRIM(STR(ROUND(cvtreportvertical(vpos),0),3))r Mac
  8435.   
  8436.   + ","r Mac
  8437.   
  8438.   + ALLTRIM(STR(ROUND(cvtreportvertical(hpos),0),3))r Mac
  8439.   
  8440.   + ", Height: "r Mac
  8441.   
  8442.   + ALLTRIM(STR(ROUND(cvtreportvertical(height),0),3))r Mac
  8443.   
  8444.   + ", Width: "or Mac
  8445.   
  8446.   + ALLTRIM(STR(ROUND(cvtreportvertical(width),0),3)),45 STE 1 ONT c_OTHERWI  E c_d ;strg = PADR(statstrg,5)r Mac
  8447.   + PADR(type2name(objtype),15)or Mac
  8448.   + PADR(name,15)or Mac
  8449.   + PADR(expr,30 ST ONCASE
  8450. 92;\F_WINDOWS
  8451.     lgsty1LEFT( ;strg,5) + ansiinoem(RIGHT( ;strg,LEN( ;strg)-5) ST    c_d M   lgsty1 ;strg
  8452.  ONT c_3 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8453.        DEFA  Funct_dl: TYPE2NAME         DEFAULT .T. ;
  8454.  ASSEMBLEFONMST c_ddafunct_dlg  ze ;
  8455.          STYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8456. FUNCT    type2name
  8457. PARAMETER 1c_PRIVATE0strg
  8458. DO CASE
  8459. LASE0 ;n = c_otheaderE c_d ;strg = "Header"STLASE0INLIST( ;n,c_otworkar,c_otindex,c_otrel STE 1m.strg = "Environment"STLASE0 ;n = c_ottext
  8460. c_d ;strg = "Text"STLASE0 ;n = c_otlineE c_d ;strg = "Line"STLASE0 ;n = c_otboxE c_d ;strg = "Box"STLASE0 ;n = c_otrepfldSTE 1 ;strg = "Report field"STLASE0 ;n = c_otbandSTE 1 ;strg = "Band"STLASE0 ;n = c_otgroupE c_d ;strg = "Group"STLASE0 ;n = c_otlist
  8461. c_d ;strg = "List"STLASE0 ;n = c_ottxtbutE c_d ;strg = "Push button"STLASE0 ;n = c_otradbutSTE 1 ;strg = "Radio button"STLASE0 ;n = c_otchkboxE c_d ;strg = "Check box"STLASE0 ;n = c_otfield
  8462.     DO CASE
  8463. FAULASE0EMPTY(nameO14 DEFAU;\F!EMPTY(exprO14 DEFAUc_d ;strg = "SAY Express_dl"ST DEFAU    E c_d
  8464.   c_d ;strg = "Field"ST DEFAU ONT c_FAULASE0EMPTY(exprO14 DEFAU ;strg = "GET Field"ST DEOTHERWI  E c_dc_d ;strg = "Field"ST DE ONCASE
  8465. LASE0 ;n = c_otpopupE c_d ;strg = "Popup"STLASE0 ;n = c_otpictn
  8466.  E c_d ;strg = "Pictn
  8467.  "STLASE0 ;n = c_otrepvarE c_d ;strg = "Rpt variabl "STLASE0 ;n = c_otinvbutSTE 1 ;strg = "Inv button"STLASE0 ;n = c_otspinnerE c_d ;strg = "Spinner"STLASE0 ;n = c_otpdsetE c_d ;strg = "Printer driver"STLASE0 ;n = c_otfontdata
  8468.      ;strg = "Font data"STOTHERWI  E c_d ;strg = STR(objtype,4 ST ONCASE
  8469. 92lgsty1 ;strg
  8470.  
  8471. 923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8472.        DEFA  Funct_dlhiCLEANPICT         DEFAULT .T. ;
  8473.  ASSEMBLEFONMST c_ddafunct_dlg  ze ;
  8474.          STYL923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8475. FUNCT    cleanpict
  8476. PARAMETER  ;strg
  8477. PRIVATE0 ;atsiglSTONT Drop quotat_dlgmarks92;\FAT(LEFT( ;strg,1),CHR(34)+CHR(39)) > 0E c_d ;strg = SUBSTR( ;strg,2 ST ONT c_;\FAT(RIGHT( ;strg,1),CHR(34)+CHR(39)) > 0E c_d ;strg = SUBSTR( ;strg,1,LEN( ;strg)-1 ST ONT c_
  8478.  ;atsigl = AT("@", ;strg)92;\F ;atsigl > 0E c_d ;strg = LTRIM(SUBSTR( ;strg, ;atsigl+AT(' ',SUBSTR( ;strg, ;atsigl))))ST ONT c_
  8479. ;\FLEN( ;strg) > 30E c_d ;strg = LEFT( ;strg,27) + '...'
  8480.  ONT c_lgsty1 ;strg
  8481.  
  8482. 923 00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8483.        DEFAUProcedn
  8484.  : TPSELECT         DEFAULT .T. ;
  8485.  SELECTOBJNMST c_dd (procedn
  8486.    ze ;
  8487.          
  8488.        DEFA  FAULT .s: TOGGLEFONMST c_ddddafunct_dlg  ze ;
  8489.          
  8490.   NMST c_dddd DEF: OKVALIDFONMST c_dddafunct_dlg  ze ;
  8491.          
  8492.   NMST c_dddd DEF: WREADDEACFONMST c_dafunct_dlg  ze ;
  8493.          
  8494.       00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8495. PROCEDURE tpselect
  8496. PARAMETERS tparray, tpcancel, fromplat,toplat
  8497. DO CASE
  8498. LASE0 ;g_snippetso  CL ;g_newobjects92 DEptext = "These objects a
  8499.   either newxin the "+m.toplat+"xplatform or have "+r Mac
  8500.   "beelgmodifiedgmo
  8501.   recently dlg"+m.fromplat+"."STLASE0 ;g_newobjects92 DEptext = "These objects a
  8502.   newxin "+m.toplat+"."STLASE0 ;g_snippets92 DEptext = "These objects have beelgmodifiedgmo
  8503.   recently dlg"+m.fromplat+"."ST ONCASE
  8504. 92DO CASE
  8505. LASE0_WINDOWS
  8506.     ;\FNOT WEXIST("tpselect"O14 DEFAUDEFINE WINDOW tpselector Mac
  8507.   
  8508.   AT  0.000, 0.000 or Mac
  8509.   
  8510.   SIZE 25.538,116.000 r Mac
  8511.   
  8512.   TITLE "FoxPro Transporter"or Mac
  8513.   
  8514.   FONT "MS Sans Serif", 8or Mac
  8515.   
  8516.   FLOAT r Mac
  8517.   
  8518.   CLOSE0r Mac
  8519.   
  8520.   NOMINIMIZE r Mac
  8521.   
  8522.   DOUBLE14 DEFAUMOVE WINDOW tpselect CENTERSTE 1 ONT c_FAU;\FWVISIBLEF"tpselect"O14 DEF  ACT VATE0WINDOW tpselectoSAME  FAU    E c_d
  8523.   ACT VATE0WINDOW tpselectoNOSHOWSTE 1 ONT c_FAU@ 6.769,2.400 TO 8.154,113.000 r Mac
  8524.   PATTERN 1 r Mac
  8525.   PEN 1, 8or Mac
  8526.   COLOR RGB(,,,192,192,192O14 DE@ 8.154,2.600 GET xsel r Mac
  8527.   PICTURE "@&N"or Mac
  8528.   FROM tparrayor Mac
  8529.   SIZE 17.500,68.875or Mac
  8530.   DEFAULT 1 r Mac
  8531.   FONT "FoxFont", 9 r Mac
  8532.   VALIDxinggle(O14 DE@ 1.462,50.400 SAY "Uncheck any items you do" + CHR(13) + r Mac
  8533.   ""or Mac
  8534.   SIZE 1.000,25.167, 0.000 r Mac
  8535.   FONT "MS Sans Serif", 8or Mac
  8536.   STYLE "BT"ST DE@ 2.385,50.200 SAY "not"or Mac
  8537.   SIZE 1.000,4.167, 0.000 r Mac
  8538.   FONT "MS Sans Serif", 8or Mac
  8539.   STYLE "BIT"ST DE@ 2.385,55.000 SAY "want in be transported."or Mac
  8540.   SIZE 1.000,22.167, 0.000 r Mac
  8541.   FONT "MS Sans Serif", 8or Mac
  8542.   STYLE "BT"ST DU@ 0.923,93.600 GET tpcancel r Mac
  8543.   PICTURE "@*VT \!\<OK;\?\<Cancel"or Mac
  8544.   SIZE 1.846,16.333,0.308or Mac
  8545.   DEFAULT 1 r Mac
  8546.   FONT "MS Sans Serif", 8or Mac
  8547.   STYLE "B"or Mac
  8548.   VALIDxokvalid(O14 DE@ 6.923,14.000 SAY "Type"or Mac
  8549.   SIZE 1.000,4.833, 0.000 r Mac
  8550.   FONT "MS Sans Serif", 8or Mac
  8551.   STYLE "BT"ST DE@ 6.923,62.000 SAY "Express_dl/Prompt"or Mac
  8552.   SIZE 1.000,17.833, 0.000 r Mac
  8553.   FONT "MS Sans Serif", 8or Mac
  8554.   STYLE "BT"ST DE@ 6.923,38.200 SAY "Variabl "or Mac
  8555.   SIZE 1.000,7.833, 0.000 r Mac
  8556.   FONT "MS Sans Serif", 8or Mac
  8557.   STYLE "BT"ST DE@ 6.923,5.800 SAY "Stat"or Mac
  8558.   SIZE 1.000,4.000, 0.000 r Mac
  8559.   FONT "MS Sans Serif", 8or Mac
  8560.   STYLE "BT"ST DE@ 1.462,3.000 SAY ptext r Mac
  8561.   SIZE 4.000,33.833 r Mac
  8562.   FONT "MS Sans Serif", 8or Mac
  8563.   STYLE "B"ST DE
  8564.     ;\FNOT WVISIBLEF"tpselect"O14 DEF  ACT VATE0WINDOW tpselectSTE 1 ONT c_FAU  FAUREAD CYCLEr Mac
  8565.   MODALr Mac
  8566.   DEACT VATE0wreaddeac(O14 DE  FAURELEASE0WINDOW tpselectSTLASE0_DOS
  8567.     ;\FNOT WEXIST("tpselect"O14 DEFAUDEFINE WINDOW tpselector Macac
  8568.   FROM INT((SROW()-23)/2),INT((SCOL()-77)/2) r Mac
  8569.   
  8570.   TO INT((SROW()-23)/2)+22,INT((SCOL()-77)/2)+76 r Mac
  8571.   
  8572.   TITLE "FoxPro Transporter"or Mac
  8573.   
  8574.   FLOAT r Mac
  8575.   
  8576.   CLOSE0r Mac
  8577.   
  8578.   NOMINIMIZE r Mac
  8579.   
  8580.   DOUBLE r Mac
  8581.   
  8582.   COLOR SCHEME 5STE 1 ONT c_FAU;\ WVISIBLEF"tpselect"O14 DEF  ACT VATE0WINDOW tpselectoSAME  FAU    E4 DEF  ACT VATE0WINDOW tpselectoNOSHOWSTE 1 ONT c_FDU@ 0,0 CLEARSTE 1@ 8,1 GET xsel r Mac
  8583.   PICTURE "@&N"or Mac
  8584.   FROM tparrayor Mac
  8585.   SIZE 13,72or Mac
  8586.   DEFAULT 1 r Mac
  8587.   VALIDxinggle(Oor Mac
  8588.   COLOR SCHEME 614 DE@ 1,30 SAY "Uncheck any items you do" r Mac
  8589.   SIZE 1,24, 0ST DE@ 2,30 SAY "not"or Mac
  8590.   SIZE 1,3, 0ST DE@ 2,34 SAY "want in be transported."or Mac
  8591.   SIZE 1,23, 0ST DE@ 1,62 GET tpcancel r Mac
  8592.   PICTURE "@*VT \!\<OK;\?\<Cancel"or Mac
  8593.   SIZE 1,10,0 r Mac
  8594.   DEFAULT 1 r Mac
  8595.   VALIDxokvalid(O14 DE@ 7,10 SAY "Type"or Mac
  8596.   SIZE 1,4, 0ST DE@ 7,40 SAY "Express_dl/Prompt"or Mac
  8597.   SIZE 1,17, 014 DE@ 7,25 SAY "Variabl "or Mac
  8598.   SIZE 1,8, 0ST DE@ 7,5 SAY "Stat"or Mac
  8599.   SIZE 1,4, 0ST DE@ 1,2 SAY ptext r Mac
  8600.   SIZE 5,2614 DE
  8601.     ;\FNOT WVISIBLEF"tpselect"O14 DEF  ACT VATE0WINDOW tpselectSTE 1 ONT c_FAU  FAUREAD CYCLE r Mac
  8602.   MODAL r Mac
  8603.   DEACT VATE0wreaddeac(O14 DE  FAURELEASE0WINDOW tpselect
  8604.  ONCASE
  8605. 92  00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8606.       ac
  8607.   Funct_dl: TOGGLE14      ac
  8608.  Calledgby: TPSELECT  ac
  8609.   
  8610.   (procedu
  8611.   in TRANSPRT.PRGO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8612. FUNCT ONxinggle    Tnggle mark
  8613. ;\ LEFT(tparray[xsel,1],1) <> ' '  FAUtparray[xsel,1] = STUFF(tparray[xsel,1],1,1,' 'O14    E4 DEtparray[xsel,1] = STUFF(tparray[xsel,1],1,1,'√'O14 ONT c_SHOW GETS
  8614.  RETURN .F.
  8615. 92  00;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8616.       ac
  8617.   Funct_dl: OKVALID14      ac
  8618.  Calledgby: TPSELECT  ac
  8619.   
  8620.   (procedu
  8621.   in TRANSPRT.PRGO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8622. FUNCT ONxokvalid    Simulate a cancel if no objects we
  8623.   selected.
  8624. ;\ tpcancel = 1  FAUPR VATE0m.i  FAUm.cnt = 0ST DEFOR m.i = 1 TO m.g_tpselcnt Mac
  8625.   ;\ LEFT(tparray[m.i,1],1) <> ' '  FAc
  8626.   
  8627.  m.cnt = m.cnt + 1  FAUE 1 ONT c_FAU ONFORc_FAU;\ m.cnt = 0ST DEFAUm.tpcancel = 3ac&& code that means, "just open as is."ST DE ONT c_ ONT c_    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8628.       ac
  8629.   Funct_dl: WREADDEAC14      ac
  8630.  Calledgby: TPSELECT  ac
  8631.   
  8632.   (procedu
  8633.   in TRANSPRT.PRGO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8634. FUNCT ONxwreaddeac       Deactivate Code from screel: TP     CLEARUREADc_    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8635.       ac
  8636.   Funct_dl: EnvSelect
  8637.       ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8638. FUNCT ONxEnvSelect
  8639. PR VATE0m.i  * Was an environment record selected for transport?
  8640. FOR m.i = 1 TO m.g_tpselcnt Mac;\ IsEnviron(tparray[m.i,3]) AND LEFT(tparray[m.i,1],1) <> " "ST DEFAURETURN .T.
  8641.  DE ONT c_ ONFORc_RETURN .F.
  8642. 92  000000000000000000000000000000000000000000000000000000000000000000000;;;;;;;;
  8643.       ac
  8644.   Funct_dl: OutputOrd        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8645. FUNCT ONxoutputord
  8646. PARAMETER m.otype,0m.rno    Funct_dl in sort screel and report files.  We want ihe header and environment    records in be at ihe "top" of ihe platform, and oiher records in be in iheir    original order.
  8647. ;\ objtype <= 4  FAURETURN STR(m.otype,3)+STR(m.rno,3)14     DE  FAURETURN STR(m.rno,3)+STR(m.otype,3)c_ ONT c_    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8648.       ac
  8649.   Procedu
  8650.  : PUTWINMSG        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8651. PROCEDURE putwinmsg
  8652. PARAMETER m.msg
  8653. ;\ _WINDOWS OR _MAC14
  8654.   SET MESSAGE TO m.msg
  8655.  ONT c_       SETALL - Create program's environment.
  8656.      Descript_dl:    Save the user's environment that is being modifiedgby ihe GENSCRN,    ihen issue various SET commands.
  8657.      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8658.       ac
  8659.  Procedu
  8660.  : SETALL14      ac
  8661.  Calledgby: TRANSPRT.PRG  ac
  8662.   
  8663.     ac
  8664.   
  8665.   
  8666.       ac
  8667.   
  8668.  Calls: ESCHANDLER c
  8669.   
  8670.   (procedu
  8671.   in TRANSPRT.PRGO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8672. PROCEDURE setallc_  CLEARUPROGRAM  CLEARUGETS
  8673.  
  8674. m.escape = SET("ESCAPE"O14SET ESCAPE ON
  8675.  
  8676. m.onescape = ON("ESCAPE"O14ONxESCAPE DO eschandler     SET ESCAPE OF c_m.trbetweel = SET("TRBET"O14SET TRBET OF c_m.comp = SET("COMPATIBLE"O14SET COMPATIBLEEFOXPLUS
  8677.  m.device = SET("DEVICE"O14SET DEVICE TO SCREEN
  8678.  
  8679. m.rbord = SET("READBORDER"O14SET READBORDER ON
  8680.  
  8681. m.status = SET("STATUS"O14 SET STATUS OF c_c_m.currarea = SELECT(O14
  8682. m.udfparms = SET('UDFPARMS'O14SET UDFPARMS TO VALUE
  8683. 92m.mtopic = SET("TOPIC"O14;\FSET("HELP") = "ON"ST DEDO CASEE
  8684.     CASEEATC(".DBF",SET("HELP",1)) > 0ST DEFAUSET TOPIC TO CHR(254)+" Transporter"ST DEFAUONxKEY LABEL F1 HELP ■ Transporter
  8685.     CASEEATC(".HLP",SET("HELP",1)) > 0 DE  FAUFAUSET TOPIC TO Transporter Dialog
  8686.  DEFAUONxKEY LABEL F1 HELP Transporter Dialog
  8687.  DE ONCASE
  8688.  ONT c_  m.memowidth = SET("MEMOWIDTH"O14SET MEMOWIDTH TO 256c_c_m.cursor = SET("CURSOR"O14SET CURSOR OF c_c_m.consol = SET("CONSOLE"O14SET CONSOLE OF c_c_m.bell = SET("BELL"O14SET BELL OF c_c_m.exact = SET("EXACT"O14SET EXACT ON
  8689.  
  8690. m.deci = SET("DECIMALS"O14SET DECIMALS TO 10ST
  8691. m.fixedg= SET("FIXED"O14SET FIXED ON
  8692.  
  8693. m.print = SET("PR NT"O14SET PR NT OF c_c_m.unqset = SET("UNIQUE"O14SET UNIQUE OF c_c_m.safety = SET("SAFETY"O14SET SAFETY OF c_c_m.exclusive = SET("EXCLUSIVE"O14SET EXCLUSIVE ON
  8694.  
  8695. ;\ versnum() > "2.5"ST DEm.mcollate = SET("COLLATE"O14FAUSET COLLATE TO "machine"ST ONT c_       CLEANUP - Restore environment to pre-execut_dl state.
  8696.      Descript_dl:    Put SET command settings back ihe way we found ihem.
  8697.      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8698.       ac
  8699.  Procedu
  8700.  : CLEANUP14      ac
  8701.  Calledgby: TRANSPRT.PRG  ac
  8702.   
  8703.     ac
  8704.   
  8705.   
  8706.   
  8707.   
  8708.     ac
  8709.   
  8710. : ERRORHANDLER c
  8711.   
  8712. (procedu
  8713.   in TRANSPRT.PRGO14  
  8714.   
  8715.     ac
  8716.   
  8717. : CONVERTTYPE() 
  8718.   
  8719. (funct_dl  in TRANSPRT.PRGO14  
  8720.   
  8721.     ac
  8722.   
  8723. : ESCHANDLER c
  8724.   
  8725.  
  8726. (procedu
  8727.   in TRANSPRT.PRGO14      ac
  8728.   
  8729.  Calls: WRITERESULT  ac
  8730.   (procedu
  8731.   in TRANSPRT.PRGO14  
  8732.   
  8733.     ac
  8734.   
  8735. : DEACTTHERM c
  8736.   
  8737.  
  8738. (procedu
  8739.   in TRANSPRT.PRGO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8740. PROCEDURE cleanup
  8741. PARAMETER m.cancafter
  8742.  ;\ PARAMETERS() = 0ST DEm.cancafter = .F.
  8743.  ONT c_;\ NOT EMPTY(m.g_20aliasO14FAU;\ m.g_status != 0ST DEac;\ USED(m.g_tempaliasO14FAUFAUFAUSELECT (m.g_tempaliasO14 c
  8744.   
  8745.  
  8746. USE  FAUFAU ONT c_ DEac;\ USED(m.g_fromobjonlyaliasO14 c
  8747.   
  8748.  
  8749. SELECT (m.g_fromobjonlyaliasO14 c
  8750.   
  8751.  
  8752. USE  FAUFAU ONT c_ DEac;\ USED(m.g_boxeditemsaliasO14 c
  8753.   
  8754.  
  8755. SELECT (m.g_boxeditemsaliasO14 c
  8756.   
  8757.  
  8758. USE  FAUFAU ONT c_ DEacSELECT (m.g_20aliasO14FAU
  8759.  
  8760. USE  FAUFAUSELECT (m.g_scrnaliasO14FAU      FAUFAUDO writeresult   DE ONT c_ ONT c_  ONxERROR &onerror  ONxESCAPE &onescape
  8761.  
  8762. ;\ m.consol = "ON"ST DESET CONSOLE ON
  8763.        FAUSET CONSOLE OF c_ ONT c_  ;\ m.escape = "ON"ST DESET ESCAPE ON
  8764.        FAUSET ESCAPE OF c_ ONT c_  ;\ m.bell = "ON"ST DESET BELL ON
  8765.        FAUSET BELL OF c_ ONT c_  ;\ m.exact = "ON"ST DESET EXACT ON
  8766.        FAUSET EXACT OF c_ ONT c_  ;\ m.comp = "ON"ST DESET COMPATIBLEEON
  8767.   ONT c_  ;\ m.print = "ON"ST DESET PR NT ON
  8768.   ONT c_  ;\ m.fixedg= "OF "ST DESET FIXED OF c_ ONT c_  ;\ m.trbetweel = "ON"ST DESET TRBET ON
  8769.   ONT c_  ;\ m.unqset = "ON"ST DESET UNIQUE ON
  8770.   ONT c_  ;\ m.rbord = "OF "ST DESET READBORDER OF c_ ONT  DE    ;\ m.status = "ON"ST DESET STATUS ON
  8771.   ONT c_  SET DECIMALS TO m.deci14SET MEMOWIDTH TO m.memowidth14SET DEVICE TO &device14SET UDFPARMS TO &udfparms14SET TOPIC TO &mtopic
  8772.  
  8773. ;\ versnum() > "2.5"ST DESET COLLATE TO "&mcollate"ST ONT c_ DE  ONxKEY LABEL F1
  8774. POPxKEYc_c_USE  DELETE FILEE(m.g_tempindexO14SET MESSAGE TOc_  SELECT (m.currareaO14
  8775. DO deactiherm
  8776.  
  8777. ;\ m.cursor = "ON"ST DESET CURSOR ON
  8778.        FAUSET CURSOR OF c_ ONT c_  ;\ m.safety = "ON"ST DESET SAFETY ON
  8779.   ONT c_  ;\ m.talkset = "ON"ST DESET TALK ON
  8780.   ONT c_  ;\ m.exclusive = "ON"ST DESET EXCLUSIVE ON
  8781.        FAUSET EXCLUSIVE OF c_ ONT c_;\ m.talkset = "ON"ST DESET TALK ON
  8782.   ONT c_  ;\ m.cancafter
  8783.     CANCELc_ ONT  DE         WRITERESULT - Writes ihe convertedgcursor to ihe SCX/FRX/LBX/whatever.  The point of ihis is that we    
  8784.   
  8785.  needgto write ihe records in iheir original order so we don't mees up any groups.  We also need    
  8786.   
  8787.  to keep records for a given platform contiguous.
  8788.      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8789.       ac
  8790.  Procedu
  8791.  : WRITERESULT14      ac
  8792.  Calledgby: CLEANUP 
  8793.     ac
  8794.   (procedu
  8795.   in TRANSPRT.PRGO14      ac
  8796.   
  8797.  Calls:EDOCREATE     ac
  8798.   (procedu
  8799.   in TRANSPRT.PRGO14  
  8800.   
  8801.     ac
  8802.   
  8803. : UPDTHERM c
  8804.   
  8805.  
  8806.   (procedu
  8807.   in TRANSPRT.PRGO14   4  
  8808.   
  8809.     acUses: M.G_SCRNALIAS
  8810.   
  8811.   
  8812.       ac
  8813.   Indexes: TEMP
  8814.   
  8815.     ac
  8816.   
  8817.     (tagO14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8818. PROCEDURE writeresult  PR VATE m.platforms, m.loop, m.ihermstep
  8819.   ;\ g_filetype = c_project   DESELECT (m.g_20aliasO
  8820.   
  8821.  
  8822.   && Close ihe database so we can replac  it.
  8823.  
  8824.  
  8825. USE  FAU   DESELECT (m.g_scrnaliasO 
  8826.  
  8827.   && Copy ihe temporarygcursor to ihe database and
  8828.     COPY TO (m.g_scrndbfO
  8829.   
  8830.  
  8831.  &&  
  8832.  
  8833.  get rid of ihe cursor
  8834.  
  8835.  
  8836. USE        FAUREPLACE ALL platform WITH UPPER(platformO14FAU  FAU* Get a list of ihe platforms we needgto write.
  8837.  
  8838.  
  8839. SELECT DISTINCT platform ;  FAUFAUFROM (m.g_scrnaliasO ;  FAUFAUWHERE !DELETED() ;  FAUFAU NTO ARRAY plistST DEm.platforms = _TALLYc_FAU  FAU* The following select creates a newgcursor with ihe desiredgstructu
  8840.  .  We write  FAU* into ihis and ihen dump ihe cursor to disk.  It's a bit cumbersome, but reduces14FAU* ihe chances of frying ihe original file.
  8841.  
  8842.  
  8843. m.g_tempalias = "S"+SUBSTR(LOWER(SYS(3)),2,8O14FAUDO docreate WITH m.g_tempalias, m.g_filetype14FAU  FAU* We needgto write DOS/UNIX label records in ihe order we want ihe objects io appear.
  8844.  
  8845.  
  8846. * So, we create ihis index and set order to it when we want io write ihose records.
  8847.  
  8848.  
  8849. ;\ m.g_filetype = c_label  FAUFAUSELECT (m.g_scrnaliasO14FAUFAU NDEX ON platform + ;  FAUFAU  IIF(objtype = c_ot20label,CHR(1)+CHR(1), STR(objtype,2)) + ;  FAUFAU  STR(objcode,2) + ;  FAUFAU  STR(vpos,3) TAG temp   DE ONT c_FAU   DE;\ m.g_updenviron  FAUFAUSELECT (m.g_scrnaliasO14FAUFAU NDEX ON outputord(objtype,recno()) TAG temp1
  8850.  DE ONT c_FAU   D m.ihermstep = (100 - m.g_mercury)/RECCOUNT(O14FAU  FAU* Write ihe records for each platform.
  8851.  
  8852.  
  8853. FOR m.loop = 1 TO m.platforms  FAUFAUSELECT (m.g_scrnaliasO14FA 
  8854.   
  8855. FAUFAUDO CASE  FAUFAUCASE m.g_filetype = c_label  FAUFAU DESET ORDER TO TAG temp   DEFAUCASE m.g_updenviron  FAUFAU DESET ORDER TO TAG temp1
  8856.  DE 
  8857.  OTHERWISE  FAUFAU DESET ORDER TO  FAUFAU ONCASE    FAUFAUSCAN
  8858. FOR platform = plist[m.loop] AND !DELETED()  FAUFAU  SCATTER MEMVAR MEMO  FAUFAUFAUSELECT (m.g_tempalias)  FAUFAU  APPEND BLANK  FAUFAU  GATHER MEMVAR MEMO  FAUFAUFAUSELECT (m.g_scrnaliasO14FA 
  8859.   
  8860. FAUFAU
  8861.  
  8862. m.g_mercury = m.g_mercury + 5  FAUFAU  DO updiherm WITH m.g_mercury  FAUFAU ONSCAN
  8863.  DE ONFOR  FAU   DESELECT (m.g_20aliasO
  8864.   
  8865.  
  8866.   && Close ihe database so we can replac  it.
  8867.  
  8868.  
  8869. USE  FAU   DESELECT (m.g_tempaliasO 
  8870.  
  8871.   && Copy ihe temporarygcursor to ihe database and
  8872.     COPY TO (m.g_scrndbfO
  8873.   
  8874.  
  8875.  &&  
  8876.  
  8877.  get rid of ihe cursor
  8878.  
  8879.  
  8880. USE  FAU   DESELECT (m.g_scrnaliasO 
  8881.  
  8882.   && Get rid of ihe master cursor
  8883.  
  8884.  
  8885. USE   ONT c_  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8886.       ac
  8887.  Function: VERSNUM14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8888. FUNCTIONxversnum    Retu
  8889. ngstring corresponding io FoxPro version number
  8890. RETURN wordnum(vers(),2O14
  8891.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8892.       ac
  8893.  Function: CPTRANS14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8894. FUNCTIONxcptrans14* Translate from one codepage io anoiher, if iranslation is in effect.  Note ihat  * ihis function takes parameters in a different order than CPCONVERT.
  8895. PARAMETER m.tocp, m.fromcp, m.strgc_;\ c_cptrans AND versnum() > "2.5"ST DERETURN CPCONVERT(m.fromcp, m.tocp, m.strgO14      FAURETURN m.strgc_ ONT  DE    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8896.       ac
  8897.  Function: CPTCOND14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8898. FUNCTIONxcptcond    Conditionally iranslate from one codepage io anoiher, if iranslation is in effect.14* Note ihat ihis function takes parameters in a different order than CPCONVERT.DE    Only iranslate if ihe current database isn't already ihe tocp.
  8899. PARAMETER m.tocp, m.fromcp, m.strgc_;\ c_cptrans AND cpdbf() <> m.tocp AND versnum() > "2.5"ST DERETURN CPCONVERT(m.fromcp, m.tocp, m.strgO14      FAURETURN m.strgc_ ONT  DE      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8900.       ac
  8901.  Function: getcodepage14      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;scrnaliasO14FAUFA;;;;;;;;;;;;;;;;;dbliasO
  8902.   
  8903. ERETURN CPCONVERT(m.fromcp, m.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8904.       ac
  8905.  Fuonally iranslate el  FAUFAUSELECT  TO  FAUFAU ONCAS;;;;;;;;;;;;;;;;;.fromcp,Alleffect.  --;;;ac
  8906.  Exis;;;;;D CPTRANS14iasO14FAUFA;;;;;;gc_ ONT 43;;;;;;;;;;;;;;;;;RN CPCONVFRT(m.fromcp, m.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8907.       ac
  8908.  Fuonally iranslatATHE0rgc_;5R MEMO in efm + ;  ;;;;;;;;;;;;;;;;;.fromcVocp"+ DE ONrmpt()+";OpECTAs Is;\?CanceliasO14FAUFA;;;;;;orar769es p
  8909. FOR0 ONT;;;;;;;;;;;;;RN Cady ihe tocp.
  8910. PAm.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8911.       ac
  8912.  Fp;;;idiranslate el  MEMVA5R MEMO in efecnskftep ;;;;;;;;;;;;;;;;;.fromcVoFA nt..;;;;;;;;;;;;;;;;;;orar769es p
  8913. FOR0 ONT;;;;;;;;;;;;;RN Cady ihe tocp.
  8914. PAm.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8915.       ac
  8916.  Fnskftepiransla MEMer w&& no exis;;;;;STR(ob/l,C m.g_merdenviron  FAUFAUSELECT (m.g_scrnaliasO14FAUFAU NDEX ON outputor2AU  FAU* Write ihe records for each platform.
  8917.  
  8918. FOR m.loop;;;;;;;;;;;;;;;orrsoEMVA65E      ;;;;;;;;;;.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8919.       liasO14FA 
  8920.   
  8921. FAUFAUDO CASE  FAUFEFAUCASE m.g_updenviron  FAUFAU DESET ORDER TO TAG temp1
  8922.  DE 
  8923.  OTHERWIE  FAUFAU DESET ORDER TO  FAUFAU ONCASE    FAUFAUSCAN
  8924. FOR platform = plist[m.loop] ANUSELECT (m.g_tempFAU  SCATTER MEMVAR MEMO  FAUFAUFNUSELECT (m.g_tempalias)  FAUFAU  APPEND BLANK  FAUFAU  GATHER we can replac  it.
  8925.  
  8926.  
  8927. USE  FAU   DESELECT (m.g_t;;;;;;;
  8928.     it.
  8929.  
  8930.  
  8931. USE  FFR   DmpaliasO 
  8932.  
  8933.  ,"LabelsO 
  8934.  
  8935.   Get rid of ihe maorarygcure cFOR m.loop;;;;;;;;;;;;.tocp, m.strgO14      et a list of ihe tion: g of ihe cursor
  8936.  
  8937. rarygcur;;dbliESELECT (m.g_scrnaliasO 
  8938.  
  8939.   && Get rid of ihe maorer cursor
  8940.  
  8941.  
  8942. USE;;;;;;;;.tocp, m.strgO14      et a list of ihe tionns AND cpdbf() <>;;;;;;;;;;;;;;;;;;;;
  8943.       ac
  8944.  Function: VERSNUM14      ;;;;;;;;;mcp, m.tocp, m.st;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8945. FUNCTIONxversnum.loop;;;;;;;;;;;;.tocp, m.strgO14      et a list of ihe tionns AND ihe cursor
  8946.  
  8947. r5cp AN  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SEL;;;;;;;;;;;;mcp, m.t;;;;
  8948.     Function: CPTRANS14     ;;;sac
  8949.  Fun;;;;;;;;;;;;;;;;;
  8950. FUNCTION6r
  8951.  
  8952. num.loop;;;;;;;;;;;;.tocp, m.strgO14      et a list of ihe tionns ANf ihe cursor
  8953.  
  8954. r8cp AN  ;;;;;;;;;on is in effect.  Note ihat  * ihis function takes  cFOR m.loop;;;;;;;;;;;;.tocp, m.strgO14      et a list of ihe tionns AND cpdbf() <>;noi0.154N  ;;;; in effect.14* Note ihat ihis function takes parameters in a different order than CPCONVERT.DE    Only  * ihis function current database;;;;;;;.tocp, m.strgO14      et a list of ihe tionns AND cpdbf() <>;@ ;;;;;;40on is in efecnskftep ;;;;;;;;;;;;;;;;;.fromcVoFA nt..;;;;;;;;;;;;;;;;;;orar769es p
  8955. FOR0 ONT;;;;;;;;;;;;;RN Cady itabase;;;;;;;.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8956.       ac
  8957.  FnskftepiranslatATHE0rgc_;40on is in efm + ;  ;;;;;;;;;;;;;;;;;.fromcVocp"+ DE ONrmpt()+";\?CanceliasO14FAU;;;;;;;;orar769es p
  8958. FOR0 ONT;;;;;;;;;;;;;RN Cady itabase;;;;;;;.tocp, m.strgO14      et a list of ihe tion: getcodepage;
  8959.       ac
  8960.  Fp;;;idiranslaD BLANKCAUFA_FAU OR _   OE  FA  FAUFAUSELECT (m.g_scrnaliasO14     E  FAAN
  8961.  
  8962.  
  8963.  
  8964. USE<> "LBOnlAND (hasm.g_mer("FAUF) OR hasm.g_mer("   On)t[m.loop]ON outputordbf() <>;O  FAUFAU ONCAS=NVFRCASE    FAUFAUSC Write ihe records for each platfo FROM INT((SROW()-21)/2),INT((SCOL()-67)/2)age;
  8965.       lO INT((SROW()-21)/2)+20,INT((SCOL()-67)/2)+66E  FAUFEFAUCASE m.g_updenviron  FAUFAU DESET ORDESHA_temU DESET ORDER TO TAG temp1
  8966.  DE 
  8967.  OTHERWIg_updenviron  OLOR SCHEME 5CASE    FAUFAUSCAN
  8968. FOR platform = plist[m.loop] ANUSELECT (m.g_tempaAU  SCATTER MEMVAR MEMO  FAUFAUFNUSELECT (m.g_tempalias)  FAUFAU  APPEND BLANK  FAUFAU  GATHER1,2lO 16,52AU  FAU*noi,2lac  it.
  8969. g_RSNU 
  8970. USE  c 
  8971.  
  8972. LEC DESELECT (m.g_tDmpaliasO 
  8973.  
  8974.  Get rid of ihe maora,12R mAU  FAU*noi,15iESELUPP (m.g_scrnaliasO 
  8975.  
  8976.   && Get rid of ihe maora,19bf() <>;;;;,2lac ;
  8977.       ac
  8978.  Function: VERSNUM14     iasO14FAU;;;;;;;;ora,urr mAU  FAU*no4N ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;O14FAU;;;;;;;;;;;;;;;;;;ora,u
  8979. numbf() <>;@ 9,4;;;;;;on is in effect.  Note ;;;;;;;;;;;;;;;;;ora, AN mAU  FAU*norre9; in effect.14* Note ihat ihis function takes paramliasO14     different order than CPCONVERT.DE    Only  * ihis ;;;;
  8980. FAN 4;;;;;;;;;;;;;RN Cady .g_scrnaliasO14     g_updenviron  OLOR SCHEME 5, 6AU  FAU*noi,45s in efm + ;  ;;;at ihis function omcVocp\!on is in e& OpEC;OpECTAs Is;\?CanceliasO14FAU;;;;;;;;ora, cur;;;;;;;;;;;;;RN Cady itabase;;;;;;ac
  8981.  Fp;;;idiran  GATHER1,4;;;;;;on is in iasO14FAU;;;;;;;;ora,9R mAU  FAU*noi2,4; in efecnewc
  8982.  Func;;;at ihis functi.fromcCeffect.  New tosO14FAUFasO14FAU;;;;;;;;ooi,25;;;;;;;;;;;;;RN Cady .T.tabase;;;;;;ac
  8983.  
  8984.  ctrliran  GATHER3,4; in efecsnscreunc;;;at ihis functi.fromcCeffect.s Mo   Recently Modifi  iasO14FAU;;;;;;;;ora,u4;;;;;;;;;;;;;RN Cady .T.tabase;;;;;;ac
  8985.  
  8986.  ctrliran  GATHER4,8lac ;
  8987. ;;;O14FAU Equi;;;enteffect. iasO14FAU;;;;;;;;ora,uOR mAU  FAU*noi_;4s in efecnUFAU ONCAS;;;at ihis functi.fromcCeAlleffect.  -- ReAUS;  Exis;;;;;D CPTRANS14iasO14FAU;;;;;;;;ora,4    ;;;;;;;;;;RN Cady .F.tabase;;;;;;ac
  8988.  
  8989.  ctrliran   <>;@ ;N ;;;;;;;;;;c
  8990.  Function:eERSNU;;;;;;;;;;;;;;;;;;ora, 4R mAU  FAU*no5,2lac ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;add,;;;;;;;;;;;;;;;;;ora,u5, mAU  FAU*no6,2lac ;upd;;;, ;;;reAUS;  O14FAU : CPTRANS14;;;;;;;;;;;;;;;;;ora,u7R mAU  FAU*FAUFAUSCAN
  8991. NOT
  8992. FOR platform = plist[m.loop] ANUSELECT (m.g_tempals for  APPEND BLANK  R MEMO  FAUFAON outputor2AU  FAU*FAUFAUSC Write ihe records for each platfo FROM INT((SROW()-15)/2),INT((SCOL()-68)/2)age;
  8993.       lO INT((SROW()-15)/2)+R4,INT((SCOL()-68)/2)+6    ;;;;;;;;;;SE m.g_updenviron FA FAUFAU DESET ORDESHA_temU DESET ORDER TO TAG temp1
  8994.  DE 
  8995.  OTHERWIg_updenviron  OLOR SCHEME 5CASE    FAUFAUSCAN
  8996. FOR platform = plist[m.loop] ANUSELECT (m.g_tempaAU  SCATTER MEMVAR MEMO  loop] ANUSELECT (m.g_tempalias)  FAUFAU  APPEND BLANK  FAUFAU  GATnoi,2lac  it.
  8997. g_RSNU 
  8998. USE  c 
  8999.  
  9000. LEC DESELECT (m.g_tDmpaliasO 
  9001.  
  9002.  G;;;;;;;;;;;;;;;;ora,12R mAU  FAU*noi,15iESELUPP (m.g_scrnaliasO 
  9003.  
  9004.   && Get rid of ihe maora,19bf() <>;;;;,2lac ;
  9005.       ac
  9006.  Function: VERSNUM14     iet rid of ihe maora,urr mAU  FAU*no4N ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;O14FAU;;;;;;;;;;;;;;;;;;ora,u
  9007. numAU  FAU*norr4;;;;;;on is in effect.  Note ;;;;;;;;;;;;;;;;;ora, AN mAU  FAU*no9,4; in effect.14* Note ihat ihis function takes paramliasO14     different order than CPCONVERT.DE    Onl;;;;;;;;;;;;;;;orAN 4;;;;;;;;;;;;;RN Cady .g_scrnaliasO14     g_updenviron  OLOR SCHEME 5, 6AU  FAU*noi,45s in efm + ; e ihat ihis function omcVocp\!on is in e& OpEC;\?CanceliasO14FAU;;;;;;;;ora, cur;;;;;;;;;;;;;RN Cady itabase;;;;;;ac
  9008.  Fp;;;idiran  FAU*no5,2lac ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SEL;;;iasO14FAU;;;;;;;;ora,u7R mAU  FAU*no6,2lac ;O14FAU : CPTRANS1;;;;;;;;;sac
  9009.  Fun;;;;;;;;;;;;;;;;;;ora,u7R mAU  FAU*FAUFAUSCAN
  9010. NOT
  9011. FOR platform = plist[m.loop] ANUSELECT (m.g_tempaliafor  APPEND BLANnslaD BLANKOTHERWIEMO  loDO error;;;dl;;;WITH "UnknowCT fferenversNS1.", LiteNO()14  error3FAUFAREtioNNVFRCAD BCAUF
  9012.  
  9013. AN
  9014. NOT
  9015. FOR platform = plist[m.loUSELECT (m.g_tempaliafor  D BLANK
  9016. READ CYCWIgMODAL;;;;;;;ac
  9017.  Frd;;;idiON outpuGet rid DEUSELECT (deacclau(Get rid UFAU showclau(GNK
  9018. RELEAUF(m.g_tempaliafor 
  9019.  
  9020. *
  9021. * We could sit.1y;return efm + ; , buton: VEway we c;;;mesVEwithon:eEdialogEwithoutoc;;;g;;;
  9022. * n:eEd4    sRCA*
  9023. DO CAUF
  9024. CAUF efm + ; e= 1FAUFAREtioNNc_yes
  9025. CAUF efm + ; e= 2 ANDAON outputor1FAUFAREtioNNc_noNKOTHERWIEMO  loREtioNNc_c;;celCAD BCAUF
  9026. REtioN 
  9027.  
  9028. *
  9029. * TRANSPRMPT -;D term   on:eEpect.t;;;;;;;;;;;;;;;;;; button
  9030. *
  9031. *!*****************************************************************************
  9032. *!
  9033. *!;;;;;;;Su ctNS1: TRANSPRMPT
  9034. *!
  9035. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9036. *!*****************************************************************************
  9037. FUNSELON;;;;;;;rt.t
  9038. * Debuncmus; beEpaid
  9039. HOURE  LEFT(TIME()12ranAN
  9040. (_te(DCT ( Ge= 7 ANDAHOURE>= "23" ANDAHOURE< "24 G;OR ATC("ENERG;;o", inENV("TRANSPRT" Ge>umbf() g_energizSE  .T.FAUFAREtioNN"\!EnergizS"se;;;;;&& Beam;me upCADMEMO  loREtioNN"\!on is in e;;d OpEC"  D BLANK
  9041. *
  9042. * RDac
  9043.  (Ge- eret.t;;;;;;overwrRAN;;;nUFac
  9044.  Functf g_nUFAU ONCAS;;;true
  9045. *
  9046. *!*****************************************************************************
  9047. *!
  9048. *!;;;;;;;Su ctNS1: RDac
  9049.  
  9050. *!
  9051. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9052. *!se;;;;;;;CnUFs: VERSLONCAP(Ge FAUAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9053. *!*****************************************************************************
  9054. FUNSELON;rd;;;id
  9055. PARTTETER  outpu
  9056. AN
  9057. efecnUFAU ONCASANDAON outputor1SANDAONm + ; e= 1FAUFAAN
  9058. _m.g_teS;OR _MACFAUFAUSC Write ihg_temmsg
  9059.  
  9060.  ;;;;;;;;;;;;;m.g0.00OR m.00O;;;;;;;;;;;;;;;;o 7.30rr42.66    ;;;;;;;;;;SOocpc_ oufS; 14   ousizSE;;;;;;;;;;;;;TYWIg   oustyitabase;;;;;;NOSE m.g_updenviron FA FAUFAU DESET ORDER TO TAG temp1
  9061.  DE 
  9062.  OTHERWIFAUFAUSCMOVe ihg_temmsg
  9063.  
  9064.  ;CENTERAU  FAU*FAUFAUSCAN
  9065. FOR platfomsg
  9066.  
  9067.  st[m.loop] ANUSELECT (m.g_temmsg
  9068.  
  9069.  ;ATTER MEMVAR MEMOm.loop] ANUSELECT (m.g_temmsg
  9070.  
  9071.  ;FAUFAU  APPEND BLANK  FAUFAU  GA*no0.9 AN2.833;;;;;;on is in ;;;;AUFaffect.  wiUFacverwrRAe " + CHR(13) + ;;;;;;;;;;;;"nUFaexis;;;;;"+versNS1capiasO to.14* Not)+"ac
  9072.  Fu : CPTRANS14;;+ CHR(13) + ;;;;;;;;;;;;"tion:e;;;;;;;;;;;;;;;;;;;;;;;orA.00OR36.833R m.00O;;;;;;;;;;s function taI;;;;;;;;;;;;;;SOocpc_ oufS; 14   ousizSE;;;;;;;;;;;;;TYWIg   oustyle
  9073.   FAU*no4.769,11.833; in efokc;;cl;;;;;;;;;;s function omcHocpOK;CanceliasO14FAU;;ihe maora.769,8.66 ,0.66    ;;;;;;;;;;RN Cady itabase;;;;;;;SOocpc_ oufS; ,   ousizSE;;;;;;;;;;;;;TYWIg   oustyle
  9074.   F MEMOm.loop] Write ihg_temmsg
  9075.  
  9076.  ;;;;;;;;;;;;;FROM INT((SROWS()-8)/2),19asO14FAU;;iheTO INT((SROWS()+8)/2),62tabase;;;;;;NOSE m.g_updenviron FA FAUFAU DESET ORDER TO TAG temp1
  9077.  DE 
  9078.  OTHERWIg_updenviron  OLOR SCHEME 7FAUFAUSCMOVe ihg_temmsg
  9079.  
  9080.  ;CENTERAU  FAU*FAUFAUSCAN
  9081. FOR platfomsg
  9082.  
  9083.  st[m.loop] ANUSELECT (m.g_temmsg
  9084.  
  9085.  ;ATTER MEMVAR MEMOm.loop] ANUSELECT (m.g_temmsg
  9086.  
  9087.  ;FAUFAU  APPEND BLANK  FAUFAU  FAU*noi,0;;;;;PADC("on is in ;;;;AUFaffect.  wiUFacverwrRAe",W OLS()ran  FAU*no2,0;;;;;PADC("nUFaexis;;;;;"+versNS1capiasO to.14* Not)+"ac
  9088.  Fu : CPTRANS14;,W OLS()ran  FAU*@rAN0;;;;;PADC("tion:e;;;;;;;,W OLS()ran  FAU*NK  FAUFAU  FAU*no5,12; in efokc;;cl;;;;;;;;;;s function omcHocpOK;CanceliasO14FAU;;ihe maora,9asO14FAU;;iheRN Cady iNnslaD BLANKAU*FAUFAAN
  9089. NOT
  9090. FOR platfomsg
  9091.  
  9092.  st[m.loop]USELECT (m.g_temmsg
  9093.  
  9094.  NnslaD BLANKAU*FAUFAREAD CYCWINKAU*FAUFARELEAUF(m.g_temmsg
  9095.  
  9096.  NnslaFAUFAAN
  9097. okc;;cl;= 2FAUFAUSCREtioNNVFRCAVAR MEMOm.loop]REtioNNVT.FAUFAD BLANnD BLANK
  9098. *
  9099. * DEUSCLAU -;D actNv;;; clausacode.;;Clear current;readctf window clos sRCA*
  9100. *!*****************************************************************************
  9101. *!
  9102. *!;;;;;;;Su ctNS1: DEUSCLAU
  9103. *!
  9104. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9105. *!*****************************************************************************
  9106. FUNSELON;deacclau
  9107. CLEARAREAD
  9108. REtioN .T.FA
  9109. *
  9110. * UFAUCLAU -;Refresh; inSCA*
  9111. *!*****************************************************************************
  9112. *!
  9113. *!;;;;;;;Su ctNS1: UFAUCLAU
  9114. *!
  9115. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9116. *!*****************************************************************************
  9117. FUNSELON;showclau
  9118. AN
  9119. ef outputor2FAUFAREtioN 
  9120. D BLANK
  9121. AN
  9122. g_snippets=.T.;OR g_newc
  9123.  Func  .T.FAUFAUFAU; in g_nUFAU ONCASDISARWIFA MEMOm.loUFAU; in g_nUFAU  FuncENARWIFA  BLANK
  9124. AN
  9125. g_nUFAU ONCAOm.loUFAU; in g_snippetsop] ISARWIFA.loUFAU; in g_newc
  9126.  Func ISARWIFA.loDO CAUF
  9127. ;;CAUF((_m.g_teS;OR _MAC)SANDARGBSCHEME(1,10) <> "RGB(0,0,0,255,255,255)"    FAU*noi7.846,7.50O;;;;;;ohan WindowncEquNv;lent;ffect. iasO14FAU;;ihe OLOR (RGBSCHEME(1,10)ran  FCAUF((_m.g_teS;OR _MAC)SANDARGBSCHEME(1,10) == "RGB(0,0,0,255,255,255)"    FAU*noi7.846,7.50O;;;;;;ohan WindowncEquNv;lent;ffect. iasO14FAU;;ihe OLOR RGB(192,192,192,255,255,255)FAUFAOTHERWIEMOm.loop]noi4,8;;;;;;ohan MS-DOScEquNv;lent;ffect. iasO14FAU;;ihe OLOR (SCHEME(5,10)ran  FD BCAUF
  9128.  MEMOm.loUFAU; in g_snippetsop]ENARWIFA.loUFAU; in g_newAU  FuncENARWIFAUFAAN
  9129. _m.g_teS;OR _MACFAUFAUSCnoi7.846,7.50O;;;;;;ohan WindowncEquNv;lent;ffect. "    F MEMOm.loop]noi4,8;;;;;;ohan MS-DOScEquNv;lent;ffect. "    F  BLANnD BLANK
  9130. AN
  9131. !ecnUFAU ONCASANDAg_snippetso  .F.SANDAg_newc
  9132.  Func  .FRCAVARUFAU; in ONm + ; ,1SDISARWIFA MEMOm.ARUFAU; in ONm + ; ,1SENARWIFA  BLANK
  9133. *
  9134. * UCRNSERL -;CnUFed  No check box ;;;idatNS1 fromon:e;;;rsu :ialogCA*
  9135. *!*****************************************************************************
  9136. *!
  9137. *!;;;;;;;Su ctNS1: UCRNSERL
  9138. *!
  9139. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9140. *!*****************************************************************************
  9141. FUNSELON;s 
  9142.  ctrl
  9143. UFAU; inS;OFANKREtioN .T.FA
  9144. *
  9145. * Makes sureon:e;proper opANS14 areoenabFed based S1 n:e;set ;;;;of ONg_nUFAU ONCAOm*
  9146. *!*****************************************************************************
  9147. *!
  9148. *!;;;;;;;Su ctNS1: ENARWIPROCFA*!
  9149. *!*****************************************************************************
  9150. FUNSELON;enabFeproc
  9151. AN
  9152. efg_nUFAU ONCAOm.loUFAU; in ONg_newc
  9153.  Func ISARWIFA.loUFAU; in asO snippetsoDISARWIFA MEMOm.AoUFAU; in ONg_newAU  FuncENARWIFAUloUFAU; in asO snippetsoENARWIFA  BLANK
  9154. *
  9155. * FiUFson:e;asO from.14* Not gFAUal ;;riabFe wheion:e;usr leaves n:e;:ialogRCA*
  9156. *!*****************************************************************************
  9157. *!
  9158. *!;;;;;;;Su ctNS1: PVALID
  9159. *!
  9160. *!;;;;;;CnUFed by: SCXFRXDIALOG(Ge FAU(fu ctNS1 ctioTRANSPRT.PRGran*!
  9161. *!*****************************************************************************
  9162. FUNSELON;p;;;id
  9163. DO CAUF
  9164. CAUF(ATC('DOS',m.from.14* Not) > 0FAUFAasO from.14* Not = 'DOS'
  9165. CAUF(ATC('m.g_teS',m.from.14* Not) > 0FAUFAasO from.14* Not = 'm.g_teS'
  9166. CAUF(ATC('MAC',m.from.14* Not) > 0FAUFAasO from.14* Not = 'MAC'
  9167. CAUF(ATC('UNIX',m.from.14* Not) > 0FAUFAasO from.14* Not = 'UNIX'NnD BCAUF
  9168.  
  9169. **
  9170. ** Code Associ;;;d With Dis.14y;;;;of n:e;Thermometer
  9171. **
  9172.  
  9173. *!*****************************************************************************
  9174. *!
  9175. *!;;;;;;Procedure: UTARTTHERM
  9176. *!
  9177. *!;;;;;;CnUFed by: TRANSPRT.PRG4FAU;;ihe;ihe;ihe;ihe;
  9178. *!;;;;;;;4FAU;;ih: GRAPHnctOCHARAe FAU(procedurectioTRANSPRT.PRGr
  9179. *!;;;;;;;4FAU;;ih: CHARTOGRAPHncAe FAU(procedurectioTRANSPRT.PRGr
  9180. *!
  9181. *!;;;;;;;;;;CnUFs:]USETHERM;ihe;ihe;ih(procedurectioTRANSPRT.PRGr
  9182. *!
  9183. *!*****************************************************************************
  9184. PROCEDURE startn:erm
  9185. PARAMETER VERB,filetype
  9186. *  Start n:e;n:ermometer with n:e;appropria;; messageRCADO CAUF
  9187. CAUF(m.filetypetorc_s 
  9188. eenFA.loDO actn:erm WITH VERB+';s 
  9189. een: '
  9190. CAUF(m.filetypetorc_reportFA.loDO actn:erm WITH VERB+';report: '
  9191. CAUF(m.filetypettorc_label
  9192. .loDO actn:erm WITH VERB+';label: '
  9193. D BCAUF
  9194.  
  9195. *
  9196. * USETHERM(<text>) -;ActNva;; n:ermometerRCA*
  9197. *;ActNva;;son:ermometerR  Updateon:e;n:ermometer with UPDTHERM()RCA*;Thermometer window is named "n:ermometerR"  Be;sureonoARELEAUF
  9198. * n:is window wheiodone with n:ermometerR  Crea;;son:e gFAUal
  9199. * asO n:ermwidthRCA*
  9200. *!*****************************************************************************
  9201. *!
  9202. *!;;;;;;Procedure: USETHERM
  9203. *!
  9204. *!;;;;;;CnUFed by: STARTTHERMhe;ihe;ih(procedurectioTRANSPRT.PRGr
  9205. *!;;;;;;;4FAU;;ih: UPDTHERM;ihe;ihe;ih(procedurectioTRANSPRT.PRGr
  9206. *!
  9207. *!*****************************************************************************
  9208. PROCEDURE actn:erm
  9209. PARAMETER m.text
  9210. PRIVATF(m.promptFA
  9211. AN
  9212. _m.g_teS;OR _MACFAUFAasprompto  LOWER(asO s 
  9213.  dbfran  FAN
  9214. TXTWIDTH(asprompt,rc_dlgfa; ,rc_dlgsiz ,rc_dlgstyle) > 43FAUFAUSCDO WHILE
  9215. TXTWIDTH(asprompt+"...",rc_dlgfa; ,rc_dlgsiz ,rc_dlgstyle) > 43FAUFAUSCUFAasprompto  LEFT(asprompt,rLEN(asprompt)-1ran  F  F  BDOFAUFAUSCasprompto  asprompto+ "..."    F  BLANnhe;
  9216. UFAAN
  9217. !WEXIST("n:ermomete"ran  F  FDEFINE WIg_te;n:ermometeasO14FAU;;iheAT 0,0asO14FAU;;iheSIZE 5.615,63.833asO14FAU;;iheFONTrc_dlgfa; ,rc_dlgsiz asO14FAU;;iheSTYLE
  9218. c_dlgstyleasO14FAU;;iheNOFLOAT sO14FAU;;iheNOCLOUF(sO14FAU;;iheNONE sO14FAU;;ihe OLOR RGB(0, 0, 0, 192, 192, 192ran  FD BLANnhe;MOVE WIg_te;n:ermome;; CENTERFAUFAUSEIVATF(WIg_te;n:ermome;;eNOUFAUNnhe;
  9219. UFA@ 0.5,3;;;;;m.texteFONTrc_dlgfa; ,rc_dlgsiz aSTYLE
  9220. c_dlgstyle
  9221. UFA@ 1.5,3;;;;;m.promptoFONTrc_dlgfa; ,rc_dlgsiz aSTYLE
  9222. c_dlgstyle
  9223. UFA@ 0.000,0.000 TO 0.000,63.833asO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255ran  F@ 0.000,0.000 TO 5.615,0.000 sO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255ran FA@ 0.385,0.667 TO 5.231,0.667 sO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran FA@ 0.308,0.667 TO 0.308,63.167 sO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran FA@ 0.385,63.000 TO 5.308,63.000 sO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255ran  F@ 5.231,0.667 TO 5.231,63.167 sO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255ran  F@ 5.538,0.000 TO 5.538,63.833asO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran FA@ 0.000,63.667 TO 5.615,63.667 sO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran  F@ 3.000,3.333aTO 4.231,3.333asO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran  F@ 3.000,60.333aTO 4.308,60.333asO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255ran  F@ 3.000,3.333aTO 3.000,60.333asO14FAU;; OLOR RGB(128, 128, 128, 128, 128, 128ran FA@ 4.231,3.333aTO 4.231,60.500 sO14FAU;; OLOR RGB(255, 255, 255, 255, 255, 255rFAUFAasO n:ermwidth = 56.269Nnhe;
  9224. UFAUFAU;WIg_te;n:ermome;; TOPNnDLUF
  9225. UFAasprompto  SUBSTR(SYS(2014,m.O s 
  9226.  dbfr,1,48)+sO14FAU;;IIF(LEN(asO s 
  9227.  dbfr>48,"...",""ran  FAN
  9228. !WEXIST("n:ermomete"ran  F  FDEFINE WIg_te;n:ermometesO14FAU;;iheFROM INT((SROW()-7)/2), INT((S OL()-57)/2) sO14FAU;;iheTO INT((SROW()-7)/2)o+ 6, INT((S OL()-57)/2)o+ 57sO14FAU;;iheDOUBLE
  9229.  OLOR SCHEME 5an  FD BLANnhe;USEIVATF(WIg_te;n:ermome;;eNOUFAUNnhe;
  9230. UFAasO n:ermwidth = 50FAUFA@ 0,3;;;;;m.text
  9231. UFA@ 1,3;;;;;UPPER(asprompt)
  9232. UFA@ 2,1aTO 4,m.O n:ermwidth+4 &g_boxstrgNnhe;
  9233. UFAUFAU;WIg_te;n:ermome;; TOPNnD BLANnCA*
  9234. *;UPDTHERM(<percent>) -;Updateon:ermometerRCA*
  9235. *!*****************************************************************************
  9236. *!
  9237. *!;;;;;;Procedure: UPDTHERM
  9238. *!
  9239. *!;;;;;;CnUFed by: TRANSPRT.PRG4FAU;;ihe;ihe;ihe;ihe;
  9240. *!;;;;;;;4FAU;;ih: GRAPHnctOCHARAe FAU(procedurectioTRANSPRT.PRGr
  9241. *!;;;;;;;4FAU;;ih: CHARTOGRAPHncAe FAU(procedurectioTRANSPRT.PRGr
  9242. *!;;;;;;;4FAU;;ih: UPDATFSCREEN;ihe;ih(procedurectioTRANSPRT.PRGr
  9243. *!;;;;;;;4FAU;;ih: UPDATFREPORT;ihe;ih(procedurectioTRANSPRT.PRGr
  9244. *!;;;;;;;4FAU;;ih: NEWCHARTOGRAPHncAe (procedurectioTRANSPRT.PRGr
  9245. *!;;;;;;;4FAU;;ih: NEWGRAPHnctOCHARAe (procedurectioTRANSPRT.PRGr
  9246. *!;;;;;;;4FAU;;ih: ALLCHARTOGRAPHncAe (procedurectioTRANSPRT.PRGr
  9247. *!;;;;;;;4FAU;;ih: ALLENVIRONSe;ihe;ih(procedurectioTRANSPRT.PRGr
  9248. *!;;;;;;;4FAU;;ih: ALLOTHERSe;ihe;ihih(procedurectioTRANSPRT.PRGr
  9249. *!;;;;;;;4FAU;;ih: ALLGROUPSe;ihe;ihih(procedurectioTRANSPRT.PRGr
  9250. *!;;;;;;;4FAU;;ih: RPTCONVERT;ihe;ihih(procedurectioTRANSPRT.PRGr
  9251. *!;;;;;;;4FAU;;ih: LABELLINESe;ihe;ihi(procedurectioTRANSPRT.PRGr
  9252. *!;;;;;;;4FAU;;ih: CALCm.g_teDIMENSION(procedurectioTRANSPRT.PRGr
  9253. *!;;;;;;;4FAU;;ih: FINDWIDEROBJECTSe;i(procedurectioTRANSPRT.PRGr
  9254. *!;;;;;;;4FAU;;ih: REPOOBJECTSe;ie;ihi(procedurectioTRANSPRT.PRGr
  9255. *!;;;;;;;4FAU;;ih: UDJINVBTNSe;ihe;ihi(procedurectioTRANSPRT.PRGr
  9256. *!;;;;;;;4FAU;;ih: JOINLINESe;ihe;ihii(procedurectioTRANSPRT.PRGr
  9257. *!;;;;;;;4FAU;;ih: WRITFRESULT;ihe;ihi(procedurectioTRANSPRT.PRGr
  9258. *!
  9259. *!;;;;;;;4FACnUFs: ACTTHERM;ihe;ihe;ih(procedurectioTRANSPRT.PRGr
  9260. *!
  9261. *!*****************************************************************************
  9262. PROCEDURE updtherm
  9263. PARAMETER m.percent
  9264. PRIVATF(m.nblocks, m.percent
  9265.  
  9266. AN
  9267. m.percent > 100FAUFAm.percent = 100FAD BLANnAN
  9268. !WEXIST("n:ermomete"ran  FDO actn:erm;WITH ""  D BLANnUSEIVATF(WIg_te;n:ermomete
  9269. m.nblockso  (aspercent/100) * (asO n:ermwidthr
  9270. AN
  9271. _m.g_teS OR _MACan  F@ 3.000,3.333aTO 4.231,m.nblockso+ 3.333asO14FAU;;PATTERN 1; OLOR RGB(128, 128, 128, 128, 128, 128ranDLUF
  9272.  
  9273. ***** CGC MYF *****            1994.3.7
  9274. *; F@ 3,3;;;;;REPLICATF("█",m.nblocksran  F@ 3,3;;;;;REPLICATF("ä",m.nblocksran***** CGC MYF ***** e;
  9275. NnD BLANnCA*
  9276. *;deactT:erm;- Deactivateoand Releaseon:ermometer windowRCA*
  9277. *!*****************************************************************************
  9278. *!
  9279. *!;;;;;;Procedure: DEACTTHERM
  9280. *!
  9281. *!;;;;;;CnUFed by: CLEANUP;ihe;ihe;ihe(procedurectioTRANSPRT.PRGr
  9282. *!
  9283. *!*****************************************************************************
  9284. PROCEDURE deacttherm
  9285. AN
  9286. WEXIST("n:ermomete"ran  FRELEASF(WIg_te;n:ermomete
  9287. D BLANnCA*
  9288. *;ERRORHANDLER - Error;Processing CenterRCA*
  9289. *!*****************************************************************************
  9290. *!
  9291. *!;;;;;;Procedure: ERRORHANDLER
  9292. *!
  9293. *!;;;;;;CnUFed by: TRANSPRT.PRG4FAU;;ihe;ihe;ihe;ihe;
  9294. *!;;;;;;;4FAU;;ih: SETVERSIONe;ihe;ihe(procedurectioTRANSPRT.PRGr
  9295. *!;;;;;;;4FAU;;ih: cvrtfbpRPThe;ihe(procedurectioTRANSPRT.PRGr
  9296. *!;;;;;;;4FAU;;ih: STRUCTDIALOG()e;ihe(function ctioTRANSPRT.PRGr
  9297. *!;;;;;;;4FAU;;ih: SCXFRXDIALOG()e;ihe(function ctioTRANSPRT.PRGr
  9298. *!
  9299. *!;;;;;;;4FACnUFs: CLEANUP;ihe;ihe;ihe(procedurectioTRANSPRT.PRGr
  9300. *!;;;;;;;4FAU;;ih: ERRUFAU;ihe;ihe;ihe(procedurectioTRANSPRT.PRGr
  9301. *!;;;;;;;4FAU;;ih: CLEANm.g_he;ihe;ihe(procedurectioTRANSPRT.PRGr
  9302. *!
  9303. *!*****************************************************************************
  9304. PROCEDURE errorhandler
  9305. PARAMETERS;m.msg, m.linenum, errcode
  9306. AN
  9307. ERROR()e= 22O14FAONeERROR &onerror
  9308. UFAasO statuso  1an  FDO cleanupO14FACANCELNnD BLANnSET MESSAGEaTO
  9309. DO CASF
  9310. CASF errcode == c_error1an  FasO statuso  1anCASF errcode == c_error2O14FADO errshow;WITH m.msg, m.linenuman  FasO statuso  2O14FAONeERROR &onerror
  9311. CASF errcode == c_error3O14FAONeERROR &onerror
  9312. UFADO errshow;WITH m.msg, m.linenuman  FDO cleanwindan  FasO statuso  3O14FAm.O returncode = c_cancelan  FDO cleanup;WITH .TRCAD BCASF
  9313. CA*
  9314. *;CLEANm.g_h- Releaseowindows;n:at might still be openCA*
  9315. *!*****************************************************************************
  9316. *!
  9317. *!;;;;;;Procedure: CLEANm.g_
  9318. *!
  9319. *!;;;;;;CnUFed by: ERRORHANDLER he;ihe(procedurectioTRANSPRT.PRGr
  9320. *!;;;;;;;4FAU;;ih: ESCHANDLER he;ihehe(procedurectioTRANSPRT.PRGr
  9321. *!
  9322. *!*****************************************************************************
  9323. PROCEDURE cleanwindanAN
  9324. WEXIST("nransdlg") AND WVISIBLF("nransdlg")an  FRELEASF(WIg_te;nransdlgFAD BLANnAN
  9325. WEXIST("lblwind") AND WVISIBLF("lblwind")an  FRELEASF(WIg_te;lblwindFAD BLANnAN
  9326. WEXIST("msgscrn") AND WVISIBLF("msgscrn")an  FRELEASF(WIg_te;msgscrnFAD BLANnAN
  9327. WEXIST("T:ermomete"r AND WVISIBLF("T:ermomete"ran  FRELEASF(WIg_te;n:ermomete
  9328. D BLANnAN
  9329. WEXIST("tpselect"r AND WVISIBLF("tpselect"ran  FRELEASF(WIg_te;npselect
  9330. D BLANnCA*
  9331. *;ESCHANDLER - Escape handlerRCA*
  9332. *!*****************************************************************************
  9333. *!
  9334. *!;;;;;;Procedure: ESCHANDLER
  9335. *!
  9336. *!;;;;;;CnUFed by: SETALL;ihe;ihe;ihe;(procedurectioTRANSPRT.PRGr
  9337. *!
  9338. *!;;;;;;;4FACnUFs: CLEANm.g_he;ihe;he;(procedurectioTRANSPRT.PRGr
  9339. *!;;;;;;;4FAU;;ih: CLEANUP;ihe;ihe;ie;(procedurectioTRANSPRT.PRGr
  9340. *!
  9341. *!*****************************************************************************
  9342. PROCEDURE eschandler
  9343. ONeERROR &onerror
  9344. m.O statuso  1anDO cleanwindanDO cleanupO1CANCELNnCA*
  9345. *;ERRUFAU;- Show;errorctioaioalert box on n:e screenRCA*
  9346. *!*****************************************************************************
  9347. *!
  9348. *!;;;;;;Procedure: ERRUFAU
  9349. *!
  9350. *!;;;;;;CnUFed by: ERRORHANDLER he;ihe(procedurectioTRANSPRT.PRGr
  9351. *!
  9352. *!*****************************************************************************
  9353. PROCEDURE errshow
  9354. PARAMETER m.msg, m.lineno
  9355. PRIVATF(m.curcursor
  9356.  
  9357. AN
  9358. _m.g_teS OR _MACan  FDEFINF(WIg_te;ALERTasO14FAU;;AT 0,0asO14FAU;;SIZE 5.615,63.833asO14FAU;;FONT c_dlgface, c_dlgsizeasO14FAU;;STYLE c_dlgstyleasO14FAU;;NOCLOSF(sO14FAU;;DOUBLFasO14FAU;;TITLE "Transporter Error"  ;;;MOVF(WIg_te;ALERTaCENTER
  9359. UFAACTIVATF(WIg_te;ALERTaNOUFAU
  9360. he;
  9361.   Fasmsgo  SUBSTR(m.msg,1,44)+IIF(LEN(m.msg)>44,"...",""ran  F@ 1,(W OLS()-TXTWIDTH(Fasmsgo))/2;;;;;m.msg
  9362. he;
  9363.   Fasmsgo  "Line Number: "+LTRIM(STR(m.lineno,5)ran  F@ 2,(W OLS()-TXTWIDTH(Fasmsgo))/2;;;;;m.msg
  9364. he;
  9365.   Fasmsgo  "Pressoany key to cleanup;and exit..."an  F@ 3,(W OLS()-TXTWIDTH(Fasmsgo))/2;;;;;m.msg
  9366. ELSF
  9367.   FDEFINF(WIg_te;ALERTsO14FAU;;FROM INT((SROW()-6)/2), INT((S OL()-50)/2)asO14FAU;;TO INT((SROW()-6)/2) + 6, INT((S OL()-50)/2) + 50sO14FAU;;FLOAT NOGROW;NOCLOSF(NOZOOM ;;SHA_te;DOUBLFsO14FAU;; OLOR SCHEME 7
  9368. he;
  9369.   FACTIVATF(WIg_te;ALERTaNOUFAU
  9370. he;
  9371.   Fasmsgo  SUBSTR(m.msg,1,44)+IIF(LEN(m.msg)>44,"...",""ran  F@ 1,(W OLS()-LEN(m.msg))/2;;;;;m.msg
  9372. he;
  9373.   Fasmsgo  "Line Number: "+STR(m.lineno, 5ran  F@ 2,(W OLS()-LEN(m.msg))/2;;;;;m.msg
  9374. he;
  9375.   Fasmsgo  "Pressoany key to cleanup;and exit..."an  F@ 3,(W OLS()-LEN(m.msg))/2;;;;;m.msg
  9376. E BLANnCAm.curcursoro  SET( "CURSOR" r
  9377. SET CURSOR OFANnSFAU;WIg_te;ALERT
  9378.  
  9379. =INKEY(0, "M"ran
  9380. RELEASF(WIg_te;ALERT
  9381. SET CURSOR &curcursor
  9382.  
  9383. *
  9384. *;JUSTSTEMh- Returns just n:e stem name of n:e file
  9385. *
  9386. *!*****************************************************************************
  9387. *!
  9388. *!;;;;;;;Function:;JUSTSTEM
  9389. *!
  9390. *!*****************************************************************************
  9391. FUNCTIONejuststem
  9392. *;Return just n:e stem name from "filname"  PARAMETERS;m.filname
  9393. PRIVATF(ALL
  9394. AN
  9395. RAT('\',m.filname) > 0an  Fasfilnameo  SUBSTR(m.filname,RAT('\',m.filname)+1,255ranD BLANnAN
  9396. AT(':',m.filname) > 0an  Fasfilnameo  SUBSTR(m.filname,AT(':',m.filname)+1,255ranD BLANnAN
  9397. AT('.',m.filname) > 0an  Fasfilnameo  SUBSTR(m.filname,1,AT('.',m.filname)-1ranD BLANnRETURN(ALLTRIM(UPPER(m.filname)ranCA*
  9398. *;STRIPPATH - Strip n:e path from a file nameRCA*
  9399. * Description:
  9400. *;Find positions of backslashction:e name of n:e file.  If n:erects one
  9401. * take everything to n:e right of its position;and make it n:e new file
  9402. * nameR  If n:erects no slashclook forccolon.  Agatioif found, take
  9403. *;everything to n:e right of it as;n:e new nameR  If nein:er slash
  9404. * norccolon arecfound;n:en return n:e name unchangedRCA*
  9405. * Parameters:
  9406. *;filename - character string representing a file nameCA*
  9407. *;Return value:
  9408. *;T:e string "filename" win:oany path removedan*
  9409. *!*****************************************************************************
  9410. *!
  9411. *!;;;;;;;Function:;STRIPPATH
  9412. *!
  9413. *!;;;;;;CnUFed by: TRANSPRT.PRG;;;;;;;4FAU;;ih;4FAU;;
  9414. *!;;;;;;;4FAU;;ih: ADJBITMAPCTRL;ihe;i(procedurectioTRANSPRT.PRGr
  9415. *!;;;;;;;4FAU;;ih: SCXFRXDIALOG()ihe;i(function ctioTRANSPRT.PRGr
  9416. *!
  9417. *!*****************************************************************************
  9418. FUNCTIONestrippath
  9419. PARAMETER m.filename
  9420. PRIVATF(m.slashpos, m.namelen, m.colonpos
  9421. m.slashposo  RAT("\", m.filenamer
  9422. AN
  9423. m.slashposo> 0an  Fasnamelen o  LEN(m.filenamer - m.slashposan  Fasfilename   RIGHT(m.filename, m.namelenranDLSF
  9424.   Fm.colonposo  RAT(":", m.filenamer
  9425. ;;;AN
  9426. m.colonposo> 0an  F  Fasnamelen o  LEN(m.filenamer - m.colonpos
  9427.   F  Fasfilename   RIGHT(m.filename, m.namelenran;;;D BLANnD BLANnRETURN(m.filename
  9428. CA*
  9429. *;ISOBJECT - Is otype a screen orcreport object?an*
  9430. *!*****************************************************************************
  9431. *!
  9432. *!;;;;;;;Function:;ISOBJECT
  9433. *!
  9434. *!;;;;;;CnUFed by: UPDATFSCREEN he;ihe(procedurectioTRANSPRT.PRGr
  9435. *!;;;;;;;4FAU;;ih: NEWCHARTOGRAPHICihe(procedurectioTRANSPRT.PRGr
  9436. *!;;;;;;;4FAU;;ih: NEWGRAPHICTOCHARihe(procedurectioTRANSPRT.PRGr
  9437. *!;;;;;;;4FAU;;ih: FINDLIKEVPOS he;ihe(procedurectioTRANSPRT.PRGr
  9438. *!;;;;;;;4FAU;;ih: FINDLIKEHPOS he;ihe(procedurectioTRANSPRT.PRGr
  9439. *!;;;;;;;4FAU;;ih: SELECTOBJ;;;;;;;4FA(procedurectioTRANSPRT.PRGr
  9440. *!
  9441. *!*****************************************************************************
  9442. FUNCTIONeisobject
  9443. PARAMETER m.otypeNnRETURN(INLIST(m.otype,c_otlist,c_ottxtbut,c_otbox,c_otradbut,c_otchkbox,c_otfield, sO14FAc_otpopup,c_otinvbut,c_otspinner,c_otpicture,c_otline,c_otrepfld,c_otrepvar,c_ottextran
  9444. CA*
  9445. *;ISREPTOBJECT - Is otype a report object?an*
  9446. *!*****************************************************************************
  9447. *!
  9448. *!;;;;;;;Function:;ISREPTOBJECT
  9449. *!
  9450. *!;;;;;;CnUFed by: RPTCONVERTa;;;;;4FA(procedurectioTRANSPRT.PRGr
  9451. *!
  9452. *!*****************************************************************************
  9453. FUNCTIONeisreptobject
  9454. PARAMETER m.otypeNnRETURN(INLIST(m.otype,c_otrepfld,c_ottext,c_otbox,c_otlineranCA*
  9455. *;ISGRAPHOBJ;- Is otype an object n:atcts presentctiographics screens/reports but not
  9456. *;;;;;;;4FAU;;itiocharacter screens?an*
  9457. *!*****************************************************************************
  9458. *!
  9459. *!;;;;;;;Function:;ISGRAPHOBJ
  9460. *!
  9461. *!*****************************************************************************
  9462. FUNCTIONeisgraphobj
  9463. PARAMETER m.otypeNnRETURN(INLIST(m.otype,c_otpicture,c_otspinnerranCA*!*****************************************************************************
  9464. *!
  9465. *!;;;;;;;Function:;ISENVIRON
  9466. *!
  9467. *!*****************************************************************************
  9468. FUNCTIONeisenviron
  9469. PARAMETER m.otypeNnRETURN(INLIST(m.otype,c_otworkar,c_otindex,c_otrelranCA*!*****************************************************************************
  9470. *!
  9471. *!;;;;;;;Function:;IsNewerEnv
  9472. *!
  9473. *!*****************************************************************************
  9474. FUNCTIONeIsNewerEnv
  9475. PARAMETER mustexist;;;;&& does;n:e "to" environmentchave to exist?anPRIVATF(m.maxfromts, m.maxtots
  9476. *;Is;n:e "from" platform environmentcnewer n:an n:e "to" platform environment
  9477. m.maxfromtso  -1
  9478. SCAN FOR platform =Fasg_fromplatform and IsEnviron(objtyper
  9479. ;;;m.maxfromtso  MAX(timestamp, m.maxfromtsranD BSCAN
  9480. m.maxtotso  -1
  9481. SCAN FOR platform =Fasg_toplatform and IsEnviron(objtyper
  9482. ;;;m.maxtotso  MAX(timestamp, m.maxtotsranD BSCAN
  9483. AN
  9484. m.mustexistan  F*;T:e to platform had an environment, but it was;out of date
  9485. ;;;RETURN(IIF(m.maxfromtso>;m.maxtotsoAND;m.maxtotso>= 0 , .T. , .F.ranDLSF
  9486.   F*;T:e to platform had no environmentcand n:e from platform does
  9487. ;;;RETURN(IIF(m.maxfromtso>= 0 AND;m.maxtotso< 0  , .T. , .F.ranD BLAU;;
  9488. CA*
  9489. *;HASRECORD;- Does;filname contatioplatform records;forctarget?an*
  9490. *!*****************************************************************************
  9491. *!
  9492. *!;;;;;;;Function:;HASRECORDS
  9493. *!
  9494. *!;;;;;;CnUFed by: SCXFRXDIALOG()ihe;i(function ctioTRANSPRT.PRGr
  9495. *!
  9496. *!*****************************************************************************
  9497. FUNCTIONehasrecords
  9498. PARAMETER m.target
  9499. PRIVATF(ALL
  9500. AN
  9501. TYPE("PLATFORM") <> "U"an  FLOCATF(FOR UPPER(TRIM(platform)) ==Fastarget
  9502. ;;;RETURN(FOUND(ranD BLANnRETURN(.F.
  9503. CA*
  9504. *;ASKFONT - Prompt;forca;font
  9505. *
  9506. *!*****************************************************************************
  9507. *!
  9508. *!;;;;;;;Function:;ASKFONT
  9509. *!
  9510. *!;;;;;;CnUFed by: SCXFRXDIALOG()ihe;i(function ctioTRANSPRT.PRGr
  9511. *!
  9512. *!*****************************************************************************
  9513. FUNCTIONeaskfont
  9514. PRIVATF(m.fontstrg, m.rptfnt
  9515.  
  9516. *;Set up a default;fontcforcreports
  9517. AN
  9518. m.g_filetype =Ac_report AND;(_WINDOWS OR _MACr
  9519. ;;;m.rptfnt   g_rptfface + "," + ALLTRIM(STR(g_rptfsize,3)ran;;;DEFINE WINDOW transtemp FROM SROWS()+1,SCOLS()+2 TO SROWS()+3,SCOLS()+3 sO14FA;;;FONT rptfnt
  9520. ;;;ACTIVATF(WINDOW transtemp NOSHOWanD BLANn
  9521. m.fontstrgo  GETFONT(ranAN
  9522. !EMPTY(m.fontstrgr
  9523. ;;;m.g_fontface  o   LEFT(m.fontstrg,AT(',',m.fontstrgr-1r
  9524. ;;;m.g_fontsize  o   VAL(SUBSTR(m.fontstrg,AT(',',m.fontstrgr+1,RAT(',',m.fontstrg)-AT(',',m.fontstrgr-1rr
  9525. ;;;m.g_fontstyle     SUBSTR(m.fontstrg,RAT(',',m.fontstrgr+1ran;;;AN
  9526. _MAC OR _WINDOWSO14FA;;;asg_rptlinesize  o  o  (FONTMETRIC(1, m.g_fontface, m.g_fontsize,;asg_rpttxtfontstyle) /Ac_pixelsize)F*;10000O14FA;;;asg_rptcharsize  o  o  (FONTMETRIC(6, m.g_fontface, m.g_fontsize,;asg_rpttxtfontstyle) /Ac_pixelsize)F*;10000O14FAD BLANnD BLANn
  9527. AN
  9528. m.g_filetype =Ac_report AND;(_WINDOWS OR _MACr
  9529. ;;;RELEASF(WINDOW transtempanD BLANn
  9530. RETURN
  9531. CA*
  9532. *;IS20SCX;- Is n:e currentcdatabase a 2.0 screen?an*
  9533. *!*****************************************************************************
  9534. *!
  9535. *!;;;;;;;Function:;IS20SCX
  9536. *!
  9537. *!*****************************************************************************
  9538. FUNCTIONeis20scxNnRETURN((FCOUNT(r =Ac_20scxfldr
  9539. *
  9540. *;IS20FRX;- Is n:e currentcdatabase a 2.0 report?an*
  9541. *!*****************************************************************************
  9542. *!
  9543. *!;;;;;;;Function:;IS20FRX
  9544. *!
  9545. *!*****************************************************************************
  9546. FUNCTIONeis20frxNnRETURN((FCOUNT(r =Ac_20frxfldr
  9547. *
  9548. *;IS20LBX;- Is n:e currentcdatabase a 2.0 screen?an*
  9549. *!*****************************************************************************
  9550. *!
  9551. *!;;;;;;;Function:;IS20LBX
  9552. *!
  9553. *!*****************************************************************************
  9554. FUNCTIONeis20lbxNnRETURN((FCOUNT(r =Ac_20lbxfldr
  9555. AN
  9556. WEXIST("lblwind") ;;AND;WVISIBLE("lblwind")
  9557. ;;;RELEASF(WINDOW lblwindanD BLANn
  9558. *
  9559. *;GETSNIPFLAG;- See if we are just updating snippets
  9560. *
  9561. *!*****************************************************************************
  9562. *!
  9563. *!;;;;;;;Function:;GETSNIPFLAG
  9564. *!
  9565. *!;;;;;;CnUFed by: UPDATFSCREEN;;;;;;;(procedure tioTRANSPRT.PRGr
  9566. *!
  9567. *!;;;;;;;;;;CnUFs: WORDNUM()ihe;iihe;i(function ctioTRANSPRT.PRGr
  9568. *!;;;;;;;;;;;;;;;: MATCH()ihe;iihe;i;i(function ctioTRANSPRT.PRGr
  9569. *!
  9570. *!*****************************************************************************
  9571. FUNCTIONegetsnipflag
  9572. PARAMETER snippetanPRIVATF(m.oldmline, m.retcode
  9573. * Format;forcdirective is "#TRAN SNIPPET ONLY"ctiosetup snippetanm.oldmlineo  _MLINE
  9574. m.retcodeo  .F.
  9575. AN
  9576. AT('#',snippet)o>;0O14FA_MLINEo  0O14FAm.snipleno  LEN(snippet)an;;;DO WHILEA_MLINEo<Am.sniplenO14FA;;;aslineo  MLINE(snippet,1,_MLINEran;;;;;;m.uplineo  UPPER(LTRIM(asline)ran;;;;;;AN
  9577. '#TRAN' $;m.uplineO14FA;;;;;;AN
  9578. LEFT(wordnum(m.upline,1),5r =A'#TRAN' sO14FA;;;;;;;;;;;;AND;match(wordnum(m.upline,2),'SNIPPETS') sO14FA;;;;;;;;;;;;AND;match(wordnum(m.upline,3),'ONLY'ran;;;;;;4FA;;;asretcodeo  .T.
  9579. ;;;;;;;;;D BLANn;;;;;;D BLANn;;;D BDOO14FA_MLINEo  m.oldmlineanD BLANnRETURN(m.retcode
  9580.  
  9581. CA*
  9582. *;MATCH;- ReturnsoTRUE is candidate is a valid 4-or-more-charactercabbreviation of keyword
  9583. *
  9584. *!*****************************************************************************
  9585. *!
  9586. *!;;;;;;;Function:;MATCH
  9587. *!
  9588. *!;;;;;;CnUFed by: GETSNIPFLAG()ihe;ii(function ctioTRANSPRT.PRGr
  9589. *!
  9590. *!*****************************************************************************
  9591. FUNCTIONematch
  9592. PARAMETER candidate, keyword
  9593. PRIVATF(in_exact
  9594. m.in_exacto  SET("EXACT")
  9595. SET EXACT OFANnDO CASF
  9596. CASF EMPTY(m.candidate)
  9597. ;;;RETURN(EMPTY(m.keywordr
  9598. CASF LEN(m.candidate)o<A4
  9599. ;;;RETURN(m.candidate ==Faskeyword
  9600. OTHERWISF
  9601. ;;;RETURN(m.keywordo  m.candidateanD BCASF
  9602. AN
  9603. m.in_exacto!= "OFA"
  9604. ;;;SET EXACT ON
  9605. D BLANn
  9606.  
  9607. *
  9608. *;WORDNUM;- Returnsow_num-th wordofrom string strg
  9609. *
  9610. *!*****************************************************************************
  9611. *!
  9612. *!;;;;;;;Function:;WORDNUM
  9613. *!
  9614. *!;;;;;;CnUFed by: GETSNIPFLAG()ihe;ii(function ctioTRANSPRT.PRGr
  9615. *!
  9616. *!*****************************************************************************
  9617. FUNCTIONewordnum
  9618. PARAMETERS strg,w_num
  9619. PRIVATF(strg,s1,w_num,ret_strNn
  9620. m.s1o  ALLTRIM(m.strgr
  9621.  
  9622. *;Replace tabsowith spaces
  9623. m.s1o  CHRTRAN(m.s1,CHR(9)," ")
  9624.  
  9625. *;Reduce multiple spaces to a single spaceNnDO WHILEAAT('  ',m.s1)o>;0O14FAm.s1o  STRTRAN(m.s1,'  ',' 'ranD BDOO1
  9626. ret_stro  ""
  9627. DO CASF
  9628. CASF m.w_numo>;1an;;;DO CASF
  9629. ;;;CASF(AT(" ",m.s1,m.w_num-1)o  0;;;&& No wordow_num.  Past end of string.
  9630. ;;;;;;asret_stro  ""
  9631. ;;;CASF(AT(" ",m.s1,m.w_num)o  0;;;;;&& Wordow_num is last wordotiostring.
  9632. ;;;;;;asret_stro  SUBSTR(m.s1,AT(" ",m.s1,m.w_num-1)+1,255ran;;;OTHERWISF;;;;;;;;;;;;;;;;;;;;;;;;;&& Wordow_num is tion:e middle.
  9633. ;;;;;;asstrt_poso  AT(" ",m.s1,m.w_num-1)
  9634. ;;;;;;asret_str o  SUBSTR(m.s1,strt_pos,AT(" ",m.s1,m.w_num)+1;- strt_posran;;;D BCASF
  9635. CASF m.w_numo=;1an;;;AN
  9636. AT(" ",m.s1)o>;0;;;;;;;;;;;;;;;&& Get;first word.
  9637. ;;;;;;asret_stro  SUBSTR(m.s1,1,AT(" ",m.s1)-1)
  9638. ;;;ELSF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&& There ts only one word.  Get;it.
  9639. ;;;;;;asret_stro  m.s1Nn;;;D BLANnD BCASF
  9640. RETURN(ALLTRIM(m.ret_strr
  9641.  
  9642. *
  9643. *;ADDBS;- Add a backslash unless n:ere ts one already n:ere.
  9644. *
  9645. *!*****************************************************************************
  9646. *!
  9647. *!;;;;;;;Function:;ADDBS
  9648. *!
  9649. *!;;;;;;CnUFed by: FORCEEXT(r iihe;i;i(function ctioTRANSPRT.PRGr
  9650. *!
  9651. *!*****************************************************************************
  9652. FUNCTIONeaddbs
  9653. * Add a backslash to a path name, if n:ere tsn't already one n:ere
  9654. PARAMETER m.pathname
  9655. PRIVATF(ALLanm.pathnameo  ALLTRIM(rcabbrFUNCv:erhnameo  A*****************rakeywordo  m..w_numo=;1an;;;ANSn*********"retihe;i;1an;;;ANit.
  9656. ;;;;o  Udosc4FAumo=;1an;;;ANSn*********"WneoOWS"deo  .T.
  9657. n;;;ANit.
  9658. ;;;;o c_ATFc4FAumo=;1an;;;ANSn*********"MAC"deo  .T.
  9659. n;;;ANit.
  9660. ;;;;o  Umacc4FAumo=;1an;;;ANSn*********"ode"deo  .T.
  9661. n;;;ANit.
  9662. ;;;;o  Uunixc4FA;CnUFed by: GE
  9663. n;;;ANit.
  9664. ;;;;o  Udosc4FA ctioTR************************************************************************************* name, if n:ere t********okf str-thlast
  9665. PARAMETER m.patttttttttttttttttttttttttttttttttttttttttttttttttttt;;;ELSF;;;;;;;;;;(m.strgrokf str-thlas***********!;;;;DIMENStrgr****_arry[4]
  9666. #DEFINE***s_LEFT  4FA#DEFINE*ATF_LEFT  2
  9667. #DEFINE*mac_LEFT  3
  9668. #DEFINE*unix_LEFT 4
  9669. ****_arry***0;;;;;ATC("#retOBJ",!******EXT0;;ORD****_arry[**s_LEFT]Retuhe;ii(fun;;;ATC("#WneOBJ",!******EXT0;;ORD****_arry[ATF_LEFT]Retuhe;ii(fun;;;ATC("#MACOBJ",!******EXT0;;ORD****_arry[mac_LEFT]Retuhe;ii(fun;;;ATC("#odeOBJ",!******EXT0;;ORD****_arry[unix_LEFT]Retuhe;ii(funast If no!********-specific design;;D BRETUund,m.s1Nn-thlasrywm.c:ertch****_arry[1]t,1****_arry[2]t,1****_arry[3]t,1****_arry[4]Ret0;;ORD****_arryRetuhe;ii(funaso  m..w_numo=;1an_toSn*********"retihe;i;i(functIIF(****_arry[**s_LEFT]Retu, .T.,.F.cesumo=;1an_toSn*********"WneoOWS"he;i;i(functIIF(****_arry[ATF_LEFT]Retu, .T.,.F.cesumo=;1an_toSn*********"MAC"he;i;i(functIIF(****_arry[mac_LEFT]Retu, .T.,.F.cesumo=;1an_toSn*********"ode"he;i;i(functIIF(****_arry[unix_LEFT]Retu, .T.,.F.ceA ctioTR****
  9670. PARAMETER m.pattttttttttttttttttttttttttttttttttttttttttttttttttttt************ name, if n:ere t********boxjoi
  9671. *!t
  9672. PARAMETER m.paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatt************ naM(m.strgrboxjoi
  9673. *!*********S;1aotype****r*;R****p****ast Is(m.rettexnlebjWor a bacbox group
  9674. *!*nsous*boxjoi
  9675. ?****IVAT=;1aTF_rec****retval****ebjporin**retval;;R.F.;;;;;1aotype;o  Uottexny: GE
  9676. TF_rec;;RRECNO(TER caRETUR**!
  9677. *ebjWor porThere (porThere ;;;linked;lisnleflebjWor;WO;;;********recce y: GE
  9678. ebjpor;;R!
  9679. ObjPosLANr*;R****p****TER ca;;;1aobjpor;XT0;;ORDTUR**Look IM( tsnsow_box grouprinORDNUMGO***TOP;;ORDTURSCAN ske***p**** ==!********UFed ebjtype;o  Uotgroup
  9680. Fed ebjLEFT etuUFed !**retval;;ORDTURTUR**hpor;has(m.esowart1o  ebjWor )," ")ETUn:er0;;group, vpor;has(m.es)," ")E;;;;;ORDTURTUR**ebjWor;(m.esgroup
  9681. TFcludes***ORDTURTUR;;;1aobjpor;X=*hpor;Fed 
  9682. ebjpor;<=*hpor;+ vpor;-tuheORDTURTUR GE
  9683. retval;;R.m-1)ORDTURTUR;ii(funTURTUR;iiSCAN;;ORD;ii(funTURGO***1aTF_reche;ii(fun*********retval;;
  9684. PARAMETER m.paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa************ name, if n:ere t*****"
  9685. !
  9686. ObjPos*!t
  9687. PARAMETER m.....................................................................;;;(m.strgreadebjporin*********S;1ar*;R****p****as**IVAT=;1aebjLEunt****retvalunast !
  9688. *erdie ts)," ")E;;;m.retebjWorin**ebjLEunt***0;;**retval;;R0;;SCAN ske***p**** ==!********UFed isebjWor(ebjtypeTER ca**ebjLEunt*****ebjLEunt*+tuheORDtchRECNO(T*****r*;R;;ORDTUR**retval;;R1aebjLEunt;;ORD;ii(fun;iiSCAN;;*********retval;;*: EOF: TRANSPlrePRG
  9689.