Significant enhancements to BC scripting?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    Significant enhancements to BC scripting?

    Is there any chance we will see variables and control structures in BC scripting at some point? I have a need to replicate a master to multiple targets. Since the targets are all supposed to be mirrors, I'd like to be able to do something like the following:

    MASTER=ARGS[0]
    LOCAL_REPLICA=ARGS[1]
    REPLICA_LIST=<remaining ARGS>
    Compare MASTER LOCAL_REPLICA
    Select lt.all rt.orphan.all
    foreach REPLICA in REPLICA_LIST
    copyto lt path:relative REPLICA
    deletefrom rt path:relative REPLICA
    next

    In this example, LOCAL_REPLICA and REPLICA are strings and REPLICA_LIST is an array. ARGS is an array of command line arguments. The 'deletefrom' command is something that would be required for what I'm looking to do.

    So what I'd like to see are:

    o Variables (including at least 1-dimensional arrays)
    o Control structures (if, while, for/foreach)
    o Command-line parameters for scripts

    Nothing too difficult. Can you have it next week?

  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Re: Significant enhancements to BC scripting?

    It is possible to pass command line arguments into scripts.

    To represent command line arguments in scripts, use %1, %2, through %9 just like DOS batch files.

    To call your script for multiple servers, write a batch file that calls the script for each server.

    A more full blown scripting language like you are suggesting is on our long term list of goals for BC, but it isn't something that you're likely to see available in the near future.


    Chris K Scooter Software

    Comment

    Working...