Announcement

Collapse
No announcement yet.

VB Form Conversion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #61
    Twips are always 1440 per inch in both X/width and Y/height. Twips are a nice unit to deal with because of the control and use in both screen and print. In print where resolution is 300 dpi or higher. Screen is usually 72 or 90 dpi depending on screen size. The user has the ability to set up custom size as well, but most users don't. (Note: I am not sure if there is a difference internationally).

    Pixels per inch vary depending on the size of your screen. VB has the function TwipsPerPixelX/Y which varies depending on screen size/resolution. On my screen, I get TwipsPerPixelX=15, TwipsPerPixelY=15.

    Dialog Units vary depending on the size of the Dialog Box Font being used, which is usually 8-point MS Sans Serif. The user has control over this font though. For instance (unconfirmed), if the user uses Large Font option, this changes the Dialog unit scale. http://support.microsoft.com/kb/145994/en-us
    It looks like PBForms always the same font (8-point MS Sans Serif) for its calculation of Dialog Units. At least changing the font size does not change the number of DUs displayed in PBForms Size tab.

    In VB, Left, Top, Width and Height are of the single datatype allowing decimal values. Therefore, it is possible to place something at 15.571 pixels. It looks like VB converts everything to twips (1440 per inch). Of course, in the end the form/control will place at 15 or 16 pixels. But which does VB chose?

    The possible "error" that has been discussed previously between VB and PB is that VB can perform the calculation from Pixels to Twips (Twips to Pixels) in a number of ways. Depending on the math used, certain rounding errors are introduced. Does VB use Dialog units internally (hiding the details from the user like many other things VB hides).

    Simply put, VB has the capability to perform these calculations. PB does also. The issue is can the calculations VB performs and the calculations PB performs produce identical results. If the calculations are off the result will be off +- a pixel. Potentially more if the "error" is compounded. Even if VB calculates with errors, the converter will need to produce the same errors.

    The complications include:
    * Are Dialog units used internally.
    * The Left, Top, Width, Height, "Single" values converted to another data type for calculations. Is it possible for performance that these values are converted to Longs *1000 (move the decimal place and truncate/round).
    * How many decimal places are significant?
    ...

    As also mentioned, VB has ClientWidth and ClientHeight calculations. This takes into account spacing for menus, scroll bars, with of borders, etc... These may also produce differences between VB and PB. It was pointed out that PB generated a form with -Y values.

    I am not sure which is the best way to proceed. Do we convert to Dialog Units or does the converter use twips and dynamically convert at runtime. The answer to this has nothing to do with continuing to use VB and re-convert a form. It has to do with what makes easier code to work with.

    For a VB developer new to PB the converter should not throw code at them that looks like nothing they are familiar with. Do this and it insures that the VB develop will continue to develop in VB and re-convert.

    On the other hand a seasoned PB developer, that may not know VB, might like everything converted to Dialog Units. This isn't clear though as the code might be difficult to follow as weird values are introduced that don't make sense even to a PB developer.

    Currently, I think it is better to keep the new VB developer familiar. I may be biased though as I know VB better than I know PB. Maybe the solution is just some documentation about differences between VB and PB.

    Maybe the solution is to give a choice.

    If I have time this weekend I'll create a project that will answer a lot of questions.

    Decisions, Decisions...

    Originally posted by Rodney Hicks View Post
    More fooforaw on these twips, twips to pixels, twips to dialog units.

    If there are 20 twips per pixel horizontally, are there 20 twips per pixel vertically.
    Dialog unit=1.50 pixels horizontally, 1.625 vertically.
    Does this dichotomy apply to twips?

    Comment


    • #62
      Code:
      I am not sure which is the best way to proceed. Do we convert to
      Dialog Units or does the converter use twips and dynamically convert at
      runtime. The answer to this has nothing to do with continuing to use 
      VB and re-convert a form. It has to do with what makes easier code to
      work with.
      Why not try both ways and see which one looks CLOSEST to the original result and use that way?
      LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

      Comment


      • #63
        One of the things I plan to do this weekend if time permits

        Originally posted by Wayne Suite;298216:)

        Why not try both ways and see which one looks CLOSEST to the original result and use that way?

        Comment


        • #64
          Brian,

          You make some good points. I'm glad there is a VB guru on board to help us point out and answer these questions.

          In VB, Left, Top, Width and Height are of the single datatype allowing decimal values. Therefore, it is possible to place something at 15.571 pixels. It looks like VB converts everything to twips (1440 per inch). Of course, in the end the form/control will place at 15 or 16 pixels. But which does VB chose?
          I seem to remember that form/control values for location and size are rounded up/down to the nearest integer, at least the values that show up in the various property windows.

          The possible "error" that has been discussed previously between VB and PB is that VB can perform the calculation from Pixels to Twips (Twips to Pixels) in a number of ways. Depending on the math used, certain rounding errors are introduced. Does VB use Dialog units internally (hiding the details from the user like many other things VB hides).
          Good question, I don't know.

          Simply put, VB has the capability to perform these calculations. PB does also. The issue is can the calculations VB performs and the calculations PB performs produce identical results. If the calculations are off the result will be off +- a pixel. Potentially more if the "error" is compounded. Even if VB calculates with errors, the converter will need to produce the same errors.
          I, for one, would be glad if the converter could get the form/control locations and sizes within +/- 1 pixel after conversion, this is close enough for me. I think what we are really after here is to get a fairly close, but not exact, representation of a VB form in PB as long as our math does not produce something visually that is totally outrageous.

          I am not sure which is the best way to proceed. Do we convert to Dialog Units or does the converter use twips and dynamically convert at runtime...
          All we are going to have access to are the VB .FRM and .VBP files and whatever unit of measurement that is contained in those files are the same ones we will be stuck with to use in our conversion. I think all we can reasonably do is generate a close approximation of a VB form and we will have to be satisfied with that. As I mentioned before VB 5.0 and VB 2008 appear to use pixels as a base measurement, whereas VB 6.0 uses twips. Right there is another factor that will complicate our conversion too.

          ...The answer to this has nothing to do with continuing to use VB and re-convert a form. It has to do with what makes easier code to work with.
          Agreed.

          On the other hand a seasoned PB developer, that may not know VB, might like everything converted to Dialog Units. This isn't clear though as the code might be difficult to follow as weird values are introduced that don't make sense even to a PB developer.
          Before we tackle this issue I would suggest that we get a working VB form conversion using pixels, before we branch out to other forms of dialog/control units and user options.

          Currently, I think it is better to keep the new VB developer familiar. I may be biased though as I know VB better than I know PB. Maybe the solution is just some documentation about differences between VB and PB.
          I happen to think familiarity is very important for the newly converted VB user. I don't think it is a good idea to bombard them with culture shock all at once of the PB way of doing things.

          Anyway, just my thoughts.
          Later...

          JR

          "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

          Comment


          • #65
            A couple of points, and I think that we should all try it our own way so we work to common ground.

            I for one am in favour of just using a conversion factor, whether to pixels or dialog units, and I favour dialog units at the moment. This is sorta like liking blonds until a hot red head comes along.
            In other words let the user make the adjustment as long as the controls, pictures, etc are all within the window dimensions(both in the VB code and the PB code), spaced relatively with the ratio used for conversion. This doesn't sound too clear, but the idea is to get everything close to original intent.

            I happen to think familiarity is very important for the newly converted VB user.
            This will work against the user if the user is anything like me. I think they need to see how the new and different(PB) creates something similar to the familiar old.

            It seems that we've ventured to become teachers, gurus, instead of just converters. This may be natural progression.
            Rod
            In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

            Comment


            • #66
              This is true if scalemode is twips. If scalemode is pixel (confirmed), decimal pixels are allowed.

              Of course, 100.4 is at positioned 100 and 100.5 (value changed to 100.533) is at position at 101.


              Originally posted by John R. Heathcote View Post
              Brian,

              I seem to remember that form/control values for location and size are rounded up/down to the nearest integer, at least the values that show up in the various property windows.

              Comment


              • #67
                PB and VB Identical Files with sources for comparison

                Ok, I had a few minutes tonight so I created a PB Form using PB Forms and a VB Form using VB on the same screen and made sure they were the EXACT same size the same verbage, look and behave exactly the same.

                This means if you execute each .exe they will be identical - this also means you will have to call task manager to close the application when done.

                Then I gathered the corresponding text sources the .vbp/.vbw files and pb files and zipped up each in its own zip file the name is TESTFORM1 with PB or VB added to the end to indicate which is which.

                So here they are. I have not analyzed any of the info just made sure both were exactly the same. When I used PBFORMS I did not make any changes to the default settings that were set when PBFORMS was installed so whatever they are they are.

                Hope this helps someone.
                Attached Files
                LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

                Comment


                • #68
                  Wayne

                  Very nice. The size (W x H) gives a pretty direct correspondence that we can use for a base.
                  Ratios: (Dialog units)
                  Height 6360:261-----24.37:1
                  Width 10065:447----22.g2:1
                  Ratios: (Pixels)
                  Height 6360:424------15:1
                  Width 10065:670-----15:1

                  When I checked the MSDN the term StartUpPosition said that 3 was x=0, y=0 therefore one question, does the inclusion of values for 'ClientTop' and 'ClientLeft' override the StartUpPosition? Not important just yet, just curious.

                  I think too that the LinkTopic= "Form1" is a rough equivalent of %IDD_DIALOG1
                  I don't understand why ScaleWidth and ScaleHeight are needed if the window isn't resizable so I assume that it puts them there, needed or not.

                  Nice job, since I don't have VB I couldn't do dat.
                  Last edited by Rodney Hicks; 9 Oct 2008, 12:55 AM. Reason: Put spaces in so the characters didn't form emoticons
                  Rod
                  In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                  Comment


                  • #69
                    Bringing some more joy to the aspect of twips/pixel/dialog unit fun is the following style for DIALOG NEW
                    %DS_SETFONT
                    The font to be used by a DDT dialog and its controls can be predetermined with the DIALOG FONT statement. If the DIALOG FONT statement is not used, the default font (MS Sans Serif, 8 point) is used. The size of the dialog font proportionately affects the conversion of dialog units values into pixels, so an increase in default font size will automatically create a larger dialog, even through the dialog dimensions have remained constant. As child controls are added to a %DS_SETFONT dialog, they will be sent a %WM_SETFONT message to ensure they also make use of the specified dialog font. DDT dialogs are always created with this style. (default)
                    This may also be true of VB, I do not know.
                    Rod
                    In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                    Comment


                    • #70
                      Testform DDT / SDK Code as generated by PBWINSPY 1.17

                      I thought it was also interesting to compare the PBWINSPY v1.17 code generated in both DDT and SDK for the same TestformPB application. Here is what it created.


                      PBWINSPY 1.17 DDT STYLE CODE FOR TESTFORMPB

                      Code:
                      DIALOG NEW 0, "Dialog1PB", , , 447, 261, _
                                    %WS_POPUP OR %WS_VISIBLE OR %WS_CLIPSIBLINGS OR %WS_CAPTION OR _
                                    %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT OR %DS_MODALFRAME, _
                                    %WS_EX_DLGMODALFRAME OR %WS_EX_CONTROLPARENT OR %WS_EX_WINDOWEDGE TO hDlg
                        'Note: in PB/WIN 7.0 and later, you can also use DIALOG SET ICON hDlg, newicon$
                        'For icon from resource, use something like, LoadIcon(hInst, "APP_ICON")
                        DIALOG SEND hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
                        DIALOG SEND hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
                      PBWINSPY 1.17 SDK STYLE CODE FOR TESTFORMPB

                      Code:
                        hDlg = CreateWindowEx(%WS_EX_DLGMODALFRAME OR %WS_EX_CONTROLPARENT OR %WS_EX_WINDOWEDGE, szClassName, "Dialog1PB", _
                                    %WS_POPUP OR %WS_VISIBLE OR %WS_CLIPSIBLINGS OR %WS_CAPTION OR _
                                    %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT OR %DS_MODALFRAME, _
                                    (GetSystemMetrics(%SM_CXSCREEN) - 677) / 2, _
                                    (GetSystemMetrics(%SM_CYSCREEN) - 450) / 2, _
                                     677, 450, 0, 0, GetModuleHandle(""), BYVAL %NULL)
                      It will be interesting to see if PBWINSPY 1.17 generates the same code over the TESTFORMVB application since they are both the same.
                      LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

                      Comment


                      • #71
                        Code from PBWINSPY 1.17 for VBTESTFORM

                        Most interesting, most of it is the same just a line or two initially is different.

                        PBWINSPY 1.17 DDT Code for TESTFORMVB

                        Code:
                          DIALOG NEW 0, "Dialog1VB", , , 447, 261, _
                                      %WS_VISIBLE OR %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN OR %WS_CAPTION, _
                                      %WS_EX_APPWINDOW OR %WS_EX_WINDOWEDGE TO hDlg
                          'Note: in PB/WIN 7.0 and later, you can also use DIALOG SET ICON hDlg, newicon$
                          'For icon from resource, use something like, LoadIcon(hInst, "APP_ICON")
                          DIALOG SEND hDlg, %WM_SETICON, %ICON_SMALL, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
                          DIALOG SEND hDlg, %WM_SETICON, %ICON_BIG, LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
                        PBWINSPY 1.17 SDK Code for TESTFORMVB

                        Code:
                         hDlg = CreateWindowEx(%WS_EX_APPWINDOW OR %WS_EX_WINDOWEDGE, szClassName, "Dialog1VB", _
                                      %WS_VISIBLE OR %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN OR %WS_CAPTION, _
                                      (GetSystemMetrics(%SM_CXSCREEN) - 677) / 2, _
                                      (GetSystemMetrics(%SM_CYSCREEN) - 450) / 2, _
                                       677, 450, 0, 0, GetModuleHandle(""), BYVAL %NULL)
                        LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

                        Comment


                        • #72
                          From those figures we should be able to create a conversion ratio to use. Nifty idea to use WinSpy.
                          Rod
                          In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                          Comment


                          • #73
                            To All:

                            While attempting to deal with the VB files at a project level I came to the realization that there will be two basic conversion methods where the level of automation will be somewhat different from the other, but nothing the user will not be able to handle.

                            The first method is to scan the VB Project file (.VBP), gather up the necessary data from this file and set up the conversion accordingly, create PB files, fill in the blanks, etc. The .VBP file provides a basic starting point via a start up form or Main() procedure from which to begin building the conversion for the project. It should also be possible to order the files to be converted so the entire VB project could be converted at once. This option could be highly automated, or be a user defined option. I see this option being used to create a basic framework of PB files that would be compiled to a complete application.

                            The second method is to allow the user to convert VB files on a file by file basis by simply loading a particular file in the editor and running the Tokenizer. This option is less automated requiring more interaction from the user, but would be more flexible and provides the user more control opver the conversion process. This method allows the user to convert files from a variety of locations. I view this option being used to convert a limited number of VB files to be used in another project.

                            I can see advantages and disadvantages to both scenarios, but I would like to get your feedback on this issue as I am in the process of coding the project related stuff right now. I didn't want to get too far into my project coding efforts if this isn't a direction the group wants the converter to take.
                            Later...

                            JR

                            "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                            Comment


                            • #74
                              John,
                              The first method is to scan the VB Project file (.VBP), gather up the necessary data from this file and set up the conversion accordingly,
                              Funny that you should be posting this now. I was having similar thoughts as I perused just how to set up my Diagnostic app.

                              The second method is to allow the user to convert VB files on a file by file basis by simply loading a particular file in the editor and running the Tokenizer.
                              This is a good idea, to have the option to go whole project, selected file. While attempting to figure out what goes on in a VB app, I've noticed that some of the stuff would convert rather quickly, and really doesn't even need the much of the Visual component. Almost a cut and paste into a new PBForms layout even.

                              I am in the process of coding the project related stuff right now. I didn't want to get too far into my project coding efforts if this isn't a direction the group wants the converter to take.
                              I would carry on with this if I were you, we're going to need it and with it some of the other little wiggly issues may fall into place a little better. I can't see how we can make the full project converter without this stuff, and that is our main goal.

                              Just for clarification, I am using a list of seven file extensions VBP, FRM, CTL, CLS, BAS, BI, INC. I have not actually encountered a BI or CLS yet in my studies but Stan had it in his list so I included it in mine. Are there any others we should be aware of(text type)?
                              Rod
                              In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                              Comment


                              • #75
                                Conversion

                                Why not provide an option box and let the user decide which way to do the conversion. This will provide the most flexibility based upon the complexity of the project to convert. This will also allow you to develop the file conversion aspect first then when satisfied with its results check the box allowing full conversion automatically. Both could be developed at the same time allowing you to start with the file conversions then just partially code the full conversion and test it as the file conversions/project conversion proceeds to maturity.

                                When offered a choice BOTH options is ALWAYS a better choice then this one or that one

                                LEARNING EXPERIENCE: What you get when you didn't get what you THOUGHT you wanted!

                                Comment


                                • #76
                                  Wayne,

                                  Why not provide an option box and let the user decide which way to do the conversion.
                                  This would be one way to do it, another would be through the "OPEN" file command (single file conversion), or through the "OPEN PROJECT" command (project conversion). The latter is what I've opted for as it keeps the setup functionality separate from each other by design.

                                  When offered a choice BOTH options is ALWAYS a better choice then this one or that one
                                  This was my thought too.

                                  Rod,

                                  I would carry on with this if I were you, we're going to need it and with it some of the other little wiggly issues may fall into place a little better. I can't see how we can make the full project converter without this stuff, and that is our main goal.
                                  Will do. Just wanted to check in with the group with my efforts so far.
                                  Later...

                                  JR

                                  "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                  Comment


                                  • #77
                                    Somewhere, sometime, in the development of this converter we're going to need a list of messages generated by Windows, and this link is to a fairly comprehensive list in the twentieth post.
                                    http://www.powerbasic.com/support/pb...essages&page=2
                                    Rod
                                    In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                                    Comment


                                    • #78
                                      Has anyone implemented a method of tracking multiple form conversion for the purpose of variable and procedure renaming, equates, etc.? As I was fiddling with my code I came the the realization we need to keep track of converted VB forms to avoid unwanted side effects and to insure everything VB that is supposed to be altered is altered for PB.

                                      If you have implemented such a method how did you do it? I think we need to keep this type of tracking mechanism standardized too.
                                      Later...

                                      JR

                                      "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                      Comment


                                      • #79
                                        John, Rod, and all;

                                        I've been off the reservation for awhile now, so I'm not current on everything. Just looked in on the forums this evening from the Mile High City (Boulder). I've got some time to myself tomorrow, so I'll try to catch up. It might keep me from spending any of that hard earned cash I've been piling up in the corner.

                                        Here are 2 of the include files I'm working with right now. I use GLOBAL arrays to track these things. The first code is vb2pbGlobals.inc and the second is vb2pbTypes.inc so you guys can see what I'm trying to track. I haven't been thinking about VB forms as much as you have, so if you think we need to track more info, feel free to modify. Just keep me posted so I can keep up with you guys.... or at least tell which way you went with it.

                                        You may notice some GLOBALS and TYPES that we decided not to use. I've left them in for development just in case it turns out later... well, you know. Also, I've fallen out of the habit of dating the files... reverted back to my old habit of using the last modified date to track files on my system. Apologies if this causes any confusion. The last time I modified these files was yesterday, 10/31/08.

                                        vb2pbGlobals.inc
                                        Code:
                                        'vb2pb GLOBAL definitions
                                        
                                        GLOBAL gVbProjectName AS STRING                  'what it says  :)
                                        GLOBAL gParseReportFileList AS STRING            'holds files to be processed by Tokenizer
                                        
                                        GLOBAL gPropertyArray() AS PropertyType          'use these arrays only for
                                        GLOBAL gFunctionArray() AS MethodType            '   properites, functions,
                                        GLOBAL gEventArray() AS EventType                '   events, variables, and
                                        GLOBAL gClassArray() AS ObjectSimulatorType      '   variants contained in
                                        GLOBAL gVariableNames() AS VariableNamesType     '   current VB6 project.
                                        GLOBAL gVariantNames() AS STRING
                                        
                                        GLOBAL gConverterOptions AS ConverterOptionsType
                                        
                                        GLOBAL gPBWinSubFolder   AS STRING               'completed PBWin project files go here with ".bas" or ".inc" extension
                                        GLOBAL gpbSourceFileList AS STRING               'intermediate PBWin files with ".pbas" or ".pinc" extension
                                        GLOBAL gConcordance() AS ConcordanceType         'array for VB & PB code lines w/indexed line nos.
                                        
                                        GLOBAL gMainWindow AS DWORD                      'hDlg for the main Tokenizer window
                                        GLOBAL gSaveOptionsWindow AS DWORD               'hDlg for the Tokenizer save window
                                        
                                        GLOBAL gTokenizerStatus  AS LONG                 'current program status
                                        GLOBAL gPreviousStatus AS LONG                  'previous program status
                                        GLOBAL gAutoDelay AS LONG                       'converter autodelay between processing steps
                                        GLOBAL gAutoPause AS LONG                       'converter pause interval
                                        GLOBAL gProjectIsSaved AS LONG                  'curremt save status of current project
                                        GLOBAL gProjectIsParsed AS LONG                 'current parse status of current project
                                        GLOBAL gParseReportFileList AS STRING           'list of parsed files in current project
                                        
                                        
                                        'Editor/Converter Message Queue
                                        GLOBAL gMessageQueue() AS MessageType               'message queue
                                        GLOBAL gVbCodeBlock AS STRING                   'VB6 code to be converted
                                        GLOBAL gPbCodeBlock AS STRING                   'converted PBWin code
                                        
                                        'vb2pb Directories
                                        GLOBAL gVbProjectFiles AS STRING                'delimited string
                                        GLOBAL gPbOutputFiles AS STRING                 'delimited string
                                        
                                        'initialize global objects
                                        GLOBAL oConverterInterface AS MessageInterface      'initialize internal object for communication with editor
                                        GLOBAL oEventHandler AS MessageEvents               'initialize internal object for event handling
                                        vb2pbTypes.inc
                                        Code:
                                        'Type structures
                                        '=====================
                                        
                                        
                                        TYPE PropertyType                   'use in PropertyArray(); property list developed in first run through VB code
                                            vbTerm AS STRING * 32
                                            VarType AS LONG                 'use equates above
                                            DefaultValue AS STRING * 32
                                            Scope AS LONG                   'use equates above
                                            Comment AS STRING * 128
                                        END TYPE
                                        
                                        TYPE MethodType                     'use in MethodArray(); find in first run through Vb code
                                            vbTerm AS STRING * 32
                                            ProcedureType AS LONG           'use equates above
                                            ReturnType AS LONG              'use equates above
                                            Prototype AS STRING * 256
                                            Comment AS STRING * 128
                                        END TYPE
                                        
                                        TYPE EventType                      'use in EventArray(); find in first run through
                                            vbTerm AS STRING * 32
                                            OccursOn AS LONG                '*** need to develop list, possibly from the VB source?
                                            ReturnType AS LONG              'use equates above
                                            DefaultValue AS STRING * 32
                                            Comment AS STRING * 128
                                        END TYPE
                                        
                                        TYPE ObjectSimulatorType            'use in ClassArray(); first run through
                                            ObjectName AS STRING * 32
                                            ObjectType AS LONG              'use equates above
                                            Properties AS STRING * 256
                                            Methods AS STRING * 256
                                            Eventss AS STRING * 256
                                            Comment AS STRING * 128
                                        END TYPE
                                        
                                        TYPE VariableNamesType              '1st run thru
                                            Variable AS STRING * 32
                                            VarType AS LONG                 'use equates above
                                        END TYPE
                                        
                                        TYPE pbProcedureTemplateType
                                            ProcName AS STRING * 32
                                            ProcType AS LONG                'use equates above
                                            ProcText AS STRING * 512
                                        END TYPE
                                        
                                        TYPE ParsedCodeType
                                            LineNo AS LONG
                                            TermNo AS LONG
                                            Term AS STRING * 32
                                        END TYPE
                                        
                                        TYPE pbPseudoCodeType
                                            LineNo AS LONG
                                            TermNo AS LONG
                                            Term AS STRING * 32
                                            DictionaryRef AS LONG       'use physical record # for now
                                        END TYPE
                                        
                                        TYPE DictionaryRecordType       'modified from Rod's example below
                                            reference AS LONG           'ref # for the word ? -- Dictionary record # ?
                                            vbTerm AS STRING * 64       'any VB term
                                            level AS LONG               'level of complexity
                                            pbTerm AS STRING * 64       'mathcing PB term
                                            termType AS LONG            'type of complication ? -- type of term ?
                                            pointerToCode AS DWORD      'self descriptive
                                            params AS LONG              'params for pointerToCode if needed
                                            Comment AS STRING * 128     'possibly used for comment insert to PB source file
                                            location AS LONG            'placement of PB term in code
                                            referral AS LONG            'xRef to other term/s
                                            reserved1 AS LONG
                                            reserved2 AS LONG
                                            reservedStr1 AS STRING * 256
                                            reservedStr2 AS STRING * 256
                                        END TYPE
                                        
                                        
                                        '==============================================================================
                                        '   *** NEW DICTIONARY DEFINITIONS FROM ROD *** 7/26/2008
                                        '==============================================================================
                                        #IF 0   'original prototype commented out to minimize necessary code changes elsewhere
                                        TYPE VBterminPB AS whatever
                                          reference AS LONG           'reference number for the word- do we want to make them equates???
                                          VBterm AS STRING*32         'any VB term, keyword, function, reserved word, constant, etc.
                                          level AS LONG               'level of complexity see below
                                          PBterm AS STRING*32         'the matching PB term
                                          termtype AS LONG            'type of complication
                                          pointertocode AS LONG       'just what it says
                                          params AS LONG              'for parameter info to above if required
                                          comment AS STRING*128       'comment string, possibly used in code if not too verbose
                                          location AS LONG            'where the PBterm should be in code see below
                                          referral AS LONG            'for referring to another term
                                          reserved1 AS LONG           'reserved- for use in difficult times
                                          reserved2 AS LONG           'reserved- for use in even worse times
                                          reservedStr1 AS STRING*256    'reserved- for saying what we think of it all
                                          reservedStr2 AS STRING*256    'reserved- for jokes, comedic efforts and the like and things that aren't funny but should be
                                        END TYPE
                                        #ENDIF  'end of original TYPE prototype
                                        '=================================================================================
                                        
                                        TYPE SpecialTermsType
                                            Term AS STRING * 32
                                            LineNo AS LONG
                                        END TYPE
                                        
                                        TYPE ConstantsType
                                            Constant AS STRING * 32
                                            LineNo AS LONG
                                            Value AS LONG
                                        END TYPE
                                        
                                        TYPE ConverterOptionsType
                                            DefaultArrayBase AS LONG            '0 or 1
                                            CaseInsensitiveCompare AS LONG      '%False = Normal PBWin compare, %True = case insensitive compare (UCASE$ required)
                                            DimAll AS LONG                      '%False = OPTION EXPLICIT not present in VB code, %True = present
                                            PrivateModule AS LONG               '%False = OPTION PRIVATE MODULE not present in VB coe, %True = present
                                            LineByLineProgress AS LONG          '%True = user selected, %False = very fast, if any, updates
                                            LineByLineEdit AS LONG              '%True = user wants to go slow, %False = user wants to edit later
                                            pbStyleEquates AS LONG              '%True, %False = insert "MACRO CONST = MACRO" and %UseMacros = %True to preserve VB6 style constants
                                            WholeFileConversion AS LONG         '%True = file will be converted without intermediate feedback, %False = convert a VB6 string of x lines
                                        END TYPE
                                        
                                        TYPE ConcordanceType                    'use in Concordance() to keep track of which VB line matches which PB line
                                            vbLineNo AS LONG
                                            vbCodeString AS STRING * 256
                                            pbLineNo AS LONG
                                            pbCodeString AS STRING * 256
                                        END TYPE
                                        
                                        TYPE DirDataType                        'PBWin structure for directory data returned from DIR$
                                          FileAttributes        AS DWORD
                                          CreationTime          AS QUAD
                                          LastAccessTime        AS QUAD
                                          LastWriteTime         AS QUAD
                                          FileSizeHigh          AS DWORD
                                          FileSizeLow           AS DWORD
                                          Reserved0             AS DWORD
                                          Reserved1             AS DWORD
                                          FileName              AS ASCIIZ * 260
                                          ShortName             AS ASCIIZ * 14
                                        END TYPE
                                        
                                        
                                        TYPE MessageType
                                            SendTo AS LONG              '%Editor or %Converter or %MikesGUIThingy
                                            SentFrom AS LONG            '%Editor or %Converter or %MikesGUIThingy
                                            MsgGrp AS LONG              'one of %INFO, %WARNING, %ERROR, %FATALERROR (see vb2pbEquates.inc for list)
                                            MsgID AS LONG               'a value from the message list in vb2pbEquates.inc
                                            ResponseTo AS LONG          'OPTIONAL - array index of message this one responds to
                                            ResponseReqd AS LONG        'OPTIONAL - %True or %False
                                            ResponseRcvd AS LONG        'OPTIONAL - %True or %False
                                        END TYPE
                                        I'm concentrating on the internal messaging for VB2PB right now. When you identify a message that you need to include in the list, please post it so we can all read off the same page.

                                        I've finally figured out PB 9 objects. I'm using a Message object to handle the gMessageQueue() and an Event object to trigger message alerts. The last TYPE in the second file is what the gMessageQueue() looks like. More as soon as I get it working properly.

                                        Stan
                                        Do not go quiet into that good night,
                                        ... Rage, rage against the dark.

                                        Comment


                                        • #80
                                          Stan,

                                          Just so you know the Mile High City is Denver, not that other city you mentioned.

                                          My basic questions concerning tracking is based on the fact the converter will be using multiple passes, possibly at different times and/or steps during the conversion process. This being the case we must keep track of the processes and status of the converter at any given point in time. The reason for this is to account for the possibility of the user stopping the converter to make some changes in the converted code in the editor, then starting the converter again.

                                          An example of this would be converting a form, then maybe converting a module file, then back to another form. Where the tracking comes into play is when a module file, or even another form, potentially calls a procedure or VB event contained in the first form file. We have to know what variables and procedure names have been changed so the proper call can be made throughout the conversion process. Tracking also applies to equates and anything else where those values and strings may be carried forward to another form or module.

                                          Been thinking a lot about this feature in the shower. I have an idea, but I would like to get other thoughts on this issue too.
                                          Later...

                                          JR

                                          "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                          Comment

                                          Working...
                                          X