home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / rdb084r2.zip / MaxBase.nrx < prev    next >
Text File  |  1997-03-17  |  59KB  |  2,401 lines

  1. /* RXDbase front end 2.4 */
  2.  
  3.  
  4. /*
  5.    HUGE DISCLAIMER: this source is here only for the purpose
  6.    of giving you the possibility to enhance MaxBase.
  7.    PLEASE, don't complain about how it is programmed,
  8.    it was never intended to be shown to anyone and,
  9.    as it's in beta, it has some points which have not
  10.    been cleaned up. And, comments are very rare.
  11.    I will include more comments along the way.
  12.  
  13.                - - - -  N O T E - - - -
  14.  
  15.    The only thing I ask you is that if you do enhance this
  16.    program or correct bugs, you should send me a copy
  17.    of the modfications so I will include the additions
  18.    in the next versions of the RXDbase package.
  19. */
  20.  
  21. import ScrollPanel
  22. import RXDbase
  23. import RXFile
  24.  
  25. Class MaxBase extends Frame
  26.  
  27. properties private
  28.  
  29. dbMine = RXDbase()
  30.  
  31. iOldPage = int 0
  32. iDeleted = int
  33.  
  34. /* Current Index */
  35. iIdx = int 0
  36.  
  37. /* For the deletion operations */
  38. iDelArc = int[]
  39. iDelVis = int[]
  40.  
  41. /* Used to store LOADREC data */
  42. rRecArr = Rexx[,]
  43. rRecArr2 = Rexx[,]
  44. rShowed = Rexx
  45. rDbStats = Rexx[]
  46. rFilter = Rexx ""
  47.  
  48. /* strings used in the DB */
  49.  
  50. rTXTFileNotPresent = Rexx "File does not exist. Returning."
  51. rTXTEnd = Rexx "Conversion: finished."
  52. rTXTChoose = Rexx "Choose a database (.dat)"
  53. rTXTChooseDBF = Rexx "Choose a database (.dbf)"
  54. rTXTNoDb = Rexx "One-line view - no database loaded"
  55. rTXTOneLine = Rexx "One-line view for database "
  56. rTXTActRec = Rexx " active records; "
  57. rTXTShowHere = Rexx " showed here"
  58. rTXTMissInfo = Rexx "Field not added. Missing informations."
  59. rTXTName = Rexx "Field not added. Field length must be non-negative, name must be valid."
  60. rTXTWrkFld = Rexx "Currently working on Field "
  61. rTXTPickName = Rexx "Pick a name for the db (no extension)"
  62. rTXTMInfo = Rexx "Can't save. Missing informations for this field."
  63. rTXTMName = Rexx "Can't save. Field length must be non-negative, name must be valid."
  64. rTXTNoIndex = Rexx "Can't save. At least a field must have an index."
  65. rTXTBigger = Rexx "Can't save. File name is bigger than 4 characters."
  66. rTXTFileExists = Rexx "Can't save. File exists."
  67. rTXTSaved = Rexx "Succesfully saved. Hit 'Cancel' to return to db browsing."
  68. rTXTFindInfo = Rexx "Separate filter conditions with the .&. token"
  69. rTXTFindTitle = Rexx "You are defining the filter conditions. (Empty = resets them)"
  70. rTXTOrderTitle = Rexx "Select a field to order the database by."
  71. rTXTFldDelTitle = Rexx "Select a field to be deleted."
  72. rTXTModIdxTitle = Rexx "Select the field whose indexing strategy has to be modified."
  73. rTXTIdxStratTitle = Rexx "Select the new indexing strategy for the chosen field."
  74. rTXTDelDb = Rexx "You are going to delete the current database."
  75. rTXTDelDbInfo = Rexx "Press 'yes' to continue, 'Tools..' to return to the Tools panel."
  76. rTXTRDel1 = Rexx "You are going to delete the selected record."
  77. rTXTRDel2 = Rexx "You are going to delete the "
  78. rTXTRDel3 = Rexx " selected records."
  79. rTXTRDel4 = Rexx "Press 'yes' to continue, 'cancel' to cancel the operation."
  80. rTXTWarning = Rexx "Warning!"
  81. rTXTCurWork = Rexx "Currently working on Field 1/99"
  82. rTXTCreateDb = Rexx "You are creating a new database."
  83. rTXTAddFld = Rexx "Adding a field to the current DB"
  84. rTXTAddFldTitle = Rexx "You are adding a field to the current DB."
  85. rTXTRecAdd = Rexx "Form View (adding a record)"
  86. rTXTRecMod = Rexx "Form View (modifying this record)"
  87. rTXTRecBrowse = Rexx "Form View (just browsing)"
  88. rTXTSelPage = Rexx "Select another page to see the remaining fields."
  89. rTXTStore = Rexx "Select 'Store' to save data (if not browsing), 'Cancel' to abort."
  90. rTXTCantAdd1 = Rexx "Can't add. Missing informations for this field."
  91. rTXTCantAdd2 = Rexx "Can't add. Field length must be non-negative, name must be valid."
  92. rTXTIdxNONE0 = Rexx "NONE (NULL values to be accepted)"
  93. rTXTIdxNONE1 = Rexx "NONE (NULL values to be discarded)"
  94. rTXTIdxISAM00 = Rexx "ISAM (NULL and duplicate values to be accepted)"
  95. rTXTIdxISAM01 = Rexx "ISAM (duplicate values to be accepted, but no NULLs)"
  96. rTXTIdxISAM10 = Rexx "ISAM (NULL values to be accepted, but no duplicates)"
  97. rTXTIdxISAM11 = Rexx "ISAM (no NULLs and no duplicates)"
  98.  
  99.  
  100. /* db structure */
  101. rRecordStr = Rexx[1000,3]
  102.  
  103. /* Deleting of records */
  104. rToDele = Rexx[]
  105.  
  106. /* Name (WITHOUT extensions) of the in use DB */
  107. rCurrentDb = Rexx ""
  108.  
  109. /* For the creation of a db */
  110. rTempArr = Rexx[100,3]
  111.  
  112. /* Current field when entering data and/or creating a db */
  113. iCurrFld = int
  114.  
  115. scrolpan = ScrollPanel
  116. fm = FontMetrics
  117.  
  118. f = Font("Courier", Font.PLAIN, 12)
  119. f2 = Font("Courier", Font.BOLD, 24)
  120.  
  121. DbList = List(0, 1)
  122. FieldList = List(0, 0)
  123.  
  124. laCrName = Label("Field name: ")
  125. laCrLength = Label("Field Length: ")
  126. laCrIndex = Label("Field Indexing: ")
  127. laCrInfo = Label("No errors.")
  128. laFilter = Label("Search filter: ")
  129. laPage = Label("Current page:")
  130. laOne = Label()
  131. laTwo = Label()
  132. laThree = Label()
  133. laFour = Label()
  134. laFive = Label()
  135.  
  136. chCrIndex = Choice()
  137. chPage = Choice()
  138. chMPage = Choice()
  139. chFPage = Choice()
  140.  
  141. tfCrName = TextField()
  142. tfCrLength = TextField()
  143. tfOne = TextField()
  144. tfTwo = TextField()
  145. tfThree = TextField()
  146. tfFour = TextField()
  147. tfFive = TextField()
  148.  
  149. bnDbTools = Button("Tools..")
  150. bnRecords = Button("Records..")
  151. bnSelectAll = Button("Sel All")
  152. bnDeselectAll = Button("Des All")
  153. bnMainPanel = Button("Main panel..")
  154. bnCreate = Button("New DB")
  155. bnDestroy = Button("Del DB")
  156. bnAddField = Button("Add Fld")
  157. bnDelField = Button("Del Fld")
  158. bnModFieldIdx = Button("Mod Index")
  159. bnModThisField = Button("Modify This Field's Indexing")
  160. bnSetThisIdx = Button("Select This Indexing Method")
  161. bnYes = Button("Yes")
  162. bnFilter = Button("Set a  filter")
  163. bnFilterOk = Button("Set this filter")
  164. bnNo = Button("Cancel")
  165. bnGotOrder = Button("Order By the selected field")
  166. bnDelYes = Button("Yes")
  167. bnCrPrev = Button("Previous field")
  168. bnFirst50 = Button("Show only the first 50 records")
  169. bnAll = Button("Show all the records")
  170. bnCrNext = Button("Next field")
  171. bnCrDone = Button("Save database")
  172. bnStoreNewField = Button("Add this field")
  173. bnDeleteThisField = Button("Delete this field")
  174. bnCrCancel = Button("Cancel")
  175. bnConnect = Button("Login")
  176. bnDisconnect = Button("Logout")
  177. bnRefresh = Button("Refresh Now")
  178. bnProperties = Button("Properties")
  179. bnFormView = Button("Form View")
  180. bnPack = Button("Pack DB")
  181. bnAdd = Button("Add")
  182. bnModify = Button("Modify")
  183. bnDelete = Button("Delete")
  184. bnOrder = Button("Order By..")
  185. bnAStore = Button("Store")
  186. bnMStore = Button("Store")
  187. bnDBFtoDAT = Button(".dbf->.dat")
  188. bnDATtoDBF = Button(".dat->.dbf")
  189.  
  190. bnPuno = Button()
  191. bnPdue = Button()
  192. bnPtre = Button()
  193. bnPquattro = Button()
  194. bnPcinque = Button()
  195. rPluginClass = Rexx[6]
  196. p = Panel()
  197. dbToolsp = Panel()
  198.  
  199.  
  200.  
  201. method main(CommandLine=String[]) static
  202.    MaxBase(CommandLine)
  203.  
  204.  
  205. method doInitStuff() private
  206.   rxTemp = RXFile()
  207.   iCnter = int 1
  208.   rPlugin = Rexx ""
  209.  
  210.   rPlugin = rxTemp.stream("plugin.ini","c","query exists")
  211.   if rPlugin \= "" then
  212.   do
  213.    /* Yessir, we have plugins! */
  214.    rxTemp.stream(rPlugin, "c", "open read")
  215.    loop while ((iCnter < 6) & (rxTemp.lines() \= 0))
  216.     select 
  217.     when iCnter=1 then
  218.     do
  219.      bnPuno.setLabel(rxTemp.linein())
  220.     end
  221.     when iCnter=2 then
  222.      bnPdue.setLabel(rxTemp.linein())
  223.     when iCnter=3 then
  224.      bnPtre.setLabel(rxTemp.linein())
  225.     when iCnter=4 then
  226.      bnPquattro.setLabel(rxTemp.linein())
  227.     when iCnter=5 then
  228.      bnPcinque.setLabel(rxTemp.linein())
  229.     otherwise
  230.      nop
  231.     end
  232.     rPluginClass[iCnter] = rxTemp.linein()
  233.     iCnter = iCnter + 1
  234.    end
  235.    rxTemp.stream(rPlugin, "c", "close")
  236.   end
  237.   rPluginClass[0] = (iCnter - 1)
  238.  
  239.   rPlugin = rxTemp.stream("maxbase.mnu","c","query exists")
  240.   if rPlugin \= "" then
  241.   do
  242.    rxTemp.stream(rPlugin, "c", "open read")
  243.  
  244.    rxTemp.linein() -- Gets the line with "Buttons" in it.
  245.  
  246.    bnDbTools.setLabel(rxTemp.linein())
  247.    bnRecords.setLabel(rxTemp.linein())
  248.    bnSelectAll.setLabel(rxTemp.linein())
  249.    bnDeselectAll.setLabel(rxTemp.linein())
  250.    bnMainPanel.setLabel(rxTemp.linein())
  251.    bnCreate.setLabel(rxTemp.linein())
  252.    bnDestroy.setLabel(rxTemp.linein())
  253.    bnAddField.setLabel(rxTemp.linein())
  254.    bnDelField.setLabel(rxTemp.linein())
  255.    bnModFieldIdx.setLabel(rxTemp.linein())
  256.    bnModThisField.setLabel(rxTemp.linein())
  257.    bnSetThisIdx.setLabel(rxTemp.linein())
  258.    bnYes.setLabel(rxTemp.linein())
  259.    bnFilter.setLabel(rxTemp.linein())
  260.    bnFilterOk.setLabel(rxTemp.linein())
  261.    bnNo.setLabel(rxTemp.linein())
  262.    bnGotOrder.setLabel(rxTemp.linein())
  263.    bnDelYes.setLabel(rxTemp.linein())
  264.    bnCrPrev.setLabel(rxTemp.linein())
  265.    bnFirst50.setLabel(rxTemp.linein())
  266.    bnAll.setLabel(rxTemp.linein())
  267.    bnCrNext.setLabel(rxTemp.linein())
  268.    bnCrDone.setLabel(rxTemp.linein())
  269.    bnStoreNewField.setLabel(rxTemp.linein())
  270.    bnDeleteThisField.setLabel(rxTemp.linein())
  271.    bnCrCancel.setLabel(rxTemp.linein())
  272.    bnConnect.setLabel(rxTemp.linein())
  273.    bnDisconnect.setLabel(rxTemp.linein())
  274.    bnRefresh.setLabel(rxTemp.linein())
  275.    bnProperties.setLabel(rxTemp.linein())
  276.    bnFormView.setLabel(rxTemp.linein())
  277.    bnPack.setLabel(rxTemp.linein())
  278.    bnAdd.setLabel(rxTemp.linein())
  279.    bnModify.setLabel(rxTemp.linein())
  280.    bnDelete.setLabel(rxTemp.linein())
  281.    bnOrder.setLabel(rxTemp.linein())
  282.    bnAStore.setLabel(rxTemp.linein())
  283.    bnMStore.setLabel(rxTemp.linein())
  284.    bnDBFtoDAT.setLabel(rxTemp.linein())
  285.    bnDATtoDBF.setLabel(rxTemp.linein())
  286.    
  287.    rxTemp.linein() -- Gets the line with "Labels" in it.
  288.  
  289.    laCrName.setText(rxTemp.linein())
  290.    laCrLength.setText(rxTemp.linein())
  291.    laCrIndex.setText(rxTemp.linein())
  292.    laCrInfo.setText(rxTemp.linein())
  293.    laFilter.setText(rxTemp.linein())
  294.    laPage.setText(rxTemp.linein())
  295.    
  296.    rxTemp.linein() -- Gets the line with "User infos" in it.
  297.  
  298.    rTXTFileNotPresent = rxTemp.linein()
  299.    rTXTEnd = rxTemp.linein()
  300.    rTXTChoose = rxTemp.linein()
  301.    rTXTChooseDBF = rxTemp.linein()
  302.    rTXTNoDb = rxTemp.linein()
  303.    rTXTOneLine = rxTemp.linein()
  304.    rTXTActRec = rxTemp.linein()
  305.    rTXTShowHere = rxTemp.linein()
  306.    rTXTMissInfo = rxTemp.linein()
  307.    rTXTName = rxTemp.linein()
  308.    rTXTWrkFld = rxTemp.linein()
  309.    rTXTPickName = rxTemp.linein()
  310.    rTXTMInfo = rxTemp.linein()
  311.    rTXTMName = rxTemp.linein()
  312.    rTXTNoIndex = rxTemp.linein()
  313.    rTXTBigger = rxTemp.linein()
  314.    rTXTFileExists = rxTemp.linein()
  315.    rTXTSaved = rxTemp.linein()
  316.    rTXTFindInfo = rxTemp.linein()
  317.    rTXTFindTitle = rxTemp.linein()
  318.    rTXTOrderTitle = rxTemp.linein()
  319.    rTXTFldDelTitle = rxTemp.linein()
  320.    rTXTModIdxTitle = rxTemp.linein()
  321.    rTXTIdxStratTitle = rxTemp.linein()
  322.    rTXTDelDb = rxTemp.linein()
  323.    rTXTDelDbInfo = rxTemp.linein()
  324.    rTXTRDel1 = rxTemp.linein()
  325.    rTXTRDel2 = rxTemp.linein()
  326.    rTXTRDel3 = rxTemp.linein()
  327.    rTXTRDel4 = rxTemp.linein()
  328.    rTXTWarning = rxTemp.linein()
  329.    rTXTCurWork = rxTemp.linein()
  330.    rTXTCreateDb = rxTemp.linein()
  331.    rTXTAddFld = rxTemp.linein()
  332.    rTXTAddFldTitle = rxTemp.linein()
  333.    rTXTRecAdd = rxTemp.linein()
  334.    rTXTRecMod = rxTemp.linein()
  335.    rTXTRecBrowse = rxTemp.linein()
  336.    rTXTSelPage = rxTemp.linein()
  337.    rTXTStore = rxTemp.linein()
  338.    rTXTCantAdd1 = rxTemp.linein()
  339.    rTXTCantAdd2 = rxTemp.linein()
  340.    rTXTIdxNONE0 = rxTemp.linein()
  341.    rTXTIdxNONE1 = rxTemp.linein()
  342.    rTXTIdxISAM00 = rxTemp.linein()
  343.    rTXTIdxISAM01 = rxTemp.linein()
  344.    rTXTIdxISAM10 = rxTemp.linein()
  345.    rTXTIdxISAM11 = rxTemp.linein()
  346.  
  347.    rxTemp.stream(rPlugin, "c", "close")
  348.   end
  349.    
  350.   rShowed = '50'
  351.  
  352.   chCrIndex.addItem(rTXTIdxNONE0)
  353.   chCrIndex.addItem(rTXTIdxNONE1)
  354.   chCrIndex.addItem(rTXTIdxISAM00)
  355.   chCrIndex.addItem(rTXTIdxISAM01)
  356.   chCrIndex.addItem(rTXTIdxISAM10)
  357.   chCrIndex.addItem(rTXTIdxISAM11)
  358.  
  359.   screen=Toolkit.getDefaultToolkit.getScreenSize
  360.   resize(screen.width, screen.height*0.5)
  361.   move(0, screen.height*0.25)
  362.   setBackGround(Color.lightgray)
  363.   setForeGround(Color.black)
  364.  
  365.   fm = DbList.getFontMetrics(f)
  366.   scrolpan = ScrollPanel()
  367.   DbList.reshape(0, 0, 10, 10);
  368.   scrolpan.setClient(DbList)
  369.  
  370.   DbLayout()
  371.  
  372.  
  373.  
  374. method MaxBase(sCmdLine = String[])
  375.   rCmdName = Rexx
  376.   rxTemp = RXFile()
  377.  
  378.   doInitStuff()
  379.  
  380.   do 
  381.    rCmdName = rxTemp.stream(sCmdLine[0], "c", "query exists")
  382.   catch ArrayIndexOutOfBoundsException
  383.    rCmdName = ""
  384.   end
  385.  
  386.   if rCmdName \= "" then
  387.    CmdConnect(sCmdLine[0])
  388.  
  389.  
  390.  
  391. method handleEvent(e=Event) returns boolean
  392.   if e.id=Event.ACTION_EVENT then
  393.   do
  394.     select label components
  395.     when e.target <= Button then
  396.       select label buttons
  397.        when  e.target = bnFilter then CreateFilterLayout()
  398.        when  e.target = bnFilterOk then SetFilter()
  399.        when  e.target = bnSelectAll then SelectAll()
  400.        when  e.target = bnDeselectAll then DeselectAll()
  401.        when  e.target = bnConnect then Connect()
  402.        when  e.target = bnDbTools then DbToolsLayout()
  403.        when  e.target = bnRecords then RecordsLayout()
  404.        when  e.target = bnMainPanel then DbLayout()
  405.        when  e.target = bnAddField then AddField()
  406.        when  e.target = bnModFieldIdx then ModIdx()
  407.        when  e.target = bnSetThisIdx then SetThisIdx()
  408.        when  e.target = bnModThisField then SelectIdx()
  409.        when  e.target = bnDelField then DelField()
  410.        when  e.target = bnStoreNewField then StoreNewField()
  411.        when  e.target = bnDeleteThisField then DeleteThisField()
  412.        when  e.target = bnFirst50 then SetFirst50()
  413.        when  e.target = bnAll then SetAllRecords()
  414.        when  e.target = bnRefresh then RefreshView()
  415.        when  e.target = bnProperties then PropertiesLayout()
  416.        when  e.target = bnFormView then FormView()
  417.        when  e.target = bnCreate then Create()
  418.        when  e.target = bnDestroy then DbDestroy()
  419.        when  e.target = bnDisconnect then Disconnect()
  420.        when  e.target = bnAdd then AddRecord()
  421.        when  e.target = bnModify then ModiRecord()
  422.        when  e.target = bnDelete then DeleRec()
  423.        when  e.target = bnOrder then OrderBy()
  424.        when  e.target = bnPack then PackIt()
  425.        when  e.target = bnGotOrder then GotOrder()
  426.        when  e.target = bnYes then DbDel
  427.        when  e.target = bnDelYes then RecDel
  428.        when  e.target = bnNo then CancelWithoutReload
  429.        when  e.target = bnCrCancel then CancelWithoutReload
  430.        when  e.target = bnCrNext then DbCrNext
  431.        when  e.target = bnCrPrev then DbCrPrev
  432.        when  e.target = bnCrDone then DbCrDone
  433.        when  e.target = bnAStore then AStore()
  434.        when  e.target = bnMStore then MStore()
  435.        when  e.target = bnPuno then Lancia(1)
  436.        when  e.target = bnPdue then Lancia(2)
  437.        when  e.target = bnPtre then Lancia(3)
  438.        when  e.target = bnPquattro then Lancia(4)
  439.        when  e.target = bnPcinque then Lancia(5)
  440.        when  e.target = bnDBFtoDAT then DBFtoDAT
  441.        when  e.target = bnDATtoDBF then DATtoDBF
  442.        otherwise
  443.         nop
  444.       end buttons 
  445.     when e.target <= Choice then
  446.       select label choices
  447.        when e.target = chPage then AddRecordLayout(chPage.getSelectedItem(), 1)
  448.        when e.target = chMPage then AddRecordLayout(chMPage.getSelectedItem(), 0)
  449.        when e.target = chFPage then AddRecordLayout(chFPage.getSelectedItem(), 2)
  450.        otherwise
  451.         nop
  452.       end choices
  453.     otherwise
  454.      nop
  455.     end components
  456.   end
  457.   else
  458.    if e.id=Event.WINDOW_DESTROY then 
  459.    do
  460.     if rCurrentDb \= "" then
  461.      dbMine.disconnect()
  462.     exit
  463.    end
  464.   return super.handleEvent(e)
  465.  
  466.  
  467. -- Lancia means 'launch'
  468. method Lancia(iPlugin = int) private
  469.  rx = RXFile()
  470.  rtime = Runtime
  471.  pr2 = Process
  472.  iLines = int[]
  473.  iFoo = int
  474.  iCnter = int 1
  475.  iCnter2 = int 0
  476.  bExit = boolean 0
  477.  
  478.  iLines = DBList.getSelectedIndexes()
  479.  do
  480.   iFoo = iLines[0]
  481.  catch ArrayIndexOutOfBoundsException
  482.   return
  483.  end
  484.  
  485.  loop while bExit = 0
  486.   iFoo = iLines[iCnter - 1]
  487.   iCnter = iCnter + 1
  488.  catch ArrayIndexOutOfBoundsException
  489.   bExit = 1
  490.  end
  491.  
  492.  loop iFoo = 1 to (iCnter-1) /* Records */
  493.   if iLines[iFoo-1] = 0 then
  494.    return
  495.  end
  496.  
  497.  rtime = Runtime.getRuntime()
  498.  do
  499.   pr2 = rtime.exec(rPluginClass[iPlugin])
  500.  catch IOException
  501.  catch NullPointerException
  502.   say 'problem with plugin!:'pr2' 'rtime
  503.  end
  504.  rx.attachtooutputstream(pr2.getOutputStream())
  505.  rx.attachtoinputstream(pr2.getInputStream())
  506.  
  507.  rx.lineout(rRecordStr[0, 0]) /* How many fields? */
  508.  
  509.  loop iFoo = 1 to rRecordStr[0, 0]
  510.   rx.lineout(rRecordStr[iFoo, 1]) /* Send field names */
  511.  end
  512.  
  513.  rx.lineout(iCnter-1) /* How many records? */
  514.  
  515.  loop iFoo = 1 to (iCnter-1) /* Records */
  516.   loop iCnter2 = 1 to rRecordStr[0, 0]
  517.    rx.lineout(rRecArr[iCnter2, iLines[iFoo-1] ])
  518.   end
  519.  end
  520.  
  521.  
  522.  
  523. method Connect() private
  524.  OpenFileDialog = FileDialog(this, rTXTChoose)
  525.  iCnter = int
  526.  CurFile = Rexx
  527.  File1 = RXFile()
  528.  
  529.  OpenFileDialog.show()
  530.  if OpenFileDialog.getFile = null then return
  531.  CurFile = OpenFileDialog.getFile
  532.  
  533.  if (CurFile.right(4, ' ')).upper() \= '.DAT' then return
  534.  if (File1.stream(CurFile, "c", "query exists")).length() = 0 then return
  535.  
  536.   /* Now load the records */
  537.   dbMine.disconnect()
  538.   dbMine = null
  539.   dbMine = RXDbase()
  540.   rCurrentDb = CurFile.left(CurFile.length() - 4)
  541.   dbMine.connect(rCurrentDb)
  542.   rRecordStr = dbMine.getdbinfo()
  543.   iIdx=0
  544.   loop iCnter = 1 to rRecordStr[0,0]
  545.    if (rRecordStr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  546.   end
  547.   rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  548.  
  549.   rDbStats = dbMine.getdbstats()
  550.   this.hide()
  551.   DbList.clear()
  552.   DBHeader()
  553.   DbFill()
  554.   DbLayout()
  555.  
  556.  
  557.  
  558. method CmdConnect(rDbName = Rexx) private
  559.  iCnter = int
  560.  
  561.   /* Now load the records */
  562.   dbMine.disconnect()
  563.   dbMine = null
  564.   dbMine = RXDbase()
  565.   rCurrentDb = rDbName.left(rDbName.length() - 4)
  566.   dbMine.connect(rCurrentDb)
  567.   rRecordStr = dbMine.getdbinfo()
  568.   iIdx=0
  569.   loop iCnter = 1 to rRecordStr[0,0]
  570.    if (rRecordStr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  571.   end
  572.   rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  573.  
  574.   rDbStats = dbMine.getdbstats()
  575.   this.hide()
  576.   DbList.clear()
  577.   DBHeader()
  578.   DbFill()
  579.   DbLayout()
  580.  
  581.  
  582.  
  583. method RefreshView() private
  584.  
  585.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  586.  
  587.  rDbStats = dbMine.getdbstats()
  588.  this.hide()
  589.  DbList.clear()
  590.  DBHeader()
  591.  DbFill()
  592.  RecordsLayout()
  593.  
  594.  
  595.  
  596. method Disconnect() private
  597.  dbMine.disconnect()
  598.  iIdx=0
  599.  
  600.  this.hide()
  601.  DbList.clear()
  602.  dbMine = null
  603.  dbMine = RXDbase()
  604.  rCurrentDb = ""
  605.  this.setTitle(rTXTNoDb)
  606.  DbLayout()
  607.  
  608.  
  609.  
  610. method DbDestroy() private
  611.  
  612.  if rCurrentDb = "" then return
  613.  ConfirmLayout()
  614.  
  615.  
  616.  
  617. method DbDel() private
  618.  dbMine.disconnect()
  619.  dbMine.deletedb(rCurrentDb)
  620.  dbMine = null
  621.  dbMine = RXDbase()
  622.  rCurrentDb=""
  623.  DbLayout()
  624.  this.hide()
  625.  DbList.clear()
  626.  this.show()
  627.  
  628.  
  629. method DBHeader() private
  630.  rTemp = Rexx ""
  631.  iCnter = int
  632.  
  633.  if rCurrentDb = "" then return
  634.  loop iCnter = 1 to rRecordStr[0,0]
  635.   rTemp = rTemp || (rRecordStr[iCnter, 1]).right(rRecordStr[iCnter, 0]) || "."
  636.  end
  637.  DbList.addItem(rTemp)
  638.  
  639.  
  640.  
  641. method DBFill() private
  642.  rTemp = Rexx ""
  643.  iCnter = int
  644.  iCnter2 = int
  645.  
  646.  if rCurrentDb = "" then return
  647.  loop iCnter = 1 to rRecArr[0, 1]
  648.   rTemp = ""
  649.   loop iCnter2 = 1 to rRecordStr[0,0]
  650.    rTemp = rTemp || rRecArr[iCnter2, iCnter] || "."
  651.   end
  652.   DbList.addItem(rTemp)
  653.  end
  654.  this.setTitle(rTXTOneLine || rCurrentDb || "; " || rDbStats[3] || rTXTActRec || rRecArr[0,1] || rTXTShowHere)
  655.  DbList.reshape(0, 0, (fm.stringWidth(DbList.getItem(DbList.countItems() - 1)) * 1.2) % 1, fm.getHeight() * (DbList.countItems() + 1));
  656.  
  657.  
  658.  
  659. method CreateFilterLayout() private
  660.  p2 = Panel()
  661.  p3 = Panel()
  662.  
  663.  p2.setLayout(FlowLayout())
  664.   if bnFilterOk.getLabel() \= '-' then p2.add(bnFilterOk)
  665.   if bnRecords.getLabel() \= '-' then p2.add(bnRecords)
  666.  
  667.  p3.add(laFilter)
  668.  p3.add(tfCrName)
  669.  tfCrName.setText(rFilter)
  670.  p3.setLayout(GridLayout(1, 2))
  671.  
  672.  laCrInfo.setText(rTXTFindInfo)
  673.  
  674.  this.removeAll()
  675.  setLayout(BorderLayout())
  676.  add("South", laCrInfo)
  677.  add("Center", p2)
  678.  add("North", p3)
  679.  this.setTitle(rTXTFindTitle)
  680.  this.show()
  681.  
  682.  
  683.  
  684. method DbLayout() private
  685.   iCnter = int
  686.  
  687.   this.removeAll()
  688.   setLayout(BorderLayout())
  689.   DbList.setFont(f)
  690.   p = panel()
  691.   p.setLayout(FlowLayout());
  692.   if bnDbTools.getLabel() \= '-' then  p.add(bnDbTools);
  693.   if rCurrentDB \= "" then
  694.   do
  695.    if bnRecords.getLabel() \= '-' then p.add(bnRecords);
  696.    if bnDisconnect.getLabel() \= '-' then p.add(bnDisconnect);
  697.    if bnSelectAll.getLabel() \= '-' then  p.add(bnSelectAll);
  698.    if bnDeselectAll.getLabel() \= '-' then  p.add(bnDeselectAll);
  699.    if rPluginClass[0] > 0 then
  700.    loop iCnter = 1 to rPluginClass[0]
  701.     select 
  702.     when iCnter=1 then
  703.      p.add(bnPuno)
  704.     when iCnter=2 then
  705.      p.add(bnPdue)
  706.     when iCnter=3 then
  707.      p.add(bnPtre)
  708.     when iCnter=4 then
  709.      p.add(bnPquattro)
  710.     when iCnter=5 then
  711.      p.add(bnPcinque)
  712.     otherwise
  713.      nop
  714.     end
  715.    end
  716.   end
  717.   else
  718.    if bnConnect.getLabel() \= '-' then  p.add(bnConnect);
  719.  
  720.   add("South", p);
  721.   add("Center", scrolpan)
  722.   if rCurrentDB = "" then
  723.    this.setTitle(rTXTNoDb)
  724.   else 
  725.    this.setTitle(rTXTOneLine || rCurrentDb || "; " || rDbStats[3] || rTXTActRec || rRecArr[0,1] || rTXTShowHere)
  726.   this.show()
  727.  
  728.  
  729.  
  730. method RecordsLayout() private
  731.  
  732.   this.removeAll()
  733.   setLayout(BorderLayout())
  734.   DbList.setFont(f)
  735.   pRecs = panel()
  736.   pRecs.setLayout(FlowLayout());
  737.   if bnAdd.getLabel() \= '-' then  pRecs.add(bnAdd);
  738.   if bnModify.getLabel() \= '-' then  pRecs.add(bnModify);
  739.   if bnDelete.getLabel() \= '-' then  pRecs.add(bnDelete);
  740.   if bnOrder.getLabel() \= '-' then  pRecs.add(bnOrder);
  741.   if bnFilter.getLabel() \= '-' then  pRecs.add(bnFilter);
  742.   if bnFormView.getLabel() \= '-' then  pRecs.add(bnFormView);
  743.   if bnRefresh.getLabel() \= '-' then  pRecs.add(bnRefresh);
  744.   if bnMainPanel.getLabel() \= '-' then  pRecs.add(bnMainPanel);
  745.   add("South", pRecs);
  746.   add("Center", scrolpan)
  747.   this.show()
  748.  
  749.  
  750.  
  751. method DbToolsLayout() private
  752.  
  753.   this.removeAll()
  754.   setLayout(BorderLayout())
  755.   DbList.setFont(f)
  756.   dbtoolsp = Panel()
  757.   dbToolsp.setLayout(FlowLayout());
  758.   if bnCreate.getLabel() \= '-' then  dbToolsp.add(bnCreate);
  759.   if rCurrentDB \= "" then
  760.   do
  761.    if bnDestroy.getLabel() \= '-' then  dbToolsp.add(bnDestroy);
  762.    if bnPack.getLabel() \= '-' then  dbToolsp.add(bnPack);
  763.    if bnAddField.getLabel() \= '-' then  dbToolsp.add(bnAddField);
  764.    if bnDelField.getLabel() \= '-' then  dbToolsp.add(bnDelField);
  765.    if bnModFieldIdx.getLabel() \= '-' then  dbToolsp.add(bnModFieldIdx);
  766.   end
  767.   if bnDBFtoDAT.getLabel() \= '-' then  dbToolsp.add(bnDBFtoDAT)
  768.   if bnDATtoDBF.getLabel() \= '-' then  dbToolsp.add(bnDATtoDBF)
  769.  
  770.   if bnProperties.getLabel() \= '-' then  dbToolsp.add(bnProperties);
  771.   if bnMainPanel.getLabel() \= '-' then  dbToolsp.add(bnMainPanel);
  772.  
  773.   add("South", dbToolsp);
  774.   add("Center", scrolpan)
  775.   if rCurrentDB = "" then
  776.    this.setTitle(rTXTNoDb)
  777.   else 
  778.    this.setTitle(rTXTOneLine || rCurrentDb || "; " || rDbStats[3] || rTXTActRec || rRecArr[0,1] || rTXTShowHere)
  779.   this.show()
  780.  
  781.  
  782.  
  783. method PropertiesLayout() private
  784.  
  785.   this.removeAll()
  786.   setLayout(BorderLayout())
  787.   DbList.setFont(f)
  788.   dbprop = Panel()
  789.   dbprop.setLayout(FlowLayout());
  790.   if bnFirst50.getLabel() \= '-' then  dbprop.add(bnFirst50);
  791.   if bnAll.getLabel() \= '-' then  dbprop.add(bnAll);
  792.   if bnDbTools.getLabel() \= '-' then  dbprop.add(bnDbTools);
  793.   add("South", dbprop);
  794.   add("Center", scrolpan)
  795.   if rCurrentDB = "" then
  796.    this.setTitle(rTXTNoDb)
  797.   else 
  798.    this.setTitle(rTXTOneLine || rCurrentDb || "; " || rDbStats[3] || rTXTActRec || rRecArr[0,1] || rTXTShowHere)
  799.   this.show()
  800.  
  801.  
  802.  
  803. method OrderLayout(iIndexes = int[]) private
  804.  p2 = Panel()
  805.  iCnter = int
  806.  
  807.  FieldList.clear()
  808.  loop iCnter = 1 to iIndexes[0]
  809.   FieldList.addItem( rRecordStr[iIndexes[iCnter], 1] )
  810.  end
  811.  FieldList.setFont(f2)
  812.  
  813.  p2.setLayout(FlowLayout())
  814.  if bnGotOrder.getLabel() \= '-' then  p2.add(bnGotOrder)
  815.  if bnRecords.getLabel() \= '-' then  p2.add(bnRecords)
  816.  
  817.  this.removeAll()
  818.  setLayout(BorderLayout())
  819.  add("South", p2)
  820.  add("Center", FieldList)
  821.  this.setTitle(rTXTOrderTitle)
  822.  this.show()
  823.  
  824.  
  825.  
  826. method DelFieldLayout() private
  827.  p2 = Panel()
  828.  iCnter = int
  829.  
  830.  FieldList.clear()
  831.  loop iCnter = 1 to rRecordStr[0,0]
  832.   FieldList.addItem( rRecordStr[iCnter, 1] )
  833.  end
  834.  FieldList.setFont(f2)
  835.  
  836.  p2.setLayout(FlowLayout())
  837.  if bnDeleteThisField.getLabel() \= '-' then  p2.add(bnDeleteThisField)
  838.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  839.  
  840.  this.removeAll()
  841.  setLayout(BorderLayout())
  842.  add("South", p2)
  843.  add("Center", FieldList)
  844.  this.setTitle(rTXTFldDelTitle)
  845.  this.show()
  846.  
  847.  
  848.  
  849. method ModIdxLayout(iIndexes = int[]) private
  850.  p2 = Panel()
  851.  iCnter = int
  852.  
  853.  FieldList.clear()
  854.  loop iCnter = 1 to iIndexes[0]
  855.   FieldList.addItem( rRecordStr[iIndexes[iCnter], 1] )
  856.  end
  857.  FieldList.setFont(f2)
  858.  
  859.  p2.setLayout(FlowLayout())
  860.  if bnModThisField.getLabel() \= '-' then  p2.add(bnModThisField)
  861.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  862.  
  863.  this.removeAll()
  864.  setLayout(BorderLayout())
  865.  add("South", p2)
  866.  add("Center", FieldList)
  867.  this.setTitle(rTXTModIdxTitle)
  868.  this.show()
  869.  
  870.  
  871.  
  872. method SelectIdxLayout(rIndexes = Rexx[]) private
  873.  p2 = Panel()
  874.  iCnter = int
  875.  
  876.  FieldList.clear()
  877.  loop iCnter = 1 to rIndexes[0]
  878.   FieldList.addItem( rIndexes[iCnter] )
  879.  end
  880.  FieldList.setFont(f2)
  881.  
  882.  p2.setLayout(FlowLayout())
  883.  if bnSetThisIdx.getLabel() \= '-' then  p2.add(bnSetThisIdx)
  884.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  885.  
  886.  this.removeAll()
  887.  setLayout(BorderLayout())
  888.  add("South", p2)
  889.  add("Center", FieldList)
  890.  this.setTitle(rTXTIdxStratTitle)
  891.  this.show()
  892.  
  893.  
  894.  
  895. method ConfirmLayout() private
  896.  p2 = Panel()
  897.  DeleteList = List(2,0)
  898.  
  899.  DeleteList.addItem(rTXTDelDb)
  900.  DeleteList.addItem(rTXTDelDbInfo)
  901.  DeleteList.setFont(f2)
  902.  
  903.  p2.setLayout(FlowLayout())
  904.  if bnYes.getLabel() \= '-' then  p2.add(bnYes)
  905.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  906.  
  907.  this.removeAll()
  908.  setLayout(BorderLayout())
  909.  add("South", p2)
  910.  add("Center", DeleteList)
  911.  this.setTitle(rTXTWarning)
  912.  this.show()
  913.  
  914.  
  915.  
  916. method DeleteConfirmLayout() private
  917.  p2 = Panel()
  918.  DeleteList = List(2,0)
  919.  
  920.  if iOldPage = 0 then
  921.   DeleteList.addItem(rTXTRDel1)
  922.  else
  923.   DeleteList.addItem(rTXTRDel2 || (iOldPage+1) || rTXTRDel3)
  924.  DeleteList.addItem(rTXTRDel4)
  925.  DeleteList.setFont(f2)
  926.  
  927.  p2.setLayout(FlowLayout())
  928.  if bnDelYes.getLabel() \= '-' then  p2.add(bnDelYes)
  929.  if bnNo.getLabel() \= '-' then  p2.add(bnNo)
  930.  
  931.  this.removeAll()
  932.  setLayout(BorderLayout())
  933.  add("South", p2)
  934.  add("Center", DeleteList)
  935.  this.setTitle(rTXTWarning)
  936.  this.show()
  937.  
  938.  
  939.  
  940. method CreateDbLayout() private
  941.  p2 = Panel()
  942.  p3 = Panel()
  943.  
  944.  p2.setLayout(FlowLayout())
  945.  if bnCrPrev.getLabel() \= '-' then  p2.add(bnCrPrev)
  946.  if bnCrNext.getLabel() \= '-' then  p2.add(bnCrNext)
  947.  if bnCrDone.getLabel() \= '-' then  p2.add(bnCrDone)
  948.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  949.  
  950.  p3.add(laCrName)
  951.  p3.add(tfCrName)
  952.  tfCrName.setText( rTempArr[1, 1])
  953.  p3.add(laCrLength)
  954.  tfCrLength.setText( rTempArr[1, 0])
  955.  p3.add(tfCrLength)
  956.  p3.add(laCrIndex)
  957.  p3.add(chCrIndex)
  958.  ChCrIndex.select(rTXTIdxNONE0)
  959.  
  960.  p3.setLayout(GridLayout(3, 2))
  961.  
  962.  laCrInfo.setText(rTXTCurWork)
  963.  
  964.  this.removeAll()
  965.  setLayout(BorderLayout())
  966.  add("South", laCrInfo)
  967.  add("Center", p2)
  968.  add("North", p3)
  969.  this.setTitle(rTXTCreateDb)
  970.  this.show()
  971.  
  972.  
  973.  
  974. method AddFieldLayout() private
  975.  p2 = Panel()
  976.  p3 = Panel()
  977.  
  978.  p2.setLayout(FlowLayout())
  979.  if bnStoreNewField.getLabel() \= '-' then  p2.add(bnStoreNewField)
  980.  if bnDbTools.getLabel() \= '-' then  p2.add(bnDbTools)
  981.  
  982.  p3.add(laCrName)
  983.  p3.add(tfCrName)
  984.  tfCrName.setText( rTempArr[1, 1])
  985.  p3.add(laCrLength)
  986.  tfCrLength.setText( rTempArr[1, 0])
  987.  p3.add(tfCrLength)
  988.  p3.add(laCrIndex)
  989.  p3.add(chCrIndex)
  990.  ChCrIndex.select(rTXTIdxNONE0)
  991.  p3.setLayout(GridLayout(3, 2))
  992.  
  993.  laCrInfo.setText(rTXTAddFld)
  994.  
  995.  this.removeAll()
  996.  setLayout(BorderLayout())
  997.  add("South", laCrInfo)
  998.  add("Center", p2)
  999.  add("North", p3)
  1000.  this.setTitle(rTXTAddFldTitle)
  1001.  this.show()
  1002.  
  1003.  
  1004.  
  1005. method AddRecordLayout(rPage = Rexx, iAdd = int) private
  1006.  p2 = Panel()
  1007.  p3 = Panel()
  1008.  iCnter = int
  1009.  iCnter2 = int
  1010.  
  1011.  this.removeAll()
  1012.  setLayout(BorderLayout())
  1013.  
  1014.  p2.setLayout(FlowLayout())
  1015.  if iAdd=1 then
  1016.  do
  1017.   this.setTitle(rTXTRecAdd)
  1018.   if bnAStore.getLabel() \= '-' then  p2.add(bnAStore)
  1019.  end
  1020.  else if iAdd=0 then
  1021.  do
  1022.   this.setTitle(rTXTRecMod)
  1023.   if bnMStore.getLabel() \= '-' then  p2.add(bnMStore)
  1024.  end
  1025.  else
  1026.   this.setTitle(rTXTRecBrowse)
  1027.  
  1028.  if bnNo.getLabel() \= '-' then  p2.add(bnNo)
  1029.  
  1030.  if iOldPage \= 0 then
  1031.  do
  1032.   rRecArr2[1 + (iOldpage-1)*5, 1] = tfOne.getText()
  1033.   if rRecordStr[0,0] > 1 + (iOldPage-1)*5 then
  1034.    rRecArr2[2 + (iOldpage-1)*5, 1] = tfTwo.getText()
  1035.   if rRecordStr[0,0] > 2 + (iOldPage-1)*5 then
  1036.    rRecArr2[3 + (iOldpage-1)*5, 1] = tfThree.getText()
  1037.   if rRecordStr[0,0] > 3 + (iOldPage-1)*5 then
  1038.    rRecArr2[4 + (iOldpage-1)*5, 1] = tfFour.getText()
  1039.   if rRecordStr[0,0] > 4 + (iOldPage-1)*5 then
  1040.    rRecArr2[5 + (iOldpage-1)*5, 1] = tfFive.getText()
  1041.  end
  1042.  
  1043.  iOldPage = rPage
  1044.  
  1045.  laOne.setText(rRecordStr[1 + (rPage-1)*5, 1])
  1046.  p3.add(laOne)
  1047.  tfOne.setText( (rRecArr2[1+(rPage-1)*5, 1]).strip() )
  1048.  p3.add(tfOne)
  1049.  iCnter=1
  1050.  if rRecordStr[0,0] > 1 + (rPage-1)*5 then
  1051.  do
  1052.   p3.add(laTwo)
  1053.   tfTwo.setText( (rRecArr2[2+(rPage-1)*5, 1]).strip() )
  1054.   p3.add(tfTwo)
  1055.   laTwo.setText(rRecordStr[2 + (rPage-1)*5, 1])
  1056.   iCnter=2
  1057.  end
  1058.  if rRecordStr[0,0] > 2 + (rPage-1)*5 then
  1059.  do
  1060.   p3.add(laThree)
  1061.   tfThree.setText( (rRecArr2[3+(rPage-1)*5, 1]).strip() )
  1062.   p3.add(tfThree)
  1063.   laThree.setText(rRecordStr[3 + (rPage-1)*5, 1])
  1064.   iCnter=3
  1065.  end
  1066.  if rRecordStr[0,0] > 3 + (rPage-1)*5 then
  1067.  do
  1068.   p3.add(laFour)
  1069.   tfFour.setText( (rRecArr2[4+(rPage-1)*5, 1]).strip() )
  1070.   p3.add(tfFour)
  1071.   laFour.setText(rRecordStr[4 + (rPage-1)*5, 1])
  1072.   iCnter=4
  1073.  end
  1074.  if rRecordStr[0,0] > 4 + (rPage-1)*5 then
  1075.  do
  1076.   p3.add(laFive)
  1077.   tfFive.setText( (rRecArr2[5+(rPage-1)*5, 1]).strip() )
  1078.   p3.add(tfFive)
  1079.   laFive.setText(rRecordStr[5 + (rPage-1)*5, 1])
  1080.   iCnter=5
  1081.  end
  1082.  if rRecordStr[0,0] > 5 then
  1083.  do
  1084.   p3.add(laPage)
  1085.   if iAdd = 1 then
  1086.   do
  1087.    chPage = Choice()
  1088.    loop iCnter2 = 1 to (rRecordStr[0,0] % 5) + 1
  1089.     chPage.addItem(iCnter2)
  1090.    end
  1091.    p3.add(chPage)
  1092.    chPage.select(rPage)
  1093.   end
  1094.   else if iAdd = 0 then
  1095.   do
  1096.    chMPage = Choice()
  1097.    loop iCnter2 = 1 to (rRecordStr[0,0] % 5) + 1
  1098.     chMPage.addItem(iCnter2)
  1099.    end
  1100.    p3.add(chMPage)
  1101.    chMPage.select(rPage)
  1102.   end
  1103.   else
  1104.   do
  1105.    chFPage = Choice()
  1106.    loop iCnter2 = 1 to (rRecordStr[0,0] % 5) + 1
  1107.     chFPage.addItem(iCnter2)
  1108.    end
  1109.    p3.add(chFPage)
  1110.    chFPage.select(rPage)
  1111.   end
  1112.   laCrInfo.setText(rTXTSelPage)
  1113.   iCnter=iCnter+1
  1114.  end
  1115.  else
  1116.   laCrInfo.setText(rTXTStore)
  1117.  p3.setLayout(GridLayout(iCnter, 2))
  1118.  
  1119.  add("South", laCrInfo)
  1120.  add("Center", p2)
  1121.  add("North", p3)
  1122.  this.show()
  1123.  
  1124.  
  1125. method Create() private
  1126.  iCnter = int
  1127.  
  1128.  Disconnect()
  1129.  loop iCnter = 1 to 99
  1130.   rTempArr[iCnter, 0] = 20
  1131.   rTempArr[iCnter, 1] = ""
  1132.   rTempArr[iCnter, 2] = rTXTIdxNONE0
  1133.  end
  1134.  
  1135.  CreateDbLayout()
  1136.  iCurrFld = 1
  1137.  rTempArr[0,0] = 1
  1138.  
  1139.  
  1140.  
  1141. method AddField() private
  1142.  
  1143.  rTempArr[1, 0] = 20
  1144.  rTempArr[1, 1] = ""
  1145.  rTempArr[1, 2] = rTXTIdxNONE0
  1146.  
  1147.  iCurrFld = 1
  1148.  rTempArr[0,0] = 1
  1149.  AddFieldLayout()
  1150.  
  1151.  
  1152.  
  1153. method StoreNewField private
  1154.  rTName   = Rexx
  1155.  rTLen = Rexx
  1156.  rTIdx = Rexx
  1157.  rTSel = Rexx
  1158.  
  1159.  rTName = tfCrName.getText()
  1160.  rTLen = tfCrLength.getText()
  1161.  
  1162.  if rTName = null | rTLen = null then
  1163.  do
  1164.   laCrInfo.setText(rTXTCantAdd1)
  1165.   return
  1166.  end
  1167.  
  1168.  if rTName.length()=0 | rTLen.datatype("N")\=1 | rTLen < 1 then
  1169.  do
  1170.   laCrInfo.setText(rTXTCantAdd2)
  1171.   return
  1172.  end
  1173.  
  1174.  rTSel = ChCrIndex.getSelectedItem()
  1175.  select
  1176.  when rTSel = rTXTIdxNONE0 then
  1177.   rTIdx = "NONE0"
  1178.  when rTSel = rTXTIdxNONE1 then
  1179.   rTIdx = "NONE1"
  1180.  when rTSel = rTXTIdxISAM00 then
  1181.   rTIdx = "ISAM00"
  1182.  when rTSel = rTXTIdxISAM01 then
  1183.   rTIdx = "ISAM01"
  1184.  when rTSel = rTXTIdxISAM10 then
  1185.   rTIdx = "ISAM10"
  1186.  when rTSel = rTXTIdxISAM11 then
  1187.   rTIdx = "ISAM11"
  1188.  otherwise
  1189.   nop
  1190.  end
  1191.  
  1192.  dbMine.addfield(rTName, rTLen, rTIdx)
  1193.  dbMine.disconnect()
  1194.  dbMine = null
  1195.  dbMine = RXDbase()
  1196.  dbMine.connect(rCurrentDb)
  1197.  rRecordStr = dbMine.getdbinfo()
  1198.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1199.  
  1200.  rDbStats = dbMine.getdbstats()
  1201.  this.hide()
  1202.  DbList.clear()
  1203.  DBHeader()
  1204.  DbFill()
  1205.  DbLayout()
  1206.  
  1207.  
  1208.  
  1209. method DeleteThisField() private
  1210.  iCnter = int
  1211.  
  1212.  iCnter = FieldList.getSelectedIndex() + 1
  1213.  if iCnter < 1 then return
  1214.  
  1215.  dbMine.delfield(iCnter)
  1216.  dbMine.disconnect()
  1217.  dbMine = null
  1218.  dbMine = RXDbase()
  1219.  dbMine.connect(rCurrentDb)
  1220.  rRecordStr = dbMine.getdbinfo()
  1221.  iIdx=0
  1222.  loop iCnter = 1 to rRecordStr[0,0]
  1223.   if (rRecordStr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  1224.  end
  1225.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1226.  
  1227.  rDbStats = dbMine.getdbstats()
  1228.  this.hide()
  1229.  DbList.clear()
  1230.  DBHeader()
  1231.  DbFill()
  1232.  DbLayout()
  1233.  
  1234.  
  1235.  
  1236.  
  1237. method CancelWithoutReload private
  1238.  /* Now reset the current visualization */
  1239.  
  1240.  RecordsLayout()
  1241.  iOldPage = 0
  1242.  if rCurrentDB = "" then
  1243.   this.setTitle(rTXTNoDb)
  1244.  else 
  1245.   this.setTitle(rTXTOneLine || rCurrentDb || "; " || rDbStats[3] || rTXTActRec || rRecArr[0,1] || rTXTShowHere)
  1246.  this.show()
  1247.  
  1248.  
  1249.  
  1250. method DbCrNext() private
  1251.  rTName   = Rexx
  1252.  rTLen = Rexx
  1253.  rTIdx = Rexx
  1254.  rTSel = Rexx
  1255.  
  1256.  rTName = tfCrName.getText()
  1257.  rTLen = tfCrLength.getText()
  1258.  
  1259.  if rTName = null | rTLen = null then
  1260.  do
  1261.   laCrInfo.setText(rTXTMissInfo)
  1262.   return
  1263.  end
  1264.  
  1265.  if rTName.length()=0 | rTLen.datatype("N")\=1 | rTLen < 1 then
  1266.  do
  1267.   laCrInfo.setText(rTXTName)
  1268.   return
  1269.  end
  1270.  
  1271.  rTempArr[iCurrFld, 0] = rTLen
  1272.  rTempArr[iCurrFld, 1] = rTName
  1273.  
  1274.  rTSel = ChCrIndex.getSelectedItem()
  1275.  select
  1276.  when rTSel = rTXTIdxNONE0 then
  1277.   rTIdx = "NONE0"
  1278.  when rTSel = rTXTIdxNONE1 then
  1279.   rTIdx = "NONE1"
  1280.  when rTSel = rTXTIdxISAM00 then
  1281.   rTIdx = "ISAM00"
  1282.  when rTSel = rTXTIdxISAM01 then
  1283.   rTIdx = "ISAM01"
  1284.  when rTSel = rTXTIdxISAM10 then
  1285.   rTIdx = "ISAM10"
  1286.  when rTSel = rTXTIdxISAM11 then
  1287.   rTIdx = "ISAM11"
  1288.  otherwise
  1289.   nop
  1290.  end
  1291.  
  1292.  rTempArr[iCurrFld, 2] = rTIdx
  1293.  
  1294.  if iCurrFld < 99 then
  1295.  do
  1296.   iCurrFld = iCurrFld + 1
  1297.   if iCurrFld > rTempArr[0,0] then
  1298.    rTempArr[0,0] = iCurrFld
  1299.  end
  1300.  
  1301.  tfCrLength.setText(rTempArr[iCurrFld, 0])
  1302.  tfCrName.setText(rTempArr[iCurrFld, 1])
  1303.  
  1304.  rTSel = rTempArr[iCurrFld, 2]
  1305.  select
  1306.  when rTSel = "NONE0" then
  1307.   rTIdx = rTXTIdxNONE0
  1308.  when rTSel = "NONE1" then
  1309.   rTIdx = rTXTIdxNONE1
  1310.  when rTSel = "ISAM00" then
  1311.   rTIdx = rTXTIdxISAM00
  1312.  when rTSel = "ISAM01" then
  1313.   rTIdx = rTXTIdxISAM01
  1314.  when rTSel = "ISAM10" then
  1315.   rTIdx = rTXTIdxISAM10
  1316.  when rTSel = "ISAM11" then
  1317.   rTIdx = rTXTIdxISAM11
  1318.  otherwise
  1319.   nop
  1320.  end
  1321.  
  1322.  ChCrIndex.select(rTIdx)
  1323.  laCrInfo.setText(rTXTWrkFld|| iCurrFld ||"/99")
  1324.  
  1325.  
  1326.  
  1327. method DbCrPrev() private
  1328.  rTName   = Rexx
  1329.  rTLen = Rexx
  1330.  rTSel = Rexx
  1331.  rTIdx = Rexx
  1332.  
  1333.  rTName = tfCrName.getText()
  1334.  rTLen = tfCrLength.getText()
  1335.  
  1336.  if rTName = null | rTLen = null then
  1337.  do
  1338.   laCrInfo.setText(rTXTMissInfo)
  1339.   return
  1340.  end
  1341.  
  1342.  if rTName.length()=0 | rTLen.datatype("N")\=1 | rTLen < 1 then
  1343.  do
  1344.   laCrInfo.setText(rTXTName)
  1345.   return
  1346.  end
  1347.  
  1348.  rTempArr[iCurrFld, 0] = rTLen
  1349.  rTempArr[iCurrFld, 1] = rTName
  1350.  
  1351.  rTSel = ChCrIndex.getSelectedItem()
  1352.  select
  1353.  when rTSel = rTXTIdxNONE0 then
  1354.   rTIdx = "NONE0"
  1355.  when rTSel = rTXTIdxNONE1 then
  1356.   rTIdx = "NONE1"
  1357.  when rTSel = rTXTIdxISAM00 then
  1358.   rTIdx = "ISAM00"
  1359.  when rTSel = rTXTIdxISAM01 then
  1360.   rTIdx = "ISAM01"
  1361.  when rTSel = rTXTIdxISAM10 then
  1362.   rTIdx = "ISAM10"
  1363.  when rTSel = rTXTIdxISAM11 then
  1364.   rTIdx = "ISAM11"
  1365.  otherwise
  1366.   nop
  1367.  end
  1368.  
  1369.  rTempArr[iCurrFld, 2] = rTIdx
  1370.  
  1371.  if iCurrFld > 1 then
  1372.   iCurrFld = iCurrFld - 1
  1373.  
  1374.  tfCrLength.setText(rTempArr[iCurrFld, 0])
  1375.  tfCrName.setText(rTempArr[iCurrFld, 1])
  1376.  
  1377.  rTSel = rTempArr[iCurrFld, 2]
  1378.  select
  1379.  when rTSel = "NONE0" then
  1380.   rTIdx = rTXTIdxNONE0
  1381.  when rTSel = "NONE1" then
  1382.   rTIdx = rTXTIdxNONE1
  1383.  when rTSel = "ISAM00" then
  1384.   rTIdx = rTXTIdxISAM00
  1385.  when rTSel = "ISAM01" then
  1386.   rTIdx = rTXTIdxISAM01
  1387.  when rTSel = "ISAM10" then
  1388.   rTIdx = rTXTIdxISAM10
  1389.  when rTSel = "ISAM11" then
  1390.   rTIdx = rTXTIdxISAM11
  1391.  otherwise
  1392.   nop
  1393.  end
  1394.  
  1395.  ChCrIndex.select(rTIdx)
  1396.  laCrInfo.setText(rTXTWrkFld|| iCurrFld ||"/99")
  1397.  
  1398.  
  1399.  
  1400. method DbCrDone private
  1401.  OpenFileDialog = FileDialog(this, rTXTPickName)
  1402.  rTName   = Rexx
  1403.  rTLen = Rexx
  1404.  File1 = RXFile()
  1405.  rTIdx = Rexx
  1406.  
  1407.  rTName = tfCrName.getText()
  1408.  rTLen = tfCrLength.getText()
  1409.  
  1410.  if rTName = null | rTLen = null then
  1411.  do
  1412.   laCrInfo.setText(rTXTMInfo)
  1413.   return
  1414.  end
  1415.  
  1416.  if rTName.length()=0 | rTLen.datatype("N")\=1 | rTLen < 1 then
  1417.  do
  1418.   laCrInfo.setText(rTXTMName)
  1419.   return
  1420.  end
  1421.  
  1422.  rTempArr[iCurrFld, 0] = rTLen
  1423.  rTempArr[iCurrFld, 1] = rTName
  1424.  rTSel = ChCrIndex.getSelectedItem()
  1425.  select
  1426.  when rTSel = rTXTIdxNONE0 then
  1427.   rTIdx = "NONE0"
  1428.  when rTSel = rTXTIdxNONE1 then
  1429.   rTIdx = "NONE1"
  1430.  when rTSel = rTXTIdxISAM00 then
  1431.   rTIdx = "ISAM00"
  1432.  when rTSel = rTXTIdxISAM01 then
  1433.   rTIdx = "ISAM01"
  1434.  when rTSel = rTXTIdxISAM10 then
  1435.   rTIdx = "ISAM10"
  1436.  when rTSel = rTXTIdxISAM11 then
  1437.   rTIdx = "ISAM11"
  1438.  otherwise
  1439.   nop
  1440.  end
  1441.  
  1442.  rTempArr[iCurrFld, 2] = rTIdx
  1443.  
  1444.  iIdx=0
  1445.  loop iCnter = 1 to rTempArr[0,0]
  1446.   if (rTempArr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  1447.  end
  1448.  
  1449.  if iIdx = 0 then
  1450.  do
  1451.   laCrInfo.setText(rTXTNoIndex)
  1452.   return
  1453.  end
  1454.  
  1455.  OpenFileDialog.show()
  1456.  if OpenFileDialog.getFile = null then return
  1457.  CurFile = OpenFileDialog.getFile
  1458.  
  1459.  if CurFile.length()>4 then
  1460.  do
  1461.   laCrInfo.setText(rTXTBigger)
  1462.   return
  1463.  end
  1464.  
  1465.  if (File1.stream(CurFile, "c", "query exists")).length() \= 0 then 
  1466.  do
  1467.   laCrInfo.setText(rTXTFileExists)
  1468.   return
  1469.  end
  1470.  
  1471.  dbMine.connect(CurFile, rTempArr)
  1472.  dbMine.disconnect()
  1473.  dbMine = null
  1474.  dbMine = RXDbase()
  1475.  laCrInfo.setText(rTXTSaved)
  1476.  
  1477.  
  1478.  
  1479. method AddRecord() private
  1480.  iCnter = int
  1481.  
  1482.  if rCurrentDb = "" then return 
  1483.  
  1484.  rRecArr2 = Rexx[rRecordStr[0,0] + 1, 2]
  1485.  rRecArr2[0,0] = 1
  1486.  loop iCnter = 1 to rRecordStr[0,0]
  1487.   rRecArr2[iCnter, 1] = ""
  1488.  end
  1489.  AddRecordLayout(1, 1)
  1490.  
  1491.  
  1492.  
  1493. method AStore() private
  1494.  
  1495.  rRecArr2[1 + (iOldpage-1)*5, 1] = tfOne.getText()
  1496.  if rRecordStr[0,0] > 1 + (iOldPage-1)*5 then
  1497.   rRecArr2[2 + (iOldpage-1)*5, 1] = tfTwo.getText()
  1498.  if rRecordStr[0,0] > 2 + (iOldPage-1)*5 then
  1499.   rRecArr2[3 + (iOldpage-1)*5, 1] = tfThree.getText()
  1500.  if rRecordStr[0,0] > 3 + (iOldPage-1)*5 then
  1501.   rRecArr2[4 + (iOldpage-1)*5, 1] = tfFour.getText()
  1502.  if rRecordStr[0,0] > 4 + (iOldPage-1)*5 then
  1503.   rRecArr2[5 + (iOldpage-1)*5, 1] = tfFive.getText()
  1504.  
  1505.  dbMine.saverec(rRecArr2, "APPEND")
  1506.  rDbStats[3] = rDbStats[3] + 1
  1507.  
  1508.  CancelWithoutReload()
  1509.  
  1510.  
  1511.  
  1512. method ModiRecord() private
  1513.  iCnter = int
  1514.  
  1515.  iDeleted = DBList.getSelectedIndex()
  1516.  if ( iDeleted < 1 | rCurrentDb = "") then return
  1517.  
  1518.  rRecArr2 = Rexx[rRecordStr[0,0] + 4, 2]
  1519.  rRecArr2[0,0] = 1
  1520.  rRecArr2[0,1] = rRecArr[rRecordStr[0,0] + 2, iDeleted]
  1521.  loop iCnter = 1 to rRecordStr[0,0]
  1522.   rRecArr2[iCnter, 1] = rRecArr[iCnter, iDeleted]
  1523.  end
  1524.  AddRecordLayout(1, 0)
  1525.  
  1526.  
  1527.  
  1528. method FormView() private
  1529.  iCnter = int
  1530.  iPosList = int
  1531.  
  1532.  iPosList = DBList.getSelectedIndex()
  1533.  if ( iPosList < 1 | rCurrentDb = "") then return
  1534.  
  1535.  rRecArr2 = Rexx[rRecordStr[0,0] + 4, 2]
  1536.  rRecArr2[0,0] = 1
  1537.  rRecArr2[0,1] = rRecArr[rRecordStr[0,0] + 2, iPosList]
  1538.  loop iCnter = 1 to rRecordStr[0,0]
  1539.   rRecArr2[iCnter, 1] = rRecArr[iCnter, iPosList]
  1540.  end
  1541.  AddRecordLayout(1, 2)
  1542.  
  1543.  
  1544.  
  1545. method spaces(rLen = Rexx) private returns Rexx
  1546.   rSpazi = Rexx ''
  1547.  
  1548.   if rLen>0 then
  1549.   do
  1550.    loop for rLen
  1551.     rSpazi=rSpazi||' '
  1552.    end
  1553.   end
  1554.   return rSpazi
  1555.  
  1556.  
  1557.  
  1558. method MStore() private
  1559.  iCnter = int
  1560.  rRet = Rexx
  1561.  
  1562.  rRecArr2[1 + (iOldpage-1)*5, 1] = tfOne.getText()
  1563.  if rRecordStr[0,0] > 1 + (iOldPage-1)*5 then
  1564.   rRecArr2[2 + (iOldpage-1)*5, 1] = tfTwo.getText()
  1565.  if rRecordStr[0,0] > 2 + (iOldPage-1)*5 then
  1566.   rRecArr2[3 + (iOldpage-1)*5, 1] = tfThree.getText()
  1567.  if rRecordStr[0,0] > 3 + (iOldPage-1)*5 then
  1568.   rRecArr2[4 + (iOldpage-1)*5, 1] = tfFour.getText()
  1569.  if rRecordStr[0,0] > 4 + (iOldPage-1)*5 then
  1570.   rRecArr2[5 + (iOldpage-1)*5, 1] = tfFive.getText()
  1571.  
  1572.  rRet = dbMine.modirec(rRecArr2)
  1573.  
  1574.  /* Maybe it wasn't valid.. */
  1575.  if rRet.left(1) = "1" then
  1576.   loop iCnter = 1 to rRecordStr[0,0]
  1577.    rRecArr[iCnter, iDeleted] = spaces(rRecordStr[iCnter, 0] - (rRecArr2[iCnter, 1]).length()) || rRecArr2[iCnter, 1]
  1578.   end
  1579.  this.hide()
  1580.  DbList.clear()
  1581.  DBHeader()
  1582.  DbFill()
  1583.  
  1584.  CancelWithoutReload()
  1585.  
  1586.  
  1587.  
  1588. method DeleRec() private
  1589.  bExit = boolean 0
  1590.  iCount = int
  1591.  
  1592.  if rCurrentDb = "" then return
  1593.  
  1594.  iDelVis = DBList.getSelectedIndexes() /* Per cancellarlo nella visualizzazione */
  1595.  if iDelVis[0] = 0 then 
  1596.  do
  1597.   DBList.deselect(0)
  1598.   return
  1599.  end
  1600.  
  1601.  iOldPage = 0
  1602.  loop until bExit = 1
  1603.   do
  1604.    iCount = iDelVis[iOldPage]
  1605.    iOldPage = iOldPage + 1  
  1606.   catch ArrayIndexOutOfBoundsException
  1607.    bExit = 1
  1608.   end
  1609.  end
  1610.  iOldPage = iOldPage - 1
  1611.  
  1612.  if iOldPage < 0  then return
  1613.  
  1614.  iDelArc = int[iOldPage + 1]
  1615.  
  1616.  loop iCount = 0 to iOldPage
  1617.   iDelArc[iCount] = rRecArr[rRecordStr[0, 0]+2, iDelVis[iCount]] /* nell'archivio */
  1618.  end
  1619.  
  1620.  DeleteConfirmLayout()
  1621.  
  1622.  
  1623.  
  1624. method RecDel() private
  1625.  iCnter = int
  1626.  
  1627.  rToDele = Rexx[iOldPage + 2]
  1628.  rToDele[0] = iOldPage + 1
  1629.  loop iCnter = 1 to iOldPage + 1
  1630.   rToDele[iCnter] = iDelArc[iCnter - 1]
  1631.  end
  1632.  dbmine.delerec(rToDele, 1)
  1633.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1634.  
  1635.  rDbStats = dbMine.getdbstats()
  1636.  this.hide()
  1637.  DbList.clear()
  1638.  DBHeader()
  1639.  DbFill()
  1640.  RecordsLayout()
  1641.  
  1642.  
  1643.  
  1644. method OrderBy() private
  1645.  iIndexes = int[]
  1646.  iCnter = int
  1647.  iCnter2 = int 1
  1648.  
  1649.  if rCurrentDb = "" then return
  1650.  iIndexes = int[rRecordStr[0,0] + 2]
  1651.  loop iCnter = 1 to rRecordStr[0,0]
  1652.   if (rRecordStr[iCnter, 2]).left(4)="ISAM" then 
  1653.   do
  1654.    iIndexes[iCnter2] = iCnter
  1655.    iCnter2 = iCnter2 + 1
  1656.   end
  1657.  end
  1658.  iIndexes[0] = iCnter2 - 1
  1659.  OrderLayout(iIndexes)
  1660.  
  1661.  
  1662.  
  1663. method DelField() private
  1664.  
  1665.  if rCurrentDb = "" then return
  1666.  DelFieldLayout()
  1667.  
  1668.  
  1669.  
  1670. method ModIdx() private
  1671.  iIndexes = int[]
  1672.  iCnter = int
  1673.  iCnter2 = int 1
  1674.  
  1675.  if rCurrentDb = "" then return
  1676.  iIndexes = int[rRecordStr[0,0] + 2]
  1677.  loop iCnter = 1 to rRecordStr[0,0]
  1678.   iIndexes[iCnter2] = iCnter
  1679.   iCnter2 = iCnter2 + 1
  1680.  end
  1681.  iIndexes[0] = iCnter2 - 1
  1682.  ModIdxLayout(iIndexes)
  1683.  
  1684.  
  1685.  
  1686. method SelectIdx() private
  1687.  rIndexes = Rexx[7]
  1688.  
  1689.  if rCurrentDb = "" then return
  1690.  iOldPage = FieldList.getSelectedIndex() + 1
  1691.  if iOldPage < 1  then return
  1692.  rIndexes[1] = rTXTIdxNONE0
  1693.  rIndexes[2] = rTXTIdxNONE1
  1694.  rIndexes[3] = rTXTIdxISAM00
  1695.  rIndexes[4] = rTXTIdxISAM01
  1696.  rIndexes[5] = rTXTIdxISAM10
  1697.  rIndexes[6] = rTXTIdxISAM11
  1698.  rIndexes[0] = 6
  1699.  SelectIdxLayout(rIndexes)
  1700.  
  1701.  
  1702.  
  1703. method SetThisIdx() private
  1704.  iNotNONE = int 0
  1705.  iCnter = int
  1706.  rSelected = Rexx
  1707.  rTSel = Rexx
  1708.  
  1709.  if rCurrentDb = "" then return
  1710.  iDeleted = FieldList.getSelectedIndex()
  1711.  if iDeleted < 0  then return
  1712.  
  1713.  rTSel = FieldList.getSelectedItem()
  1714.  select
  1715.  when rTSel = rTXTIdxNONE0 then
  1716.   rSelected = "NONE0"
  1717.  when rTSel = rTXTIdxNONE1 then
  1718.   rSelected = "NONE1"
  1719.  when rTSel = rTXTIdxISAM00 then
  1720.   rSelected = "ISAM00"
  1721.  when rTSel = rTXTIdxISAM01 then
  1722.   rSelected = "ISAM01"
  1723.  when rTSel = rTXTIdxISAM10 then
  1724.   rSelected = "ISAM10"
  1725.  when rTSel = rTXTIdxISAM11 then
  1726.   rSelected = "ISAM11"
  1727.  otherwise
  1728.   nop
  1729.  end
  1730.  
  1731.  
  1732.  if  rSelected.left(4) = 'NONE' then
  1733.  do
  1734.   loop iCnter = 1 to rRecordStr[0,0]
  1735.    if (rRecordStr[iCnter, 2]).left(4) \= 'NONE' then
  1736.     iNotNone = iNotNone + 1
  1737.   end
  1738.   if iNotNONE < 2 then
  1739.   do
  1740.    return
  1741.   end
  1742.  end
  1743.  dbMine.modfieldidx(iOldPage, rSelected)
  1744.  dbMine.disconnect()
  1745.  dbMine = null
  1746.  dbMine = RXDbase()
  1747.  dbMine.connect(rCurrentDb)
  1748.  rRecordStr = dbMine.getdbinfo()
  1749.  iIdx=0
  1750.  loop iCnter = 1 to rRecordStr[0,0]
  1751.   if (rRecordStr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  1752.  end
  1753.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1754.  
  1755.  rDbStats = dbMine.getdbstats()
  1756.  this.hide()
  1757.  DbList.clear()
  1758.  DBHeader()
  1759.  DbFill()
  1760.  DbLayout()
  1761.  
  1762.  
  1763.  
  1764. method GotOrder() private
  1765.  iCnter = int
  1766.  
  1767.  iCnter = FieldList.getSelectedIndex()
  1768.  if iCnter < 0 then return
  1769.  
  1770.  /* Now reset the current visualization */
  1771.  iIdx = FieldList.getSelectedIndex() + 1
  1772.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1773.  
  1774.  this.hide()
  1775.  DbList.clear()
  1776.  RecordsLayout()
  1777.  DBHeader()
  1778.  DbFill()
  1779.  
  1780.  
  1781.  
  1782. method SetFirst50() private
  1783.  
  1784.  rShowed = '50'
  1785.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1786.  rDbStats = dbMine.getdbstats()
  1787.  
  1788.  this.hide()
  1789.  DbList.clear()
  1790.  DbLayout()
  1791.  DBHeader()
  1792.  DbFill()
  1793.  
  1794.  
  1795.  
  1796. method SetAllRecords() private
  1797.  
  1798.  rShowed = 'all'
  1799.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1800.  rDbStats = dbMine.getdbstats()
  1801.  
  1802.  this.hide()
  1803.  DbList.clear()
  1804.  DbLayout()
  1805.  DBHeader()
  1806.  DbFill()
  1807.  
  1808.  
  1809.  
  1810. method DeselectAll() private
  1811.  iLines = int[]
  1812.  iFoo = int
  1813.  iCnter = int 1
  1814.  bExit = boolean 0
  1815.  
  1816.  iLines = DBList.getSelectedIndexes()
  1817.  do
  1818.   iFoo = iLines[0]
  1819.  catch ArrayIndexOutOfBoundsException
  1820.   return
  1821.  end
  1822.  
  1823.  loop while bExit = 0
  1824.   iFoo = iLines[iCnter - 1]
  1825.   iCnter = iCnter + 1
  1826.  catch ArrayIndexOutOfBoundsException
  1827.   bExit = 1
  1828.  end
  1829.  
  1830.  this.hide()
  1831.  loop iFoo = 1 to (iCnter-1) /* Records */
  1832.   DBList.deselect(iLines[iFoo-1])
  1833.  end
  1834.  this.show()
  1835.  
  1836.  
  1837.  
  1838. method SelectAll() private
  1839.  iCnter = int
  1840.  iRows = int
  1841.  
  1842.  iRows = DBList.countItems()
  1843.  if iRows > 0 then
  1844.  do
  1845.   this.hide()
  1846.   loop iCnter = 1 to (iRows-1)
  1847.    DBList.select(iCnter)
  1848.   end
  1849.   this.show()
  1850.  end
  1851.  
  1852.  
  1853.  
  1854. method PackIt() private
  1855.  iCnter = int
  1856.  
  1857.  if rCurrentDb = "" then return
  1858.  
  1859.  dbmine.pack()
  1860.  
  1861.  /* Now reset the current visualization */
  1862.  dbMine.disconnect()
  1863.  dbMine = null
  1864.  dbMine = RXDbase()
  1865.  dbMine.connect(rCurrentDb)
  1866.  rRecordStr = dbMine.getdbinfo()
  1867.  iIdx=0
  1868.  loop iCnter = 1 to rRecordStr[0,0]
  1869.   if (rRecordStr[iCnter, 2]).left(4)="ISAM" then iIdx = iCnter
  1870.  end
  1871.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1872.  
  1873.  rDbStats = dbMine.getdbstats()
  1874.  this.hide()
  1875.  DbList.clear()
  1876.  DBHeader()
  1877.  DbFill()
  1878.  DbToolsLayout()
  1879.  
  1880.  
  1881.  
  1882. method SetFilter() private
  1883.  rFArr = Rexx[100]
  1884.  rFilter2 = Rexx
  1885.  rNext = Rexx
  1886.  iCount = int 0
  1887.  
  1888.  rFilter = tfCrName.getText()
  1889.  rFilter2 = rFilter
  1890.  
  1891.  if rFilter \= "" then
  1892.  do
  1893.   loop until rFilter2 = ""
  1894.    iCount =  iCount + 1
  1895.    parse rFilter2 rNext '.&.' rFilter2
  1896.    rFarr[iCount] = rNext
  1897.   end
  1898.   rFarr[0] = iCount
  1899.  end
  1900.  else
  1901.   rFarr[0] = ""
  1902.  
  1903.  dbMine.definefilter(rFarr)
  1904.  
  1905.  rRecArr = dbMine.loadrec(iIdx, rShowed, "1", 1)
  1906.  rDbStats = dbMine.getdbstats()
  1907.  this.hide()
  1908.  DbList.clear()
  1909.  DBHeader()
  1910.  DbFill()
  1911.  RecordsLayout()
  1912.  
  1913.  
  1914.  
  1915. -- The next three routines were coded by Giuseppe Aprile, a RXDbase user.
  1916. -- They convert a .dat file into .dbf and viceversa.
  1917.  
  1918.  method ConvertDbfToDat( FilesIn = Rexx, FilesOut = Rexx) private
  1919.   FilesDbt = Rexx
  1920.   IsDbt = 0
  1921.   astruct = Rexx[7]
  1922.   File1 = RXFile()
  1923.   File2 = RXFile()
  1924.   File3 = RXDbase()
  1925.   File4 = RXFile()
  1926.   File1.stream(FilesIn, "c","open read")
  1927.   bytes = File1.charin(0,32)
  1928.           
  1929.    --  Check the first byte:
  1930.    --     if  =  '3'.x2c()   then it's a .dbf file
  1931.    --     if  =  '83'.x2c()  then it's a .dbf with associated .dbt
  1932.  
  1933.   If bytes.Substr(1,1) <> '3'.d2c() & bytes.Substr(1,1) <> '83'.x2c() then
  1934.     do
  1935.       exit
  1936.     end
  1937.  
  1938.   If  bytes.Substr(1,1) = '83'.x2c() then
  1939.    do
  1940.      FilesDbt = FilesIn.substr(1,FilesIn.length - 4) || '.dbt'
  1941.      If (File2.stream(FilesDbt, "c","query exists")).length() = 0 Then
  1942.         do
  1943.           -- The associated .DBT file does not exist
  1944.           IsDbt = 0
  1945.         end
  1946.       Else
  1947.        do
  1948.  
  1949.         -- Open the associated .dbt file
  1950.  
  1951.         IsDbt = 1
  1952.         File2.stream(FilesDbt, "c","open read")
  1953.  
  1954.         File4.Delete('_$$$.dbt')
  1955.         File4 = null
  1956.         File4 = RXFile()
  1957.         File4.stream('_$$$.dbt', "c", "open write")
  1958.        end
  1959.    end
  1960.   astruct[1] = bytes.substr(2,1)
  1961.   astruct[1] = astruct[1].c2x
  1962.   astruct[1] = astruct[1].x2d           -- Year last updated
  1963.  
  1964.   astruct[2] = bytes.substr(3,1)
  1965.   astruct[2] = astruct[2].c2x
  1966.   astruct[2] = astruct[2].x2d           -- Month last updated
  1967.  
  1968.   astruct[3] = bytes.substr(4,1)
  1969.   astruct[3] = astruct[3].c2x
  1970.   astruct[3] = astruct[3].x2d           -- Day last updated
  1971.  
  1972.   astruct[4] = bytes.substr(5,4).reverse
  1973.   cTemp = ''
  1974.   loop i=1 to 4
  1975.    cTemp = cTemp || aStruct[4].substr(i,1).c2x
  1976.   end
  1977.   astruct[4] = cTemp.x2d               -- Number of records
  1978.  
  1979.   astruct[5] = bytes.substr(9,2).reverse
  1980.   cTemp = ''
  1981.   loop i=1 to 2
  1982.     cTemp = cTemp || aStruct[5].substr(i,1).c2x
  1983.   end
  1984.   astruct[5] = cTemp.x2d              -- Header lenght
  1985.  
  1986.   -- the number of .dbf fields can be obtained by subtracting
  1987.   -- 34 bytes to the header lenght and dividing the result by 32,
  1988.   -- which is the field fixed lenght.
  1989.  
  1990.   nCampi = (aStruct[5]-34) % 32
  1991.  
  1992.   astruct[6] = bytes.substr(11,2).reverse
  1993.   cTemp = ''
  1994.   loop i=1 to 2
  1995.     cTemp = cTemp || aStruct[6].substr(i,1).c2x
  1996.   end
  1997.   astruct[6] = cTemp.x2d              -- Record lenght
  1998.  
  1999.   -- Start reading the field definitions - .dbf structure
  2000.  
  2001.   aTypeField = Rexx[nCampi+1]
  2002.   astructRec = Rexx[nCampi+1,3]
  2003.   rRec = Rexx[nCampi+1,aStruct[4]+1]
  2004.   aStructRec[0,0] = nCampi
  2005.  
  2006.   loop i=1 to nCampi
  2007.     bytes = File1.charin(0,32)
  2008.     cTemp1=bytes.substr(1,11)
  2009.     cTemp2=''
  2010.      loop k=1 to 11
  2011.       if cTemp1.SubStr(k,1) = '0'.d2c then leave
  2012.       cTemp2 = ctemp2 || cTemp1.SubStr(k,1)
  2013.      end
  2014.      aStructRec[i,0] = 0
  2015.      aStructRec[i,1] = cTemp2
  2016.      aStructRec[i,2] = 'NONE0'
  2017.      aTypeField[i] = bytes.substr(12,1)
  2018.      cTemp1=bytes.substr(17,1).c2x.x2d
  2019.      cTemp2=bytes.substr(18,1).c2x.x2d
  2020.      If aTypeField[i] = 'C' & cTemp2 > 0 then
  2021.         do
  2022.          aStructRec[i,0] = cTemp2 * 256 + cTemp1
  2023.         End
  2024.       Else  aStructRec[i,0] = cTemp1              -- (+cTemp2)
  2025.       -- aStructRec[i,0] = cTemp1              -- (+cTemp2)
  2026.   end
  2027.  
  2028.      -- Create  _$$$.dat
  2029.  
  2030.      aStructRec[1,2] = 'ISAM00'   -- index on the first field only
  2031.      File3.Deletedb('_$$$')
  2032.      File3 = null
  2033.      File3 = RXDbase()
  2034.      File3.connect('_$$$',aStructRec)
  2035.  
  2036.     -- Start reading the dbf
  2037.  
  2038.     bytes = File1.charin(0,2)
  2039.  
  2040.     -- Start converting dbf => dat
  2041.  
  2042.     rRec[0,0] = aStruct[4]
  2043.     Loop  i = 1 to aStruct[4]
  2044.        bytes = File1.charin(0,aStruct[6])
  2045.        nPos = 1
  2046.        loop k = 1 to nCampi
  2047.          rRec[k,i] = Bytes.substr(nPos+1,aStructRec[k,0])
  2048.          If aTypeField[k].upper = 'L' then
  2049.             do
  2050.               If rRec[k,i] = ' ' && rRec[k,1] = 'F' then
  2051.                   rRec[k,i] = 'N'
  2052.                   else rRec[k,i] = 'S'
  2053.             end
  2054.          If aTypeField[k].upper = 'M' & IsDbt = 1 then
  2055.             do
  2056.  
  2057.              -- Calculate the memo start point
  2058.  
  2059.              nPosByte = rRec[k,i]  *  512
  2060.  
  2061.              -- move the pointer to nPosByte
  2062.  
  2063.                 File2.stream("c",'seek =1')
  2064.                 File2.charin(0,nPosByte)
  2065.  
  2066.              -- Read the first 512 bytes
  2067.  
  2068.                 bytesDbt = File2.charin(0,512)
  2069.  
  2070.              -- Write a reference to the temporary file
  2071.  
  2072.                 File4.Lineout("Record " i )
  2073.  
  2074.              -- loop if record lenght > 512 bytes
  2075.  
  2076.                 Loop forever
  2077.  
  2078.              -- check for end of record signature (1A Hex)
  2079.  
  2080.                  PosStr = BytesDbt.pos('1A'.x2c)
  2081.                   If PosStr > 0 then
  2082.  
  2083.                      -- End of record signature exists.
  2084.                      -- Write bytes up to the e.o.r.s.
  2085.                      -- Close the loop
  2086.  
  2087.                       do
  2088.                        File4.LineOut(BytesDbt.left(PosStr-1))
  2089.                        leave
  2090.                       end
  2091.                   else
  2092.  
  2093.              -- End of record signature does not exist.
  2094.                      -- Write the bytes read without a CR-LF
  2095.                      -- Read some 512 bytes more
  2096.  
  2097.                       do
  2098.                        File4.CharOut(BytesDbt)
  2099.                        BytesDbt = File2.charin(0,512)
  2100.                       end
  2101.                 End
  2102.             end
  2103.  
  2104.          nPos =  nPos + aStructRec[k,0]
  2105.        End
  2106.     End
  2107.  
  2108.  file3.saverec(rRec,"OVERWRITE")
  2109.  
  2110.  -- Close all open files
  2111.  
  2112.  file3.disconnect()
  2113.  File3 = null
  2114.  File1.Stream("c","close")
  2115.  File1 = null
  2116.  File2.Stream("c","close")
  2117.  File2 = null
  2118.  File4.Stream("c","close")
  2119.  File4 = null
  2120.  
  2121. --  ConvFile = ConnectSave("Pick a name for the db (use no extension)")
  2122.  
  2123.  If FilesOut.Right(4) \= '____'  Then
  2124.     do
  2125.      File4 = RXFile()
  2126.      File4.Rename("_$$$.dat", FilesOut || '.dat')
  2127.      File4.Rename("_$$$1___.idx", FilesOut || '1___.idx')
  2128.      If IsDbt = 1  then
  2129.         do
  2130.     File4.Rename("_$$$.dbt", FilesOut || '.dbt')
  2131.         end
  2132.      File4 = Null
  2133.     end
  2134.  
  2135.  
  2136.  method ConvertDatToDbf( FilesIn = Rexx , FilesOut = Rexx ) private
  2137.   cTemp = Rexx null
  2138.   astruct = Rexx[7]
  2139.   File1 = RXFile()
  2140.   File3 = RXDbase()
  2141.   Header = Rexx
  2142.   RecHeader = Rexx
  2143.   dDate = Date()
  2144.   If FilesIn.lower.right(4) = '.dat' then;
  2145.      FilesIn = FilesIn.Left(FilesIn.Length() - 4 )
  2146.  
  2147.   -- Open .dat file
  2148.   File3.Connect(FilesIn)
  2149.  
  2150.   -- Retrieve .dat file structure
  2151.   rRecStructDat=File3.getdbinfo()
  2152.  
  2153.  
  2154.   -- Retrieve .dat file N.o.R.
  2155.   nRecInDat=File3.getdbstats()
  2156.  
  2157.  
  2158.   -- Declare array structure of the .dbf file
  2159.   rRecStructDbf= Rexx[ rRecStructDat[0,0] + 1 , 5 ]
  2160.   rRecStructDbf[0,0] = 2
  2161.  
  2162.   -- Convert to .dbf file structure
  2163.   nIndex = 0
  2164.   loop i = 1 to rRecStructDat[0,0]
  2165.       if rRecStructDat[i,2].left(4) = 'ISAM' & nIndex = 0 then nIndex = i
  2166.  
  2167.      rRecStructDbf[i,1]= rRecStructDat[i,1].left(10,' ')
  2168.      rRecStructDbf[i,2]= 'C'
  2169.  
  2170.      If rRecStructDat[i,0] < 256 then
  2171.         do
  2172.           rRecStructDbf[i,3]=rRecStructDat[i,0]
  2173.           rRecStructDbf[i,4]=0
  2174.         end
  2175.      else
  2176.         do
  2177.           rRecStructDbf[i,3]= rRecStructDat[i,0] // 256
  2178.           rRecStructDbf[i,4]= rRecStructDat[i,0] % 256
  2179.         end
  2180.   end
  2181.  
  2182.    -- Open/Create the .dbf file
  2183.   File1.Delete(FilesOut)
  2184.   File1 = Null
  2185.   File1=RXFile()
  2186.   File1.stream(FilesOut,"c","open write")
  2187.  
  2188.   -- Creating .dbf  file Header
  2189.  
  2190.    cTemp =  dDate.GetYear()
  2191.    cTemp =  cTemp.d2c()
  2192.    astruct[1] =  cTemp                                -- Year last updated
  2193.  
  2194.    cTemp = dDate.GetMonth() + 1
  2195.    cTemp =  cTemp.d2c()
  2196.    astruct[2] =  cTemp                                -- Month last updated
  2197.  
  2198.    cTemp = dDate.GetDate()
  2199.    cTemp =  cTemp.d2c()
  2200.    astruct[3] =  cTemp                                -- Day last updated
  2201.  
  2202.    cTemp =  nRecInDat[2].d2x(8)
  2203.    cTemp = xtoc(cTemp)
  2204.    cTemp =  cTemp.reverse                             -- Number of records
  2205.    aStruct[4] = cTemp
  2206.  
  2207.  
  2208.    cTemp =  (34 + rRecStructDat[0,0] * 32 ).d2x(4)
  2209.    cTemp = xtoc(cTemp)
  2210.    cTemp =  cTemp.reverse                             -- Header lenght
  2211.     astruct[5] =  cTemp
  2212.  
  2213.   -- Calculating record length
  2214.    nTemp = 0
  2215.  
  2216.    loop i = 1 to rRecStructDat[0,0]
  2217.      If rRecStructDbf[i,4] > 0 then
  2218.         do
  2219.          nTemp = nTemp + rRecstructDbf[i,4] * 256 + rRecStructDbf[i,3]
  2220.         end
  2221.      else
  2222.        do
  2223.         nTemp = nTemp + rRecStructDbf[i,3]
  2224.        end
  2225.  
  2226.    end
  2227.    nTemp = nTemp + 1
  2228.    cTemp =  nTemp.d2x(4)
  2229.    cTemp = xToc(cTemp)
  2230.    cTemp =  cTemp.reverse
  2231.    astruct[6] =   cTemp                       -- Record lenght
  2232.  
  2233.    Header = '3'.d2c || aStruct[1] || aStruct[2] || aStruct[3] || aStruct[4] || aStruct[5] || aStruct[6]
  2234.    cZero = '0'.d2c
  2235.    Header = Header.left(32,cZero)
  2236.  
  2237.    RecHeader = ''
  2238.  
  2239.    loop i = 1 to rRecStructDat[0,0]
  2240.      cTemp = rRecStructDbf[i,1] || '0'.d2c
  2241.      RecHeader = RecHeader || cTemp
  2242.      cTemp =  rRecStructDbf[i,2].left(5,cZero)
  2243.      RecHeader = RecHeader || cTemp
  2244.      cTemp =  rRecStructDbf[i,3].d2c
  2245.      RecHeader = RecHeader || cTemp
  2246.      cTemp = rRecStructDbf[i,4].d2c
  2247.      RecHeader = RecHeader || cTemp.Left(15,cZero)
  2248.      cTemp = Null
  2249.    end
  2250.  
  2251.    RecHeader = RecHeader || '13'.d2c || '0'.d2c
  2252.  
  2253.    File1.CharOut(Header)
  2254.    File1.CharOut(RecHeader)
  2255.  
  2256.     -- Loading .dat file records
  2257.  
  2258.      File3.disconnect()
  2259.      File3=Null
  2260.      File3=RXDbase()
  2261.      File3.connect(FilesIn)
  2262.  
  2263.      rRec = File3.loadrec(nIndex, 'all', "1", 1)
  2264.  
  2265.      loop i = 1 to rRec[0,0]
  2266.       cTemp = ' '
  2267.  
  2268.       loop k = 1 to rRecStructDat[0,0]
  2269.        cTemp = cTemp || rRec[k,i]
  2270.       end
  2271.  
  2272.       File1.CharOut(cTemp)
  2273.  
  2274.      end
  2275.  
  2276.       -- Writing End of file signature
  2277.       File1.CharOut('26'.d2c)
  2278.  
  2279.       -- Close all open files
  2280.       file3.disconnect()
  2281.       file3 = null
  2282.  
  2283.       File1.stream("c","close")
  2284.       File1 = Null
  2285.  
  2286. -- Method xToc(InByte = Rexx)
  2287. --
  2288. -- This function derived from the x2c method of the xstring class published
  2289. -- by P.A. Marchesini under the GNU General Public License of the Free
  2290. -- Software Foundation
  2291. --
  2292.  
  2293. method xToc(InByte = Rexx)
  2294.  RetVal = ''
  2295.  loop while InByte <> ''
  2296.    parse InByte ch +2 InByte
  2297.    RetVal = RetVal || ch.x2c()
  2298.  end
  2299.  return RetVal
  2300.  
  2301.  
  2302. method DATtoDBF
  2303.  OpenFileDialog = FileDialog(this, rTXTChoose)
  2304.  OpenFileDialog2 = FileDialog(this, rTXTChooseDBF)
  2305.  InFile = Rexx
  2306.  OutFile = Rexx
  2307.  rStdString = Rexx"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
  2308.  File1 = RXFile()
  2309.  
  2310.  DbList.clear()
  2311.  DbList.reshape(0, 0, (fm.stringWidth(rStdString) * 4) % 1, fm.getHeight() * (5));
  2312.  dbMine.disconnect()
  2313.  dbMine = null
  2314.  dbMine = RXDbase()
  2315.  
  2316.  OpenFileDialog.show()
  2317.  if OpenFileDialog.getFile = null then 
  2318.  do
  2319.   DbList.addItem(rTXTFileNotPresent)
  2320.   return
  2321.  end
  2322.  InFile = OpenFileDialog.getFile
  2323.  
  2324.  if (InFile.right(4, ' ')).upper() \= '.DAT' then
  2325.   InFile = InFile || ".dat"
  2326.  if (File1.stream(InFile, "c", "query exists")).length() = 0 then
  2327.  do
  2328.   DbList.addItem(rTXTFileNotPresent)
  2329.   return
  2330.  end
  2331.  
  2332.  OpenFileDialog2.show()
  2333.  if OpenFileDialog2.getFile = null then
  2334.  do
  2335.   DbList.addItem(rTXTFileNotPresent)
  2336.   return
  2337.  end
  2338.  OutFile = OpenFileDialog2.getFile
  2339.  
  2340.  if (OutFile.right(4, ' ')).upper() \= '.DBF' then
  2341.   OutFile = OutFile || ".dbf"
  2342.  
  2343.  DbList.addItem(InFile"-->"OutFile)
  2344.  DbList.reshape(0, 0, (fm.stringWidth(DbList.getItem(DbList.countItems() - 1)) * 4) % 1, fm.getHeight() * (5));
  2345.  
  2346.  ConvertDatToDbf(InFile, OutFile)
  2347.  
  2348.  DBList.addItem(rTXTEnd)
  2349.  
  2350.  
  2351. method DBFtoDAT
  2352.  OpenFileDialog = FileDialog(this, rTXTChooseDBF)
  2353.  OpenFileDialog2 = FileDialog(this, rTXTChoose)
  2354.  InFile = Rexx
  2355.  OutFile = Rexx
  2356.  rStdString = Rexx"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
  2357.  File1 = RXFile()
  2358.  
  2359.  DbList.clear()
  2360.  DbList.reshape(0, 0, (fm.stringWidth(rStdString) * 4) % 1, fm.getHeight() * (5));
  2361.  dbMine.disconnect()
  2362.  dbMine = null
  2363.  dbMine = RXDbase()
  2364.  
  2365.  OpenFileDialog.show()
  2366.  if OpenFileDialog.getFile = null then 
  2367.  do
  2368.   DbList.addItem(rTXTFileNotPresent)
  2369.   return
  2370.  end
  2371.  InFile = OpenFileDialog.getFile
  2372.  
  2373.  if (InFile.right(4, ' ')).upper() \= '.DBF' then
  2374.   InFile = InFile || ".dbf"
  2375.  if (File1.stream(InFile, "c", "query exists")).length() = 0 then
  2376.  do
  2377.   DbList.addItem(rTXTFileNotPresent)
  2378.   return
  2379.  end
  2380.  
  2381.  OpenFileDialog2.show()
  2382.  if OpenFileDialog2.getFile = null then
  2383.  do
  2384.   DbList.addItem(rTXTFileNotPresent)
  2385.   return
  2386.  end
  2387.  
  2388.  OutFile = OpenFileDialog2.getFile
  2389.  
  2390.  if (OutFile.right(4, ' ')).upper() \= '.DAT' then 
  2391.   OutFile = OutFile || ".dat"
  2392.  
  2393.  DbList.addItem(InFile"-->"OutFile)
  2394.  
  2395.  ConvertDbfToDat(InFile, OutFile.left(OutFile.length - 4))
  2396.  
  2397.  DBList.addItem(rTXTEnd)
  2398.  
  2399.  
  2400.  
  2401.