Announcement

Collapse
No announcement yet.

compiler question

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

    compiler question

    I am not finding the compiler manual in the docs. Seems like it should be simple, but it really isn't explicit IMO.

    I find I am using -D more and more.
    Code:
    mvc -D SYMBOL[-D ANOTHER_SYMBOL] source.mv
    What is the correct command line syntax?

    Is it:
    Code:
    -D sympbol1 symbol2
    or
    Code:
    -D sympbol1 -D symbol2
    I've assumed the square brackets aren't included.

    Scott

    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    for what its worth, none of my batch files I use for compiling have brackets around anything.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Why are you defining so many tokens in your program? The correct syntax would be mvc -D token1 -D token2 ... file.mv
      David Carver
      Miva, Inc. | Software Developer

      Comment


        #4
        Are you asking why as a use case or curiosity?

        Thanks. Yes, I just realized, if you leave out the -D before the second symbol the compiler is looking for a folder that doesn't exist.

        Scott
        Need to offer Shipping Insurance?
        Interactive Design Solutions https://www.myids.net
        MivaMerchant Business Partner | Certified MivaMerchant Web Developer
        Competitive Rates, Custom Modules and Integrations, Store Integration
        AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
        My T-shirt Collection is mostly MivaCon T-shirts!!

        Comment


          #5
          Curiosity
          David Carver
          Miva, Inc. | Software Developer

          Comment


            #6
            Initially, it would be for debugging code. But, as I do more integration services, the module portion sometimes needs targeted code that is specific to the client. Instead of having multiple versions of the module, I use it to keep everything in one set of source code. I needed multiple symbols to be able to compile debug and/or targeted versions. I can then control what is compiled via batch files. For me, it's more straightforward than creating branches in a version control system for instance because it's usually not "core" functions that need to be included or not included in the compiled module.

            Scott
            Need to offer Shipping Insurance?
            Interactive Design Solutions https://www.myids.net
            MivaMerchant Business Partner | Certified MivaMerchant Web Developer
            Competitive Rates, Custom Modules and Integrations, Store Integration
            AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
            My T-shirt Collection is mostly MivaCon T-shirts!!

            Comment


              #7
              Scott, will you give me an example of a scenario in which you are using the -D flag to compile different code for different clients? Is it kind of like using the MvINCLUDE tag but having different sets of include files based on what you need for the particular integration?
              M.A.D.* since 1997

              http://www.scotsscripts.com

              *miva application developers

              Comment


                #8
                Hey Scot,

                Code:
                <MvCOMMENT>-SDS-- </MvCOMMENT>
                <MvIFDEF NAME="SOUTHBOUND">
                        Some specific code here
                </MvIFDEF>
                This is basically how I compile a module, -D when I need to do or include something specific somewhere in the code, even inside a function. My tools module is a great example because it's actually a real module where I can be specific if the module is needed for a client build and don't want to include any prototype functions or functions that would never apply.

                Code:
                mvc -D SOUTHBOUND -o ids_tools.mvc myproj.mv
                With multiple -D capability, which I never realized available I can now do this:

                Code:
                mvc -D SOUTHBOUND -D SHOWJSONVARS -o ids_tools.mvc myproj.mv
                This is the myproj.mv:

                Code:
                <MvINCLUDE FILE="file1.mv">
                <MvINCLUDE FILE="schedtasks.mv">
                <MvINCLUDE FILE="core.mv">
                <MvINCLUDE FILE="required.mv">
                The compiler does a great job of telling what file and line # it detected an error.

                I haven't organized any project this way -- yet, but as you suggest, I will be considering using MvIFDEF in the project file in the future.

                It's all very flexible. Flexibility is needed when I have many old projects that never had any organization and everything was a "make-from" based project. Also, IMO, there would be a lot of work with code and files and adjusting a MAKE File if I decided to try and use something that again. IFDEF and INCLUDES have made it easier to resurrect much of that older code and there is less re-inventing of the wheel. Still, are there better ways? Likely...

                Scott




                Need to offer Shipping Insurance?
                Interactive Design Solutions https://www.myids.net
                MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                Competitive Rates, Custom Modules and Integrations, Store Integration
                AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                My T-shirt Collection is mostly MivaCon T-shirts!!

                Comment


                  #9
                  AH, that's what those ifdefs I see are. Thanks for the explanation, finally puts it together for me.
                  M.A.D.* since 1997

                  http://www.scotsscripts.com

                  *miva application developers

                  Comment

                  Working...
                  X