topic
stringlengths
1
63
text
stringlengths
1
577k
A Colorpicker and RGB-tools
Uwe, How would you suggest to have my own colors into the colorbrowser instead of Metro ? Change the Arraydata or make a browse for it?
A Colorpicker and RGB-tools
Marc, if You don't need the metro-colors, just replace the array. Using more colors, add a scrollbar to the browser or use 2 color-cells next to each other. regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Ok, One question. In you small colorpicker (to pic from pictures, If you press ex. SPACE it save to the file. Could you update the file to include the HEX code? and at the same time, the hex code need to go to the clipboard , so I can paste it in a field. Thanks.
A Colorpicker and RGB-tools
Marc, a ALLINONE solution with included picker and a new array-style of METRO-colors Maybe You can find something usefull. the download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Colorpick4.zip">http://www.pflegeplus.com/DOWNLOADS/Colorpick4.zip</a><!-- m --> [img:1ellvv18]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick4&#46;jpg[/img:1ellvv18] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Uwe, Thank you very much for your time !! This solution works great for me. Marc
A Colorpicker and RGB-tools
Marc, my extended version It is possible now to display the colorpicker inside a second dialog connected to dialog one. Because of the timer only this little area will be refreshed. As well it is possible to change the background from red to green if enabled. A switchfunction is added ( no resize needed ) I added the brightness-selector again because I need it for my gradient defines. A new config-section is included All color / brush selections are saved to a INI as well <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Rgbtools4.zip">http://www.pflegeplus.com/DOWNLOADS/Rgbtools4.zip</a><!-- m --> [img:1exlkc7h]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick10&#46;jpg[/img:1exlkc7h] [img:1exlkc7h]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick11&#46;jpg[/img:1exlkc7h] resized dialog on radio-selection [img:1exlkc7h]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick12&#46;jpg[/img:1exlkc7h] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Nice, Is the colorpicker always ONTOP on your end? Here it is gone to back. In the small colorpicker, in the config (project) section you could consider to have the Xbrowse let select multiple rows to delete at once. No you delete 1, and the buttun has focus, so you can't easily delete several records fast. Marc
A Colorpicker and RGB-tools
Marc, have a look at Your emails. [quote:2ofcwlms]Is the colorpicker always ONTOP on your end? Here it is gone to back.[/quote:2ofcwlms] It works perfect now : You can switch between < stay on top > or < go to the taskbar > on focus-change [img:2ofcwlms]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick13&#46;jpg[/img:2ofcwlms] [color=#0000FF:2ofcwlms]STATIC nOntop := 1 LOCAL oOnTop [/color:2ofcwlms] Add 2 radios [color=#0000FF:2ofcwlms]REDEFINE RADIO oOntop VAR nOntop ID 610, 611 OF oDlgMain UPDATE ; ON CHANGE IIF( nOntop = 1, SetWindowPos( oDlgMain:hWnd, -1, 0, 0, 0, 0, 3 ), ; // On Top SetWindowPos( oDlgMain:hWnd, -2, 0, 0, 0, 0, 3 ) ) AEval( oOntop:aItems, { | oRad | oRad:lTransparent := .T., ; oRad:SetFont ( oFont1 ), ; oRad:nClrText := nDTxtColor } )[/color:2ofcwlms] Just add to ON INIT of oDlgMain the following line all other top-defines You can delete ACTIVATE DIALOG oDlgMain CENTERED ; ON INIT ( [color=#0000FF:2ofcwlms][b:2ofcwlms]IIF( nOntop = 1, SetWindowPos( oDlgMain:hWnd, -1, 0, 0, 0, 0, 3 ), NIL ), ;[/b:2ofcwlms][/color:2ofcwlms] // On Top defined in INI ... ... add in Function GET_INI() [color=#0000FF:2ofcwlms]nOntop := Val(GetPvProfString( "RGB", "On top", "1" , cIniFile ) )[/color:2ofcwlms] and in function SAVE_INI() [color=#0000FF:2ofcwlms]WritePProString( "RGB", "On top", ALLTRIM(STR(nOntop)), cIniFile ) [/color:2ofcwlms] don't forget to add the radios in RGB.RC !!! regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Thanks. Will make the changes.
A Colorpicker and RGB-tools
The Colorpicker / RGB-tool with a new optic and many new functions 1. changed from INI to DBF to save colors to a project 2. added color-selection ( 10 colors ) to add to a project 3. new factor for monitor-scale adjustment 4. a new tool-section to define a button-group ( color and gradient ) 5. a new xBrowse-section to define row-colors [img:3p668300]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick1&#46;jpg[/img:3p668300] [img:3p668300]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick2&#46;jpg[/img:3p668300] [img:3p668300]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick3&#46;jpg[/img:3p668300] [img:3p668300]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick4&#46;jpg[/img:3p668300] <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Rgbtools1.zip">http://www.pflegeplus.com/DOWNLOADS/Rgbtools1.zip</a><!-- m --> regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Small Issue when I click image : Application =========== Path and name: C:\fwh1705\samples\uwebrowse\RGB.exe (32 bits) Size: 3,812,864 bytes Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20170902) FiveWin version: FWHX 17.11 C compiler version: Borland/Embarcadero C++ 7.3 (32-bit) Windows version: 6.1, Build 7600 Time from start: 0 hours 0 mins 1 secs Error occurred at: 12/04/17, 13:55:05 Error description: Error BASE/1003 Variable does not exist: OSFONT Stack Calls =========== Called from: .\RGB.PRG => FROM_BMP( 906 ) Called from: .\RGB.PRG => (b)MAIN( 244 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 684 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 924 ) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 ) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1873 ) Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 ) Called from: => DIALOGBOX( 0 ) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 ) Called from: .\RGB.PRG => MAIN( 351 )
A Colorpicker and RGB-tools
Fixed ( wrong font ) more new ideas are welcome <!-- s:idea: --><img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea" /><!-- s:idea: --> with the colorpicker You can select a color from a image. Move the dialog to the side to view the covered values. With a hotkey You can save the values to the clipboard. To use the 10 color-buttons ( green 1 - 10 ) You must switch the colorpicker OFF and select one of the predefined colors from the browsers. [img:7ifexlyj]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick5&#46;jpg[/img:7ifexlyj] with the tool-section You can work from inside Your editor. That makes the button-design and xBrowse-row color defines easy. Just copy / paste the color defines after You finished Your design. A click of one of the 10 buttons opens a dialog with the full button-code. [img:7ifexlyj]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Edit1&#46;jpg[/img:7ifexlyj] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Some improvements It is possible to define and save the 10 projectcolors. The fieldlength of RGB-text changed to 22 [img:2pqye9yu]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colpick6&#46;jpg[/img:2pqye9yu] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
[quote="Marc Venken":1pnthcmv][img:1pnthcmv]http&#58;//www&#46;maveco&#46;be/fivewin/uwe1&#46;jpg[/img:1pnthcmv] Left top is the browse with 1 product selected and adding all the colors I want. Left bottom = list off all colors available as tekst ( "Red,Green,Blue,...") // data from brands csv files for import in shopcarts. 2 imgs : only for visable reference. Right browse (left side, the sweaters) are all colorpics of the products itself. Right browse (colors) are color jpg files that are sometimes provided from the Brands (mostly not and therefore I need colorpicker. So, The purpose : (filling a prestashop shopcard by import and direct database filling) We have more that 100.000 products from 40/50 brands. Ofthen they have a csv file and a bunch of foto's. They have to be combined manualy, since they don't provide allways the correct name (dbf and jpg). That is what I do above. Finaly i have to choose that I put a HEX code as color's or a file. The HEX is still the problem. If I however create a dbf with your Pickcolor program, then I call your dbf also, and pass the HEX code to my files. Or as you suggest, Your Color Picker/Manager will make color swap tables for each Brand, and I keep it open for selecting in my App. So your database should be able to show only 1 brand, like it does now with the METRO colors and your browse showse only the brand. I select from your program, it is stored inside memory and I copy/past to my app. Seemse to work ok then. So you have a idea of what I'm doing.[/quote:1pnthcmv] marc you colorize each tshirt ? and How ?
A Colorpicker and RGB-tools
Silvio, I receive them from the manufacturer. I have nothing to do about it. Marc
A Colorpicker and RGB-tools
changes : xbrowsetitles ( headers ) are deleted inside the maindialog to reduce the size. new : Now it is possible to create Your own colorcharts. With the button < Colorset > from the main-dialog You can select up to 10 colors from a image inside a second dialog and save them to a project. A colorchart can be any image : a photo, a chart from the internet, alphablended logo .... usage : 1. activate the colorpicker from the main-dialog. 2. choose the button < colorset > 3. create a new set ( image select ) or select a existing one. 4. select the radio where You want to save the color 5. click inside the image to save the color to the defined position. 6. with a right mouseclick on the second browser column, this set will --be selected at startup changing the radio, the color-values are shown at the bottom of the dialog. 7. optional < save to project > Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip">http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip</a><!-- m --> sample a colorwheel from the internet [img:32d4ckxf]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick6&#46;jpg[/img:32d4ckxf] colors selected from a photo [img:32d4ckxf]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick6a&#46;jpg[/img:32d4ckxf] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Very Nice en usefull for my project, but I have a other challenge <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> I think many users could benifit from the folowing : (Maybe it can even be done, but then I already say sorry.. If you take the new colorset, and add more definable colors 1 to 10 become 1 to XX (In my case some times 45) I have 45 colors T-shirts from the brand Gildan. 1. Or Drag and Drop eacht color (Image Tshirt) into your dialog for selecting the color 2. Or Let the Colorpicker be able to select the color from all screen positions (You have done that before) Then build a colorsheme from all colors until done and save the file with the colors (Is done now also) Then be able to have the colors (named ex. Gildan) into a XBrowse for selection with the code (Hex, Rgb, ....) Here I think of being able to chose the colorsheme and show It in the master colordialog. As example that the browse with the METRO colors will be replaced the the selected colors (GILDAN). Almost all of this is done. You could have a Tool that is very usefull for all people that need colors in WebShop product management. You asked for Ideas, This was mine .... If you are not all clear of what I mean, I would be glad to give a flow of all actions.
A Colorpicker and RGB-tools
Marc, good suggestions. [quote:jqpluvkr]If you take the new colorset, and add more definable colors 1 to 10 become 1 to XX (In my case some times 45)[/quote:jqpluvkr] instead of 10 fixed colors I will add another browser with unlimited colors on top of the chart-dialog 6 fields --> [color=#0000FF:jqpluvkr]projectname - chart-image - color - dec - rgb - hex[/color:jqpluvkr] ----------------- project ------ image --- cellcolor ---- values I think a print-function of a colorset ( report ) would be useful <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> I like creating this kind of tools <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
But the chart image, will be different than your approuch. There is no 1 image where all colors exist, because the colors will come from all kind of pictures, but you can keep that field. If you have that browse, Is it then easy to make that you can have that data in stead of the data from METRO ? Marc
A Colorpicker and RGB-tools
The goal : [img:n5994myt]http&#58;//www&#46;maveco&#46;be/fivewin/uwe2&#46;jpg[/img:n5994myt] A Brand give all images of products and a exel file with product data. We select the data that we want in our shop We than browse (fivewin) this data in order to see the pictures and product colors (this is a the product in 1 color) WE NEED to have the color (HEX) in order to have the small color icons on the right, and that is where your tool become handy !!! We copy paste the code from Colorpic into our own browse (webshop) and de colors apear into the shop. In the sample above, not all colors are defined with the HEX code, but the pictures are there if you click on them.
A Colorpicker and RGB-tools
Marc, with this first idea You can collect colors from different images The 10 fixed colors are replaced with a browser [img:ujp4eoxm]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker1&#46;jpg[/img:ujp4eoxm]
A Colorpicker and RGB-tools
Maybe you can also drag and drop images into the project?
A Colorpicker and RGB-tools
The first tests adding colors from different sets to a project. With the replaced radios a project is not limited to 10 like before ( browser with color preview ) Project < Test 1 > uses colors from different charts or photos. The button < New > adds a new record using the project-name of the selected row. Clicking inside the image, the name of the chart is added together with the colorvalue. The button < Pack > is used for both dbf's You can copy the color-values from the new browser ( edit cells ). The image of the colorset keeps the aspect ratio. I added a colorcounter to the project ( index on project + number ) Now You can define the order how to show the colors. Export to EXCEL needed <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> At the end I will define a language-file <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: --> Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip">http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip</a><!-- m --> [img:2670lk5a]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker2&#46;jpg[/img:2670lk5a] regrds Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Almost done !! Great. There is a error on saving : Error description: Error DBFCDX/1020 Data type error: VALRGB2 Stack Calls =========== Called from: .\RGB.PRG => SAVE_CGRP( 1498 ) Called from: .\RGB.PRG => (b)FROM_BMP( 980 ) And how to get a new file fast into the dialog ? Drag and drop ? Is it possible that the colorpicker can get the values anywhere on the screen en not just in the second dialog ?
A Colorpicker and RGB-tools
Marc, The button < save to project > belongs to the old fixed 10 color solution. I deleted this option as well the 10 colorpage from the setup-section. Sure we can save a color from the desktop ( not only from dialog two ) Maybe a switch is needed ( select from dialog or from desktop ) As well a resizebutton will be added to dialog two that only the small projectbrowser will be visible together with the small colorpicker dialog. regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Many new functions added. There is a new autosave-option. How it works : Select a startposition from inside the projectbrowser The hotkey will do a autoappend saving the projectname + the selected numer[color=#0000FF:jbslmsct][b:jbslmsct] + 1[/b:jbslmsct][/color:jbslmsct] and the colorvalues. No need to add a new record before selecting a new color. A xbrowse seekfield is added ( index on projectname + number ). With the radios, You can do a quick resize of the project-dialog ( same like the color-picker ). Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip">http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip</a><!-- m --> usage from inside a image-browser ( [color=#0000FF:jbslmsct][b:jbslmsct]xNView[/b:jbslmsct][/color:jbslmsct] ) With [color=#0000FF:jbslmsct][b:jbslmsct]xNView[/b:jbslmsct][/color:jbslmsct] You can define the thumbnail-size before starting to pick colors. [img:jbslmsct]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker3&#46;jpg[/img:jbslmsct] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Changed the project-section to collect colors. Now there is a better overview ( 19 colors ). To save space, You can select the browser-column -> Dec, RGB or Hex Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip">http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip</a><!-- m --> [img:1l5i1o9c]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker4&#46;jpg[/img:1l5i1o9c] I'm still testing the relation between the project-browser and the color-collector There is a index on < project + object + number > The project-name will be the company-name and the project-image could be a logo. The colorlist will show the different object-names with a running number the color and the value. [img:1l5i1o9c]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker5&#46;jpg[/img:1l5i1o9c] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Added the projectfilter to the browser Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip">http://www.pflegeplus.com/DOWNLOAD/Colorpick6.zip</a><!-- m --> [img:2fgq3nxf]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/CPicker6&#46;jpg[/img:2fgq3nxf] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A Colorpicker and RGB-tools
Very nice work. Will try it out.
A Complete List of Windows Development Tools
Good morning, list of development tolos [url:156d6rf0]http&#58;//scottge&#46;net/2015/07/17/a-complete-list-of-windows-development-tools/[/url:156d6rf0] Regards
A Conversation With Sergey Brin And Eric Schmidt
[url:2mt3h4lj]http&#58;//www&#46;techcrunch&#46;com/2009/10/07/a-conversation-with-sergey-brin/[/url:2mt3h4lj]
A Database Design Question
Hi all, I am debating with myself (surely a sign of madness) over a design question to do with an evolving medical application. There is a patient file with details of all the patients. I have created a doctor table for doctors who send patients to the clinic. But they can be patients also. I also need to store info on the doctors that work at the clinic. I am thinking that maybe I should make the patient file effectively a people file and use flags to indicate whether a person is also a doctor and or is a staff member and then use indexes to enable queries on doctors or staff doctors etc to proceed nearly as quickly as if they were in separate tables. My index count will go up by 2 so time to add a patient will increase slightly. Some questions: Can I conditionally add records to an index? It would be wonderful if a person record that will only function as a patient could just update the appropriate indexes (primary key, name, date of birth) whilst a person record marked as a doctor could also add to the index of doctors, and similarly for a staff member. Has anyone implemented a design like this I wonder? Any thoughts you may have would be appreciated. Regards xProgrammer
A Database Design Question
[quote:19grwm8t]I am thinking that maybe I should make the patient file effectively a people file and use flags to indicate whether a person is also a doctor and or is a staff member and then use indexes to enable queries on doctors or staff doctors etc to proceed nearly as quickly as if they were in separate tables[/quote:19grwm8t] This would be my personal approach too. [quote:19grwm8t]Can I conditionally add records to an index? It would be wonderful if a person record that will only function as a patient could just update the appropriate indexes (primary key, name, date of birth) whilst a person record marked as a doctor could also add to the index of doctors, and similarly for a staff member.[/quote:19grwm8t] Conditional indexes are possible in RDDs like DBFCDX. Personally I advice not to do conditional indexes. Does not really save time. Conditional indexes are not used for optimization. In case of RDMS use WHERE clause and in case of RDD use filters ( optimized )
A Database Design Question
Thanks for your advice. If updating the extra indexes doesn't impact much on performance then I can do all the "filtering" by including the flag in an index. If, for example, I have an IsDoctor field which say contains a "D" for a doctor and " " otherwise then to get all doctors named "Smith" I just have to search on "DSMITH" given that I maintain an index on Upper( IsDoctor + Surname). It is an approach I have thought about a number of times but never implemented to date. Regards xProgrammer
A Database Design Question
I am sure you thought about protection. I report this because I read last week in our newspapers about a scandal that in one of our clinics doctors and stuff members looked up other doctors and stuff members folders. Best regards, Otto [url:1cefaw7d]http&#58;//tt&#46;com/csp/cms/sites/tt/Nachrichten/325026-6/kollegen-in-klinik-ausspioniert&#46;csp[/url:1cefaw7d]
A Database Design Question
You are describing the concept of roles. A person may have one or more roles; patient, doctor, dept head, vendor, etc. Using OOP you can create a classes that automatically handle this. These classes would also insulate the rest of your code from the actual databases so you could change the configuration of the databases later without breaking all your existing code. There is a good discussion of roles in the book "Business Engineering With Object Technology." There is link to it on my website here [url:1q620607]http&#58;//www&#46;gointellitech&#46;com/program&#46;htm[/url:1q620607] I'm sure you can also Google "OOP roles" and find more information about roles. Regards, James
A Database Design Question
Hi Otto Nice to hear from you. An important issue that needs careful handling. In an emergency information may need to be accessed that would contravene what would normally be available to a doctor. My best way around this is to allow access after a screen that warns that if you continue your access will be recorded and checked. Regards Doug
A Database Design Question
Hi James Yes, reading about roles is probably one of the antecedents of the idea. Pretty much all my code is OO. My code generator is OO and generates OO code. Although, at this stage, it could be held that the templates that the generator generates from are not. To give some idea, my application includes the following classes dealing with a patient: PatientList PatientListScreen which inherits from TListScreen which inherits from TScreen PatientSearchByName and PatientSearchByDOB both of which Inherit from TSearchScreen which inherits from TScreen Patient which inherits from TSingleItem PatientKeySearch which inherits from TKeySearchScreen which inherits from TScreen PatientViewEditScreen which inherits from TViewEditScreen which inherits from TScreen Note: these are all generated from a design template in xml. TSingleItem is quite useful. You would think there should be a matching TListOfItems class but in practice there doesn't seem to be much, if anything, it could contribute. TSingleItem handles some of the "standard" fields I use, as well as understanding primary key field. I have an active flag, as well as recording when the record was last updated, by what user, and what they did (insert or update) for all data tables. Regards Doug
A Database Design Question
regarding data security, you have to encrypt/decrypt your informations with different keys! Don't use other technologies, e.g. roles or other, for this purpose, they are not safe. For example: For an admin it's normally not a big problem to get the Master-role, but if he hasn't the suitable decryption keys, he has NO chance to get the datas! On the other hand, it's very easy and performant to work with roles, e.g. we have a big (Lotus Notes) database with CRM datas. The sales staff which is responsible for one region, 'see' and replicate only the documents of his region and not all the others! But (of course) the database itself is encrypted when it resides on local machines and the data traffic over the internet (replication port) is encrypted too.
A FREE ! converter from PNG ICO .. to BMP (Alpha-Channel)
Hello,after long searching and testing in the internet,i found a tool ( freeware ) to convert any PNG, ICO, GIF ...to BMP ( keeping the Alpha-Channel ). I don't want to use Photoshop ( to much work )[img:xq7qpbsg]http&#58;//www&#46;pflegeplus&#46;com/pictures/alpha1&#46;jpg[/img:xq7qpbsg]DEFINE BITMAP oNewBrush1 FILENAME "test.bmp"ABPaint( hDC, 0, -10, oNewBrush1:hBitmap, 255 ) // 0-255 transparency levelI tested many Applications.After converting from PNG to BMP, there was no Alpha-Channel.Now i found a working one with export PNG to Transparent BMP :<!-- m --><a class="postlink" href="http://icofx.ro/">http://icofx.ro/</a><!-- m -->[img:xq7qpbsg]http&#58;//www&#46;pflegeplus&#46;com/pictures/alpha5&#46;jpg[/img:xq7qpbsg]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A FREE ! converter from PNG ICO .. to BMP (Alpha-Channel)
The Gimp, wich is free and Open Source, can be used to transform PNG to 32 bits BMPs. Just load the PNG and use 'Save As' .. 32 bit bmp.Regards,Carlos.
A FREE ! converter from PNG ICO .. to BMP (Alpha-Channel)
Carlos,I agree, Gimp is excellent! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
A FREE ! converter from PNG ICO .. to BMP (Alpha-Channel)
Thank you very much for the information,I heard about GIMP, but didn't test it.I opened a ICO and PNG- file and saved them as BMP with Alpha-Channel with a good quality.It is a good solution, to export quickly ICO and PNG to BMP.RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A Few question about XBrowse.
Hi,1) I want to select a row with enter key. How Can I? I can do it with double click.2) I have added a button to sample (thanks to nageswaragunupudi) below. Before than I can use the XBrowse object as a default, but after added the button in order to choice from xbrowse i must select it. I wrote the oBrw:SetFocus() on Dialog ON INIT. It did not change anything. How can i focus the XBrowse when i activate the dialog.Thanks, [code:v45c52jl] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' REQUEST DBFCDX function Main&#40;&#41; local oDlg, oBrw local oSeek, cSeek &#58;= Space&#40;25&#41; USE CUSTOMER NEW ALIAS CUST SHARED VIA 'DBFCDX' SET ORDER TO TAG SALARY GO TOP DEFINE DIALOG oDlg SIZE 540,480 PIXEL @ 10, 10 XBROWSE oBrw ; COLUMNS 'First','Last','Salary' ; SIZE 250,200 PIXEL ; OF oDlg ; ALIAS 'CUST' ; AUTOSORT @ 220, 10 SAY oSeek VAR cSeek SIZE 100,10 PIXEL OF oDlg ; COLOR CLR_BLACK, CLR_YELLOW @ 220, 210 BUTTON "&OK" PIXEL OF oDlg oBrw&#58;bSeek &#58;= &#123; |cSeek| CUST->&#40; DbSeek&#40; Val&#40; cSeek &#41;, &#46;t&#46; &#41;, !eof&#40;&#41; &#41; &#125; oBrw&#58;oSeek &#58;= oSeek oBrw&#58;CreateFromCode&#40;&#41; ACTIVATE DIALOG oDlg CENTERED on INIT oBrw&#58;SetFocus&#40;&#41; return nil [/code:v45c52jl]
A Few question about XBrowse.
If you want to show a picklist from a dbf ( or any source ) for selection, Xbrowse provides a very simple one line code. Please compile the following sample[code:1vy05n8e] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' function main&#40;&#41; local cState &#58;= Space&#40; 2 &#41; USE STATES NEW SHARED XBROWSER 'STATES' SELECT &#40; cState &#58;= STATES->Code &#41; if Empty&#40; cState &#41; MsgInfo&#40; 'Not Selected' &#41; else MsgInfo&#40; 'Selected ' + cState &#41; endif return nil [/code:1vy05n8e]The one line code "XBROWSER 'STATES' SELECT ( cState := STATES->Code )" displays States in a suitably sized xbrowse dialog with "select" button. If the button is clicked the selection is made.
A Few question about XBrowse.
Here is a screen shot of what the above one line of code can produce[url=http&#58;//img371&#46;imageshack&#46;us/my&#46;php?image=xbrselvh5&#46;jpg:1ycg2ukj][img:1ycg2ukj]http&#58;//img371&#46;imageshack&#46;us/img371/4985/xbrselvh5&#46;th&#46;jpg[/img:1ycg2ukj][/url:1ycg2ukj]
A Few question about XBrowse.
Thanks nageswaragunupudi.But I could not find any documentation about XBROWSER. I could not compile the code you have given. does XBROWSER support the bSeek Method?
A Few question about XBrowse.
This requires FWH 8.08. Please read whatsnew.txt
A Few question about XBrowse.
Hmmm. I think I should upgrade the FWH.Just one question. How Can I detect ENTER key and assign a procedure?Thanks,
A Few question about XBrowse.
Try this :[code:936xcbi0] ** this browse for detail invoice @145,2 XBROWSE oBrw1 ; COLUMNS "DI_ITMABV" ,; "DI_MUNITS" ,; "DI_SALEPRC" ,; "DI_UNTPRC" ,; "DI_INVQTY" ,; "DI_DISCNT" ,; "DI_EXTDAMT" ; OF oDlg ; SIZE 390,75 PIXEL ; PICTURE "@!","@!","9999&#46;99","9999&#46;99","9999&#46;99","99&#46;99%","9999&#46;999" ; COLSIZES 270,50,80,80,80,80,80 ; HEADERS "Item Description",; "Unit",; "Default Price",; "Sale Price",; "Quantity",; "Discount",; "Amount" ; ALIAS "dinvoice" oBrw1&#58;bKeyDown &#58;= &#123; |nKey,nFlag| DetailAction&#40;nKey,oBrw1&#41; &#125; if ! Empty&#40; oCol &#58;= oBrw1&#58;aCols&#91;4&#93; &#41; // Price oCol&#58;nEditType &#58;= EDIT_GET oCol&#58;bOnPostEdit &#58;= &#123;| o, u, n| PostEditDetail&#40; o, u, n &#41; &#125; endif if ! Empty&#40; oCol &#58;= oBrw1&#58;aCols&#91;5&#93; &#41; // Quantity oCol&#58;nEditType &#58;= EDIT_GET oCol&#58;bOnPostEdit &#58;= &#123;| o, u, n| PostEditDetail&#40; o, u, n &#41; &#125; endif if ! Empty&#40; oCol &#58;= oBrw1&#58;aCols&#91;6&#93; &#41; // Discount oCol&#58;nEditType &#58;= EDIT_GET oCol&#58;bOnPostEdit &#58;= &#123;| o, u, n| PostEditDetail&#40; o, u, n &#41; &#125; endif XbrStyles&#40; oBrw1 &#41; oBrw1&#58;CreateFromCode&#40;&#41; ************** create this function static function PostEditDetail&#40; oCol, xValue, nLastKey &#41; local nOldVal, nFldNo,nCol &#58;= oCol&#58;nPos local cAlias &#58;= oCol&#58;oBrw&#58;cAlias if nLastKey == 13 // this is enter nOldVal &#58;= Eval&#40; oCol&#58;bEditValue &#41; if !&#40; nOldVal == xValue &#41; if dinvoice->&#40;dbrLock&#40;&#41;&#41; do case case nCol == 4 // price dinvoice->DI_UNTPRC &#58;= xValue case nCol == 5 // quantity dinvoice->DI_INVQTY &#58;= xValue case nCol == 6 // discount dinvoice->DI_DISCNT &#58;= xValue endcase nHarga &#58;= dinvoice->DI_UNTPRC * dinvoice->DI_INVQTY nDisc &#58;= 0 if dinvoice->DI_DISCNT # 0 nDisc &#58;= nHarga * &#40; dinvoice->DI_DISCNT / 100 &#41; endif nTotal &#58;= nHarga - nDisc dinvoice->DI_EXTDAMT &#58;= nTotal dinvoice->&#40; dbUnlock&#40;&#41; &#41; SumTotalHeader&#40;&#41; endif endif oCol&#58;oBrw&#58;goRight&#40;&#41; endif return nil [/code:936xcbi0]Best RegardsFafi
A Few question about XBrowse.
Thank you for your reply Fafi. But I use xbrowse as a picklist. I do not edit any field in the xbrowse. I only want to select the row.I'll try to use the code you posted. thanks again.
A Few question about XBrowse.
Hakan,>How Can I detect ENTER key and assign a procedure? Add the DEFAULT clause to your button definition.Regards,James
A Few question about XBrowse.
Thanks James,There are two condition.1) There is a button and default.2) There is not button.1) if i add the button, user should focus the xbrowse and than choice the desired row and press ENTER to select. It is not usable for user.2) if i did not add the button, xbrowse is default. it is ok. user can choice the row and ENTER to select. I need the 2. condition now. I have not any button. I need the select enter key like ON DBLCLICK.Thanks,
A Few question about XBrowse.
Without a button try: oBrw:bKeydown := {|nKey,nFlags| ; IIF(nKey == VK_RETURN, doWhatever(), oDlg:end(),)}
A Few question about XBrowse.
James,A little typo in your code: the dialog should be closed when enter is pressed. Edited: ops, no its a missing "(" onlyHakan, here you have your example working:[code:3lustkel] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' REQUEST DBFCDX function Main&#40;&#41; local oDlg, oBrw local oSeek, cSeek &#58;= Space&#40;25&#41; USE CUSTOMER NEW ALIAS CUST SHARED VIA 'DBFCDX' SET ORDER TO TAG SALARY GO TOP DEFINE DIALOG oDlg SIZE 540,480 PIXEL @ 10, 10 XBROWSE oBrw ; COLUMNS 'First','Last','Salary' ; SIZE 250,200 PIXEL ; OF oDlg ; ALIAS 'CUST' ; AUTOSORT oBrw&#58;bKeyDown = &#123; | nKey, nFlags | If&#40; nKey == VK_RETURN, oDlg&#58;End&#40;&#41;,&#41; &#125; oBrw&#58;bLDblClick = &#123; || oDlg&#58;End&#40;&#41; &#125; @ 220, 10 SAY oSeek VAR cSeek SIZE 100,10 PIXEL OF oDlg ; COLOR CLR_BLACK, CLR_YELLOW @ 220, 210 BUTTON "&OK" PIXEL OF oDlg ACTION oDlg&#58;End&#40;&#41; oBrw&#58;bSeek &#58;= &#123; |cSeek| CUST->&#40; DbSeek&#40; Val&#40; cSeek &#41;, &#46;t&#46; &#41;, !eof&#40;&#41; &#41; &#125; oBrw&#58;oSeek &#58;= oSeek oBrw&#58;CreateFromCode&#40;&#41; ACTIVATE DIALOG oDlg CENTERED return nil [/code:3lustkel]edited: added code for closing wirth double click too
A Few question about XBrowse.
Antonio,>A little typo in your code: the dialog should be closed when enter is pressed.Ops. I meant it to be:oBrw:bKeydown := {|nKey,nFlags| ; IIF(nKey == VK_RETURN, ( doWhatever(), oDlg:end() ), ) }James
A Few question about XBrowse.
Thank you very much James, Antonio.It works perfectly.Antonio : How Can get the new TComboBox class?
A Few question about XBrowse.
Hakan,> How Can get the new TComboBox class?Please check your email <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
A Fileformat-problem with oBar:SaveToBmp(cFile)
Hello, I noticed a File ( BMP ) -format-problem, using oBar:SaveToBmp( cFile ) Adding the saved BMP*s to xBrowse, the Background is not visible. I converted the saved BMP to JPG and back to BMP. After that, it was OK. The Problem inside the Project-browser showing the BMP-captures with different backgrounds : [img:1pzxurn0]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwimg1&#46;jpg[/img:1pzxurn0] Loaded the captured BMP with Pixelformer, shows a transparent Background ( like You can see in xBrowse, 1. Screenshot ) The BMP converted to JPG, next JPG saved as BMP. Result is OK. Olga is a original JPG saved as BMP ( no capture ) [img:1pzxurn0]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwimg2&#46;jpg[/img:1pzxurn0] Pixelformer shows the Format-problem of the captured BMP. [img:1pzxurn0]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwimg3&#46;jpg[/img:1pzxurn0] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A Fileformat-problem with oBar:SaveToBmp(cFile)
Uwe Hello, please post a self container sample, thanks
A Fileformat-problem with oBar:SaveToBmp(cFile)
Daniel, You can test it with the new Tool. I'm still working on the Project-section, but the needed Fields are included. You can create a PRG- and EXE with the defined Selections. I still need some Days for the final Release. It will be possible, to save everything to a DBF-record and loading a Set from the Project-manager. To do these things without a Result-preview at Runtime, would be a hard Job. A xBrowse-preview You will get with selecting < Dialog > The browser uses the same Settings like the Message. Message-title Font and Color = xBrowse-header, Message-text Font and Color = xBrowse-data. The same with Background. Download ( 4.1 MB ) : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/message1.zip">http://www.pflegeplus.com/fw_downloads/message1.zip</a><!-- m --> Is is a all in one- solution : Windows, Dialog, VTitles( Messages ), Fonteditor ( 2 for Head and Text ) and xBrowse. I think, I found the Reason for the missing Display. Xbrowse cannot display this Format ( 32 bpp ) A Capture-result : [img:23cybado]http&#58;//www&#46;pflegeplus&#46;com/pictures/message5&#46;jpg[/img:23cybado] 1. From the Main-screen select < Painter > [img:23cybado]http&#58;//www&#46;pflegeplus&#46;com/pictures/message1&#46;jpg[/img:23cybado] 2. define a Name for the Capture and select Folder-page < Project > [img:23cybado]http&#58;//www&#46;pflegeplus&#46;com/pictures/message2&#46;jpg[/img:23cybado] 3. Inside the Browser, select Your Captures To get Capture-backgrounds visible, You can use MsPaint : load a Capture, save the 32bb-BMP as JPG JPG is supported from xBrowse. [img:23cybado]http&#58;//www&#46;pflegeplus&#46;com/pictures/message3&#46;jpg[/img:23cybado] [img:23cybado]http&#58;//www&#46;pflegeplus&#46;com/pictures/message4&#46;jpg[/img:23cybado] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A Fileformat-problem with oBar:SaveToBmp(cFile)
Daniel, I solved the xBrowse-display-problem, saving the Capture as a JPG-image I added some more Options to the new Tool. Now the User can modify his Logo, adding different Frame-styles. The Result is saved as a new Image ( with underline to keep the Original ) => _MyLogo.jpg The Result is displayed in a extra Dialog, changing the Frame-style. ( I couldn't use a Brush, because of showing the Frame, I needed some space around ). [img:1mug903n]http&#58;//www&#46;pflegeplus&#46;com/pictures/msglogo1&#46;jpg[/img:1mug903n] [img:1mug903n]http&#58;//www&#46;pflegeplus&#46;com/pictures/msglogo2&#46;jpg[/img:1mug903n] [b:1mug903n]Saving a BMP-capture as a JPG-file using : oObject:[color=#FF0000:1mug903n]SaveToBmp[/color:1mug903n]( "Capture.bmp" ) [/b:1mug903n] [code=fw:1mug903n]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// c_path := CURDRIVE() + ":\" + GETCURDIR()</span><br /><br /><span style="color: #00C800;">FUNCTION</span> JPG_CAPTURE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> cOldfile := c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\"</span> + Alltrim(cScreenshot) + "</span>.bmp<span style="color: #ff0000;">"<br />LOCAL cNewfile := c_path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\<span style="color: #ff0000;">" + Alltrim(cScreenshot) + "</span>.jpg<span style="color: #ff0000;">"<br />LOCAL cScript := 'NCONVERT -quiet -out jpeg ' + cOldfile   <br /><br />// saves a VTitle or any other Object   <br />oBar:SaveToBmp( cOldfile )<br />    <br />IF FILE( c_path + "</span>\nConvert.exe<span style="color: #ff0000;">" )     <br />      WAITRUN ( cScript, 0 )<br />      IF FILE( cNewfile ) <br />            MsgAlert( "</span>The Screenshot is saved <span style="color: #ff0000;">" + CRLF + ;<br />                    "</span>in Subdirectory \<span style="color: #0000ff;">Bitmaps</span><span style="color: #ff0000;">" + CRLF + ;<br />                    "</span>as : <span style="color: #ff0000;">" + cNewfile, "</span>Attention<span style="color: #ff0000;">")<br />      ELSE<br />            MsgAlert( "</span>The File : <span style="color: #ff0000;">" + CRLF + ;<br />                    cNewfile + CRLF + ; <br />                    "</span>is not created !!!<span style="color: #ff0000;">", "</span>ERROR<span style="color: #ff0000;">")<br />      ENDIF<br />ELSE<br />      MsgAlert( "</span>nConvert.exe is missing !<span style="color: #ff0000;">" + CRLF + ;<br />                "</span>cannot convert <span style="color: #0000ff;">to</span> JPG !!<span style="color: #ff0000;">", "</span>ERROR<span style="color: #ff0000;">" )<br />ENDIF<br /><br />RETURN NIL<br /></span></div>[/code:1mug903n] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A FiveMac DBU
After reviewing Enrico's DBU (that I enjoyed so much): [url:msjb5e83]http&#58;//code&#46;google&#46;com/p/fivewin-contributions/downloads/detail?name=EmagDbu238&#46;zip&can=2&q=[/url:msjb5e83] we are building one for FiveMac to show FiveMac's possibilities <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> fivedbu.prg [code=fw:msjb5e83]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />   BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br /> <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />      <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> <br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />   <span style="color: #00C800;">local</span> oMenu<br /> <br />   <span style="color: #0000ff;">MENU</span> oMenu<br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">SEPARATOR</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDMENU</span><br />      <br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDMENU</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /> <br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oWnd, oBrw<br />   <br />   <span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br />      <br />   <span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span>   <br />      USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA DBFCDX <span style="color: #00C800;">NEW</span><br />   <span style="color: #00C800;">else</span>   <br />      USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />   @ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">363</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">8</span>,  <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Top"</span>    <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">8</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Bottom"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">8</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">SetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">8</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Search"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> MsgAlertSheet<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">8</span>, <span style="color: #000000;">490</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Grid"</span>  <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetGridLines</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetGridLines</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">8</span>, <span style="color: #000000;">610</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Exit"</span>   <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),)  } </span><br />   <br />   <span style="color: #B900B9;">// oBrw:bChanged := { | obj , nindex|   msginfo("cambio a reg:"+str(obj:nRowPos()) ) } </span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:msjb5e83] [img:msjb5e83]http&#58;//img20&#46;imageshack&#46;us/img20/958/screenshot20120510at111&#46;png[/img:msjb5e83]
A FiveMac DBU
[code=fw:20s91ap6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oBrw<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/preferences.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">363</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, &nbsp;<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Top"</span> &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Bottom"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">SetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Search"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> MsgAlertSheet<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">490</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Grid"</span> &nbsp;<span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetGridLines</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetGridLines</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">610</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Exit"</span> &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),) &nbsp;} </span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bChanged := { | obj , nindex| &nbsp; msginfo("cambio a reg:"+str(obj:nRowPos()) ) } </span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">350</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:20s91ap6] [img:20s91ap6]http&#58;//img28&#46;imageshack&#46;us/img28/9157/screenshot20120511at109&#46;png[/img:20s91ap6]
A FiveMac DBU
[code=fw:3e94pjv1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, cFieldName := <span style="color: #ff0000;">""</span>, cType, nLength := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFileName := <span style="color: #ff0000;">""</span>, cRDD <br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet,oGetDeci ,oGetName,oGetLen,oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtnCreate,oBtnEdit<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF Builder"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">274</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">790</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FieldName:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">78</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cFieldName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">22</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Type:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">51</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cType <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">124</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Character"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Memo"</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span>cType== <span style="color: #ff0000;">"Numeric"</span>,oGetDeci:<span style="color: #000000;">enabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Length:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">17</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">GET</span> oGetLen <span style="color: #0000ff;">VAR</span> nLength <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Dec:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">31</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">GET</span> oGetDeci <span style="color: #0000ff;">VAR</span> nDec <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">73</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"FieldName"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Length"</span>, <span style="color: #ff0000;">"Decimals"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">379</span>, <span style="color: #000000;">245</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cFieldName:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cType:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, oCbx:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength:= &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,oGetLen:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nDec &nbsp; := &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>,oGetDeci:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetSelectorStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArternateColor</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> &nbsp;&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">324</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> btnAddField<span style="color: #000000;">&#40;</span>@aFields,<span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span>,oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">274</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnedit <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#93;</span>:= <span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnEdit:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">242</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Up"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldUp<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;@ <span style="color: #000000;">210</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Down"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldDown<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">178</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aDel<span style="color: #000000;">&#40;</span> aFields, obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>,ASize<span style="color: #000000;">&#40;</span>aFields,Len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; <br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"DBF filename:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">92</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">GET</span> oGetName <span style="color: #0000ff;">VAR</span> cFileName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">275</span>, <span style="color: #000000;">22</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> , oBtnCreate:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , .t. &nbsp; <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RDD:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">16</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">COMBOBOX</span> cRDD <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">94</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBFNTX"</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">101</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code Gen."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">71</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Import"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aStruct:= importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> afields:= aStruct,oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">41</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnCreate <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oDlg ; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"crea dbf"</span><span style="color: #000000;">&#41;</span> , DBCREATE<span style="color: #000000;">&#40;</span> cFileName, aFields ,cRdd <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldUp<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldDown<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex < len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFile:=CHOOSEFILE<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Select dbf file :"</span>,<span style="color: #ff0000;">"Dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> calias<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cFile,len<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><span style="color: #000000;">-3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".DBF"</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; calias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aStruct:= <span style="color: #000000;">&#40;</span>calias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbstruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; close<span style="color: #000000;">&#40;</span>calias<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>len<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cFile,len<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><span style="color: #000000;">-3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"tipo de archivo incorrecto"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> btnAddField<span style="color: #000000;">&#40;</span> aFields, aField, nAt <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aItem<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nAt := Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:= val<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:= val<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span> = &nbsp;<span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nAt:=len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt == Len<span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aFields, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> aFields, Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AIns<span style="color: #000000;">&#40;</span> aFields, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aField &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">"local aFields := "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := aFields<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, cTempName<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"{ "</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'{ "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", '</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"}"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n < Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">",;"</span>, <span style="color: #ff0000;">" } "</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oBrw<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/preferences.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">363</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, &nbsp;<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Top"</span> &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Bottom"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">SetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Search"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> MsgAlertSheet<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">490</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Grid"</span> &nbsp;<span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetGridLines</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetGridLines</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">8</span>, <span style="color: #000000;">610</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Exit"</span> &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),) &nbsp;} </span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bChanged := { | obj , nindex| &nbsp; msginfo("cambio a reg:"+str(obj:nRowPos()) ) } </span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">350</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:3e94pjv1] [img:3e94pjv1]http&#58;//img823&#46;imageshack&#46;us/img823/844/screenshot20120511at130&#46;png[/img:3e94pjv1]
A FiveMac DBU
[code=fw:15tacxpb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBar<br /> <br />   BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/new.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/open.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FiveDbu for FiveMac (c) FiveTech Software 2012"</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /> <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />      <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> <br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />   <span style="color: #00C800;">local</span> oMenu<br /> <br />   <span style="color: #0000ff;">MENU</span> oMenu<br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span>  <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">SEPARATOR</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDMENU</span><br />      <br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />      <span style="color: #0000ff;">MENU</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />         <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDMENU</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /> <br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, cFieldName := <span style="color: #ff0000;">""</span>, cType, nLength := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> cFileName := <span style="color: #ff0000;">""</span>, cRDD <br />   <span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> oGet,oGetDeci ,oGetName,oGetLen,oCbx<br />   <span style="color: #00C800;">local</span> oBtnCreate,oBtnEdit<br />   <span style="color: #00C800;">local</span> aStruct<br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF Builder"</span> ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">274</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">790</span><br /><br />   @ <span style="color: #000000;">351</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FieldName:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">78</span>, <span style="color: #000000;">17</span>   <br /><br />   @ <span style="color: #000000;">326</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cFieldName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">22</span>   <br /><br />   @ <span style="color: #000000;">351</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Type:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">51</span>, <span style="color: #000000;">17</span>   <br /><br />   @ <span style="color: #000000;">326</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cType <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">124</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Character"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Memo"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span>cType== <span style="color: #ff0000;">"Numeric"</span>,oGetDeci:<span style="color: #000000;">enabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">351</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Length:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">17</span> <br />   <br />   @ <span style="color: #000000;">326</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">GET</span> oGetLen <span style="color: #0000ff;">VAR</span> nLength <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span>  <br />   <br />   @ <span style="color: #000000;">351</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Dec:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">31</span>, <span style="color: #000000;">17</span>   <br /><br />   @ <span style="color: #000000;">326</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">GET</span> oGetDeci <span style="color: #0000ff;">VAR</span> nDec <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span>   <br />   <br />   oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <br />   @ <span style="color: #000000;">73</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />      HEADERS <span style="color: #ff0000;">"FieldName"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Length"</span>, <span style="color: #ff0000;">"Decimals"</span> ;<br />      <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">379</span>, <span style="color: #000000;">245</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cFieldName:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                  cType:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, oCbx:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                  nLength:=  aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,oGetLen:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />                  nDec   :=  aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>,oGetDeci:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />   <br />   oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />                                        alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">SetSelectorStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>   <br />   oBrw:<span style="color: #000000;">SetArternateColor</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>     <br />       <br />   @ <span style="color: #000000;">324</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />        <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> btnAddField<span style="color: #000000;">&#40;</span>@aFields,<span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span>,oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#41;</span>,;<br />                        cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />    <br />   @ <span style="color: #000000;">274</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnedit <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#93;</span>:= <span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span> , ;<br />               cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />               <br />   oBtnEdit:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />   @ <span style="color: #000000;">242</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Up"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldUp<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <br />   @ <span style="color: #000000;">210</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Down"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldDown<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>  <br />   @ <span style="color: #000000;">178</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aDel<span style="color: #000000;">&#40;</span> aFields, obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>,ASize<span style="color: #000000;">&#40;</span>aFields,Len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <br /><br /><br />   @ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"DBF filename:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">92</span>, <span style="color: #000000;">17</span>   <br /><br />   @ <span style="color: #000000;">46</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">GET</span> oGetName <span style="color: #0000ff;">VAR</span> cFileName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">275</span>, <span style="color: #000000;">22</span> ;<br />    <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> , oBtnCreate:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , .t.   <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">20</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RDD:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">17</span>   <br /><br />   @ <span style="color: #000000;">16</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">COMBOBOX</span> cRDD <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">94</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBFNTX"</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#125;</span><br />      <br />      <br />   @ <span style="color: #000000;">101</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code Gen."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <br /><br />   @ <span style="color: #000000;">71</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Import"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aStruct:= importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> afields:= aStruct,oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">41</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnCreate <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oDlg ;   <br />             <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"crea dbf"</span><span style="color: #000000;">&#41;</span> , DBCREATE<span style="color: #000000;">&#40;</span> cFileName, aFields ,cRdd <span style="color: #000000;">&#41;</span>    <span style="color: #000000;">&#41;</span><br />   <br />   oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldUp<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> BakaField<br /><br />   <span style="color: #00C800;">if</span> nIndex > <span style="color: #000000;">1</span><br />      BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span><br />      aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />      aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />   <span style="color: #00C800;">endif</span>   <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldDown<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> BakaField<br /><br />   <span style="color: #00C800;">if</span> nIndex < len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><br />      BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span><br />      aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />      aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />   <span style="color: #00C800;">endif</span>   <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cFile:=CHOOSEFILE<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Select dbf file :"</span>,<span style="color: #ff0000;">"Dbf"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> calias<br />   <span style="color: #00C800;">local</span> aStruct<br /><br />   <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cFile,len<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><span style="color: #000000;">-3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".DBF"</span><br />      USE <span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span>  <br />      calias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      aStruct:= <span style="color: #000000;">&#40;</span>calias<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbstruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      close<span style="color: #000000;">&#40;</span>calias<span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>len<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cFile,len<span style="color: #000000;">&#40;</span>cfile<span style="color: #000000;">&#41;</span><span style="color: #000000;">-3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>    <span style="color: #000000;">&#41;</span>  <br />      <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"tipo de archivo incorrecto"</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> btnAddField<span style="color: #000000;">&#40;</span> aFields, aField, nAt <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aItem<br /><br />   <span style="color: #00C800;">DEFAULT</span> nAt := Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /> <br />   <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />      aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:= val<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /> <br />   <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />      aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:= val<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /> <br />   <span style="color: #00C800;">if</span> len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span> =  <span style="color: #000000;">0</span><br />      nAt:=len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span>   <br /> <br />   <span style="color: #00C800;">if</span> nAt == Len<span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#41;</span><br />      AAdd<span style="color: #000000;">&#40;</span> aFields, aField <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span>    <br />      ASize<span style="color: #000000;">&#40;</span> aFields, Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />      AIns<span style="color: #000000;">&#40;</span> aFields, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />      aFields<span style="color: #000000;">&#91;</span> nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aField   <br />   <span style="color: #00C800;">endif</span><br />      <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cPrg  := <span style="color: #ff0000;">"local aFields := "</span><br />   <span style="color: #00C800;">local</span> aInfo := aFields<br />   <span style="color: #00C800;">local</span> n, cTempName<br /><br />   <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />      cPrg +=  <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"{ "</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'{ "'</span> + ;<br />              aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", "'</span> + ;<br />              aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", '</span> + ;<br />              AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + ;<br />              AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"}"</span> + ;<br />              <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n < Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">",;"</span>, <span style="color: #ff0000;">" } "</span> <span style="color: #000000;">&#41;</span> + CRLF<br />   <span style="color: #00C800;">next</span><br />   <br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oWnd, oBar, oBrw<br />   <br />   <span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br />      <br />   <span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span>   <br />      USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />   <span style="color: #00C800;">else</span>   <br />      USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/add.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/preferences.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />      <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   @ <span style="color: #000000;">65</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">363</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">28</span>,  <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Top"</span>    <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Bottom"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Delete"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">SetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Search"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> MsgAlertSheet<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">490</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Grid"</span>  <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetGridLines</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GetGridLines</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">610</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Exit"</span>   <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),)  } </span><br />   <br />   <span style="color: #B900B9;">// oBrw:bChanged := { | obj , nindex|   msginfo("cambio a reg:"+str(obj:nRowPos()) ) } </span><br /><br />   <span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ;<br />               <span style="color: #ff0000;">"   Records: 1 / "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />   <br />   oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">33</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />      FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />      HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />      <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">327</span><br />   <br />   oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />                             Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oDlg<br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Total fields: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:15tacxpb] [img:15tacxpb]http&#58;//img109&#46;imageshack&#46;us/img109/5933/screenshot20120511at217&#46;png[/img:15tacxpb] [img:15tacxpb]http&#58;//img696&#46;imageshack&#46;us/img696/1143/screenshot20120511at220&#46;png[/img:15tacxpb]
A FiveMac DBU
[code=fw:2sku7fqu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar<br />&nbsp;<br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/new.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/open.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FiveDbu for FiveMac (c) FiveTech Software 2012"</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, cFieldName := <span style="color: #ff0000;">""</span>, cType, nLength := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFileName := <span style="color: #ff0000;">""</span>, cRDD <br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet,oGetDeci ,oGetName,oGetLen,oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtnCreate,oBtnEdit<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF Builder"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">274</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">790</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FieldName:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">78</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cFieldName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">22</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Type:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">51</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cType <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">124</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Character"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Memo"</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span>cType== <span style="color: #ff0000;">"Numeric"</span>,oGetDeci:<span style="color: #000000;">enabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Length:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">17</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">GET</span> oGetLen <span style="color: #0000ff;">VAR</span> nLength <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Dec:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">31</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">GET</span> oGetDeci <span style="color: #0000ff;">VAR</span> nDec <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">73</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"FieldName"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Length"</span>, <span style="color: #ff0000;">"Decimals"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">379</span>, <span style="color: #000000;">245</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cFieldName:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cType:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, oCbx:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength:= &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,oGetLen:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nDec &nbsp; := &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>,oGetDeci:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetSelectorStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArternateColor</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> &nbsp;&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">324</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> btnAddField<span style="color: #000000;">&#40;</span>@aFields,<span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span>,oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">274</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnedit <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#93;</span>:= <span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnEdit:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">242</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Up"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldUp<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;@ <span style="color: #000000;">210</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Down"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldDown<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">178</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aDel<span style="color: #000000;">&#40;</span> aFields, obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>,ASize<span style="color: #000000;">&#40;</span>aFields,Len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; <br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"DBF filename:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">92</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">GET</span> oGetName <span style="color: #0000ff;">VAR</span> cFileName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">275</span>, <span style="color: #000000;">22</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> , oBtnCreate:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , .t. &nbsp; <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RDD:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">16</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">COMBOBOX</span> cRDD <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">94</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBFNTX"</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">101</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code Gen."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">71</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Import"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aStruct:= importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> afields:= aStruct,oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">41</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnCreate <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oDlg ; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"crea dbf"</span><span style="color: #000000;">&#41;</span> , DBCREATE<span style="color: #000000;">&#40;</span> cFileName, aFields ,cRdd <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldUp<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">-1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldDown<span style="color: #000000;">&#40;</span>aFields,nIndex<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex < len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BakaField:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span>:= aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span>nIndex<span style="color: #000000;">&#93;</span>:= BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFile := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Select dbf file:"</span>, <span style="color: #ff0000;">"Dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> calias, aStruct<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".DBF"</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; cAlias = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aStruct = <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; close<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aStruct <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Invalid file type"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> btnAddField<span style="color: #000000;">&#40;</span> aFields, aField, nAt <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nAt := Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nAt = Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt == Len<span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aFields, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> aFields, Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AIns<span style="color: #000000;">&#40;</span> aFields, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aField &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">"local aFields := "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := aFields<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, cTempName<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"{ "</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'{ "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", '</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"}"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n < Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">",;"</span>, <span style="color: #ff0000;">" } "</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oBrw, oSay<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/add.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/minus.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Delete this record ?"</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/preferences.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">35</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">393</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),) &nbsp;} </span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bChanged</span> = <span style="color: #000000;">&#123;</span> || oSay:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; Record: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">" &nbsp; Record: 1 / "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">33</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">327</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Total fields: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:2sku7fqu] [img:2sku7fqu]http&#58;//img3&#46;imageshack&#46;us/img3/629/screenshot20120511at755&#46;png[/img:2sku7fqu]
A FiveMac DBU
[code=fw:10febwpy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar<br />&nbsp;<br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/new.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/open.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FiveDbu for FiveMac (c) FiveTech Software 2012"</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, cFieldName := <span style="color: #ff0000;">""</span>, cType, nLength := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFileName := <span style="color: #ff0000;">""</span>, cRDD <br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet,oGetDeci ,oGetName,oGetLen,oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtnCreate,oBtnEdit<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF Builder"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">274</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">790</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FieldName:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">78</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cFieldName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">22</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Type:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">51</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cType <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">124</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Character"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Memo"</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span>cType== <span style="color: #ff0000;">"Numeric"</span>,oGetDeci:<span style="color: #000000;">enabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Length:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">17</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">GET</span> oGetLen <span style="color: #0000ff;">VAR</span> nLength <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Dec:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">31</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">GET</span> oGetDeci <span style="color: #0000ff;">VAR</span> nDec <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">73</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"FieldName"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Length"</span>, <span style="color: #ff0000;">"Decimals"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">379</span>, <span style="color: #000000;">245</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cFieldName:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cType:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, oCbx:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength:= &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,oGetLen:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nDec &nbsp; := &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>,oGetDeci:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetSelectorStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArternateColor</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> &nbsp;&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">324</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> btnAddField<span style="color: #000000;">&#40;</span>@aFields,<span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span>,oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">274</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnedit <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#93;</span>:= <span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnEdit:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">242</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Up"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldUp<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;@ <span style="color: #000000;">210</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Down"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldDown<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">178</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aDel<span style="color: #000000;">&#40;</span> aFields, obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>,ASize<span style="color: #000000;">&#40;</span>aFields,Len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; <br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"DBF filename:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">92</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">GET</span> oGetName <span style="color: #0000ff;">VAR</span> cFileName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">275</span>, <span style="color: #000000;">22</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> , oBtnCreate:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , .t. &nbsp; <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RDD:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">16</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">COMBOBOX</span> cRDD <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">94</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBFNTX"</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">101</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code Gen."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">71</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Import"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aStruct:= importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> afields:= aStruct,oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">41</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnCreate <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oDlg ; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"crea dbf"</span><span style="color: #000000;">&#41;</span> , DBCREATE<span style="color: #000000;">&#40;</span> cFileName, aFields ,cRdd <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldUp<span style="color: #000000;">&#40;</span> aFields, nIndex <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; BakaField = aFields<span style="color: #000000;">&#91;</span> nIndex - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span> = BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldDown<span style="color: #000000;">&#40;</span> aFields, nIndex <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex < Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BakaField = aFields<span style="color: #000000;">&#91;</span> nIndex + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span> = BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFile := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Select dbf file:"</span>, <span style="color: #ff0000;">"Dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> calias, aStruct<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".DBF"</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; cAlias = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aStruct = <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; close<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aStruct <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Invalid file type"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> btnAddField<span style="color: #000000;">&#40;</span> aFields, aField, nAt <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nAt := Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nAt = Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt == Len<span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aFields, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> aFields, Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AIns<span style="color: #000000;">&#40;</span> aFields, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aField &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">"local aFields := "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := aFields<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, cTempName<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"{ "</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'{ "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", '</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"}"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n < Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">",;"</span>, <span style="color: #ff0000;">" } "</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oBrw, oSay<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/add.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/edit.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> RecEdit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/minus.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Delete this record ?"</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"First"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/first.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Last"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/last.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/preferences.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"../bitmaps/exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">35</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">393</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),) &nbsp;} </span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bChanged</span> = <span style="color: #000000;">&#123;</span> || oSay:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; Record: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">" &nbsp; Record: 1 / "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">33</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">327</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Total fields: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> RecEdit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:10febwpy] [img:10febwpy]http&#58;//img641&#46;imageshack&#46;us/img641/5154/screenshot20120511at829&#46;png[/img:10febwpy]
A FiveMac DBU
[code=fw:24fxl86v]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br />request DbfCdx<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar<br />&nbsp;<br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FiveDBU for FiveMac"</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> ScreenWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> ScreenHeight<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - oWnd:<span style="color: #000000;">nHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"New"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"new.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"open.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to end ?"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMenu<br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Files"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"New..."</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Open..."</span> <span style="color: #0000ff;">ACTION</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Help"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Wiki..."</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"About..."</span> <span style="color: #0000ff;">ACTION</span> MsgAbout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"(C) FiveTech Software 2012"</span>, <span style="color: #ff0000;">"FiveMac"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp;<br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, cFieldName := <span style="color: #ff0000;">""</span>, cType, nLength := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFileName := <span style="color: #ff0000;">""</span>, cRDD <br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aFields := <span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet,oGetDeci ,oGetName,oGetLen,oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtnCreate,oBtnEdit<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF Builder"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">274</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">590</span>, <span style="color: #000000;">790</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FieldName:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">78</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cFieldName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">22</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Type:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">51</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">153</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cType <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">124</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Character"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Memo"</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> Iif<span style="color: #000000;">&#40;</span>cType== <span style="color: #ff0000;">"Numeric"</span>,oGetDeci:<span style="color: #000000;">enabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Length:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">17</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">285</span> <span style="color: #0000ff;">GET</span> oGetLen <span style="color: #0000ff;">VAR</span> nLength <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> <br />&nbsp; &nbsp;oGetLen:<span style="color: #000000;">setnumeric</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">351</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Dec:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">31</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">326</span>, <span style="color: #000000;">336</span> <span style="color: #0000ff;">GET</span> oGetDeci <span style="color: #0000ff;">VAR</span> nDec <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">43</span>, <span style="color: #000000;">22</span> &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oGetDeci:<span style="color: #000000;">disabled</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">73</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"FieldName"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Length"</span>, <span style="color: #ff0000;">"Decimals"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">379</span>, <span style="color: #000000;">245</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cFieldName:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cType:= aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, oCbx:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength:= &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,oGetLen:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nDec &nbsp; := &nbsp;aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nrowPos</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>,oGetDeci:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetSelectorStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetAlternateColor</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> &nbsp;&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">324</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> btnAddField<span style="color: #000000;">&#40;</span>@aFields,<span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span>,oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">274</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnedit <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nRowPos</span><span style="color: #000000;">&#93;</span>:= <span style="color: #000000;">&#123;</span> cFieldName,cType,nLength,nDec <span style="color: #000000;">&#125;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFieldName :=<span style="color: #ff0000;">""</span> ,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnEdit:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">242</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Up"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldUp<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;@ <span style="color: #000000;">210</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Down"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> SetFieldDown<span style="color: #000000;">&#40;</span>@aFields,obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">178</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aDel<span style="color: #000000;">&#40;</span> aFields, obrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span>,ASize<span style="color: #000000;">&#40;</span>aFields,Len<span style="color: #000000;">&#40;</span>aFields<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; <br /><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">48</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"DBF filename:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">92</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">46</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">GET</span> oGetName <span style="color: #0000ff;">VAR</span> cFileName <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">275</span>, <span style="color: #000000;">22</span> ;<br />&nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>cFileName<span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>afields<span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> , oBtnCreate:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , .t. &nbsp; <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RDD:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">17</span> &nbsp; <br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">16</span>, <span style="color: #000000;">110</span> <span style="color: #0000ff;">COMBOBOX</span> cRDD <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">94</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DBFNTX"</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">101</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code Gen."</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">71</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Import"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aStruct:= importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span>aStruct<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> afields:= aStruct,oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">41</span>, <span style="color: #000000;">407</span> <span style="color: #0000ff;">BUTTON</span> oBtnCreate <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oDlg ; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"crea dbf"</span><span style="color: #000000;">&#41;</span> , DBCREATE<span style="color: #000000;">&#40;</span> cFileName, aFields ,cRdd <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBtnCreate:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldUp<span style="color: #000000;">&#40;</span> aFields, nIndex <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; BakaField = aFields<span style="color: #000000;">&#91;</span> nIndex - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span> = BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SetFieldDown<span style="color: #000000;">&#40;</span> aFields, nIndex <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> BakaField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nIndex < Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BakaField = aFields<span style="color: #000000;">&#91;</span> nIndex + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span> = BakaField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> importDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cFile := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Select dbf file:"</span>, <span style="color: #ff0000;">"Dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> calias, aStruct<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".DBF"</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; cAlias = <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aStruct = <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; close<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aStruct <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cFile, Len<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Invalid file type"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> btnAddField<span style="color: #000000;">&#40;</span> aFields, aField, nAt <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nAt := Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> = Val<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nAt = Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt == Len<span style="color: #000000;">&#40;</span> aFields<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aFields, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> aFields, Len<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AIns<span style="color: #000000;">&#40;</span> aFields, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aFields<span style="color: #000000;">&#91;</span> nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aField &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DbfGen<span style="color: #000000;">&#40;</span> aFields <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">"local aFields := "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := aFields<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, cTempName<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"{ "</span>, space<span style="color: #000000;">&#40;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'{ "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", "'</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">'", '</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"}"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n < Len<span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">",;"</span>, <span style="color: #ff0000;">" } "</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Open<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbfName := ChooseFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please select a DBF file"</span>, <span style="color: #ff0000;">"dbf"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oBrw, oSay<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> cFileNoExt<span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">".cdx"</span> <span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbfName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> cDbfName ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">213</span>, <span style="color: #000000;">109</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">820</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"add.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Edit"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"edit.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> RecEdit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Del"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"minus.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Delete this record ?"</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"First"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"first.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Last"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"last.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"preferences.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ShowStruct<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">35</span>, <span style="color: #000000;">20</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">672</span>, <span style="color: #000000;">393</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oBrw:bHeadClick:= { | obj , nindex| if(nindex== 1, msginfo("clickada cabecera"+str(nindex)),) &nbsp;} </span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_BLACK, CLR_GRAY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bChanged</span> = <span style="color: #000000;">&#123;</span> || oSay:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; Record: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Alias: "</span> + oBrw:<span style="color: #000000;">cAlias</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">" &nbsp; Record: 1 / "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ShowStruct<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, aInfo := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dbf "</span> + cAlias + <span style="color: #ff0000;">" fields"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">395</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">33</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">410</span>, <span style="color: #000000;">327</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, Str<span style="color: #000000;">&#40;</span> aInfo<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_BLACK, CLR_GRAY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Total fields: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> RecEdit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oSayRec, nRecNo<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aRecord, cAlias := oBrw:<span style="color: #000000;">cAlias</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoto<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowPos</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;nRecNo = <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aRecord = <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecord<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Edit: "</span> + oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">500</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> TOOLBAR oBar <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Prev"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"first.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRecNo > <span style="color: #000000;">1</span>, <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> --nRecNo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRecord := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecord<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSayRec:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Next"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"last.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRecNo < <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> ++nRecNo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRecord := <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecord<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSayRec:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">IMAGE</span> ImgPath<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"exit2.png"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">33</span>, <span style="color: #000000;">10</span> BROWSE oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Field"</span>, <span style="color: #ff0000;">"Value"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">579</span>, <span style="color: #000000;">436</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetColEditable</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetColWidth</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">454</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aRecord <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bLine</span> = <span style="color: #000000;">&#123;</span> | nRow | <span style="color: #000000;">&#123;</span> aRecord<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aRecord<span style="color: #000000;">&#91;</span> nRow <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_BLACK, CLR_GRAY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> MSGBAR <span style="color: #0000ff;">OF</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSayRec <span style="color: #0000ff;">PROMPT</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> GetRecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">20</span> RAISED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> GetRecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Record: "</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> GetRecord<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aRecord := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, n<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aRecord, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldName<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValToChar<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /><br /><span style="color: #00C800;">return</span> aRecord<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:24fxl86v] [img:24fxl86v]http&#58;//img152&#46;imageshack&#46;us/img152/2272/picture1gpr&#46;png[/img:24fxl86v]
A FiveMac DBU
Tags support: [img:1fw87841]http&#58;//img204&#46;imageshack&#46;us/img204/2467/picture1wth&#46;png[/img:1fw87841]
A Forum-error ( PHP ) ?
Hello, I'm getting these messages trying to open a post. The problem started this evening. [color=#FF0000:1wg89qcu][b:1wg89qcu]The complete messages [/b:1wg89qcu][/color:1wg89qcu] [color=#0000FF:1wg89qcu][phpBB Debug] PHP Notice: in file /viewtopic.php on line 943: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. [phpBB Debug] PHP Notice: in file /viewtopic.php on line 943: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 112 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 [phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184) [phpBB Debug] PHP Notice: in file /includes/functions.php on line 3765: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184) [phpBB Debug] PHP Notice: in file /includes/functions.php on line 3766: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184) [phpBB Debug] PHP Notice: in file /includes/functions.php on line 3767: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)[/color:1wg89qcu] Any idea ? Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A Forum-error ( PHP ) ?
Happens to me too
A Forum-error ( PHP ) ?
Also to me ( here at work) Perpahs it is time to change Php version ?
A Forum-error ( PHP ) ?
Same here.
A Forum-error ( PHP ) ?
Same as me.
A Forum-error ( PHP ) ?
Clicking here is fine: [url:151tt0kz]http&#58;//forums&#46;fivetechsupport&#46;com/search&#46;php?search_id=active_topics[/url:151tt0kz] Surely bluehost updated its php version. We will check it asap
A Forum-error ( PHP ) ?
Tambien tengo problemas...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491
A Forum-error ( PHP ) ?
Tambien tengo problemas...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [phpBB Debug] PHP Notice: in file /viewtopic.php on line 943: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. [phpBB Debug] PHP Notice: in file /viewtopic.php on line 943: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home2/fivetec1/public_html/forums/includes/bbcode.php on line 491
A Forum-error ( PHP ) ?
Si, los hemos visto, gracias Pero tenemos que intentar corregirlos con mucho cuidado para no romper estos foros Asi que en los próximos dias iremos haciendo pruebas y antes nos aseguraremos de tener una copia completa de seguridad actualizada Un poco de paciencia a todos hasta que el problema quede solucionado gracias! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
A Forum-error ( PHP ) ?
It seems to be solved <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Parece que ya está arreglado <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
A Forum-error ( PHP ) ?
Ya no sale el error...solo me he dado cuenta de un detalle...a veces entro al foro sin conectarme como usuario y voy abriendo en otras paginas los temas que me interesen ver u opinar...que hago...voy a una de las pantallas..me conecto y luego para poder opinar o seguir un tema...solo refresco la pagina y ya asume que estoy conectado porque ya lo hice en otra que tenia abierta...ahora no puedo hacerlo..debo conectarme en cada pagina..o cerrarlas todas y empezar de nuevo pero ahora conectado..no se si es debibo a la nueva PHP o si es la forma correcta que deberia de funcionar...espero haberme explicado bien..ya que esto no viene al tema del ERROR, ya por lo menos a mi, me funciona sin errores...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
A Forum-error ( PHP ) ?
El problema se había generado por actualizar Bluehost de php 5.4 a la versión 5.6 pero desde el panel de control teniamos la opción de seleccionar la versión 5.4 nuevamente. Al revisar las opciones de este panel descubrí que hay una versión de php 5.4 que le dicen "fast" que es más rápida y decidí que la probemos. En teoría estos foros tienen que ir más rápidos ahora, como contrapartida parece que no recuerda correctamente nuestra identificación en los foros y nos obliga a logearnos nuevamente al abrir la página de los foros. Os agradezco si comentais si veis que los foros estan más rápidos ahora y si teneis el problema de que os obliga a hacer login cuando se accede a los foros desde una nueva pestaña del navegador.
A Forum-error ( PHP ) ?
No se si funciona mas rapido pero no recuerda el password. Saludos
A Forum-error ( PHP ) ?
[quote="horacio":r4k53g7v]No se si funciona mas rapido pero no recuerda el password. Saludos[/quote:r4k53g7v] +1
A Forum-error ( PHP ) ?
Back to standard version 5.4 <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Regresamos a la versión estandard 5.4 <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
A Forum-error ( PHP ) ?
The [color=#0000FF:1lp9dsq4][b:1lp9dsq4] PASSWORD-save [/b:1lp9dsq4][/color:1lp9dsq4] selection doesn't work anymore. I have to do a LOGIN every time working on or adding a post still a error <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A Forum-error ( PHP ) ?
+1 [img:49s2nwc8]http&#58;//i&#46;imgur&#46;com/gpzmMyz&#46;png[/img:49s2nwc8] regards, saludos.
A Forum-error ( PHP ) ?
+1
A Forum-error ( PHP ) ?
Doesn't work On every visit, I have to LOGIN again. [img:2wqoke7y]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Forum3&#46;jpg[/img:2wqoke7y] it started after the change. best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A Forum-error ( PHP ) ?
[quote="ukoenig":2mr19emt]Doesn't work On every visit, I have to LOGIN again. [img:2mr19emt]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Forum3&#46;jpg[/img:2mr19emt] it started after the change. best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:2mr19emt] A mi nunca me ha salvado el password, ni antes ni ahora...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
A Forum-error ( PHP ) ?
I have purged the phpbb cache. Lets see if that makes a difference, thanks for the feedback
A Forum-error ( PHP ) ?
I just tried a couple of times and it still requires manual login each time.
A Forum-error ( PHP ) ?
I just disabled and reenabled this option from the phpbb Administration control panel: phpBB - General - "Server configuration" - "Security Settings": [code=fw:181ylblf]<div class="fw" id="{CB}" style="font-family: monospace;">Allow persistent logins:<br /><span style="color: #000000;">Determines</span> whether users can autologin <span style="color: #0000ff;">when</span> they visit the board.</div>[/code:181ylblf] I appreciate your feedback
A Forum-error ( PHP ) ?
[url:acqd4sxj]https&#58;//www&#46;phpbb&#46;com/community/viewtopic&#46;php?p=13101511#p13101511[/url:acqd4sxj]
A Forum-error ( PHP ) ?
It does not work with my preferred browser Firefox. It worked up until the problem described in this thread. I tried it with Microsoft Internet Explorer and it works. So for me it is a problem only on the Firefox.
A Forum-error ( PHP ) ?
With Safari on OSX the problem is still here.
A Forum-error ( PHP ) ?
+1 I confirm ..each time I wish write I must re-insert my login
A Forum-error ( PHP ) ?
I confirm that I also experience the same login problem.
A Forum-error ( PHP ) ?
Yes, me too, but no idea yet how to solve it... <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
A Forum-error ( PHP ) ?
Guys, I think it is related to the new version of phpBB. The same thing happens on FWeb forum too. Please see <!-- m --><a class="postlink" href="https://www.phpbb.com/community/viewtopic.php?f=46&t=2124256&sid=719afc1850982a6f576166d3ad82ef20&start=60#p12971052">https://www.phpbb.com/community/viewtop ... #p12971052</a><!-- m -->