ok this may sound a trifle odd.

a project i'm currently working will be vastly more user friendly if for example a user can enter into a date box 'today' instead of a date. this has resulted ina little bit of a script language being written, *very* crude.

to date there are a handful of functions, eg a 'today' function that is converted to todays date etc. pretty simple stuff.

i have (essentially) two strings, one for input and one for output (eventually the output will be written to a file).

the string is examined via a basic tokeniser, all commands are wrapped in '{$' & '$}' e.g. {$today$}, plain text between the commans is treated as a single token no matter how long.

this bit works.

then there is a parsing function that actually reads it, does a bit of a lookup in a command array to execute commands, with the capacity to pass each one any paramters *and a code fragment* thus a 'command' can have a closing marker, indicating what bit of the string it should affect, with parameters to tell it *how*

thus we get

{$foreach parameters $} some text to play with{$next$}

which will result in the 'foreach' function being called with 'parameters' and being given thr text shown to play with.

this works

it even handles nested commands well enough for me.

the problem is coding some of the commands, specifically actually writing a 'for' and 'if' function. having got this far i'm wondering if theres anyone whos coded anything similar... either vba or plain old vb (i'm limited to vba here at the mo, but vb will be good for ideas).

basically it works as long as the string/script input requires no loops or flow control, both of which will be very useful.

btw. there are two aims for this, the first is writing SQL from a more friednly language (e.g. no requirement for the user to know about the data structures) the other is in creating html reports from templates.

reckon tis around 20% completed, well the core structure is, but until i've got conditionas & loops i'm not adding more commands yet.

any info?