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?
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?
Comment