No announcement yet.

PluriBASIC - Conditional #IF statement for form output.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Brian Alvarez
    I have been traveling a lot. If you wish to have PluriBASIC send your email address via PM.

    Leave a comment:

  • Mike Doty
    Also, I have decided to not renew the website and release PluriBASIC 6 as a donation-based IDE. I will prepare a new installer and post it here one of these days.

    Leave a comment:

  • Fim Wästberg
    Where can i download PluriBASIC?
    /Fim W

    Leave a comment:

  • PluriBASIC - Conditional #IF statement for form output.

    Last night I implemented a new feature that will make things easier for working with PHP (for the moment, other platform implementations are planned to follow). I wanted this feature for a long time and i finally added it. This feature is #IF statement support for HTML support.

    So far, the #IF statement was implemented for source code generation (in the binaries), source code compilation (in the main code) and now it is implemented also for HTML code.

    Now you can add #IF statements in your HTML chunks and FORMOUT() will output the code depending on the conditions and the run-time variables.

    For example, lets say you have a form like this:
    #FORM Conditionals, "conditionals.html"
    And the conditionals.html file contains this HTML code:
    #IF Cfg.values = "This is cool"
        <div>First block, [$.cool].</div>
    #ELSEIF SecondBlock
        <div>Second block, [$.cool].</div>
        <div>Third block, [$.cool].</div>
    Then you have an HTML form that will be sent to the browser depending on what these variables contain at run time. For example:
    ' Declares some variables.
    Local SecondBlock as long
    Local Cfg as Config
    ' Sets up some variables at run-time.
    Cfg.values = "This is cool"
    SecondBlock = 2
    $.cool = "This feature is a time saver"
    ' Outputs the form according to that the variables contain.
    CALL FORMOUT(Conditionals)
    This would be the output:
    First block, This feature is a time saver.
    Lets say you change the variable Cfg.values to:
    Cfg.values = "This is too cool"
    Then the HTML output would be:
    Second block, This feature is a time saver.
    Finally lets say we change he variable SecondBlock to:
    SecondBlock = 0
    The HTML output would be:
    Third block, This feature is a time saver.
    This feature saves time and allows to have multiple scenarios of the code without the need of embedding multiple forms and concatenating them manually. Just one variable and the apropriate portion of code can be displayed. The displayed portions of code, of course, can embed other HTML portions or different portions of Javascript code. This allows to focus on what you are doing, instead of how you are doing it.

    This version of PluriBASIC is not uploaded, if you like this feature you can send me an email to get it.