veryalien wrote:Some kind of script commands to enhance literal expressions to allow dynamic numerical values would be a great development.
I definitely think that some type of numerical processing ability for generating the results of complex dice-roll-style expressions would be very useful. As you say, it's currently quite convoluted even to generate a number inside a set range, so that's definitely a good idea. I'll give some thought as to an implementation that might work.
veryalien wrote:Allowing calculations and manipulations of storage slot contents would also have a major impact on the functionality.
I'm not sure about this, as I think it starts to push storage slots towards being treated as variables as in a traditional programming language, which would be better achieved by another method if it were to be added. I'd rather keep the text processing as simple/elegant as possible, and encourage Regnus to be used as a module within other languages if more complex processing is required.
veryalien wrote:The addtional commands could allow conditional (if/else), math(rand,sqrt,arithmetic) and string manipulation functions(trim,substr) - so it would itself be a kind of mini scripting language.
I'd probably want to create something a little simpler than a full maths processor, or duplicate existing string processing functionality which doesn't fit into the existing tree-structure of a Regnus script.
It's actually already possible to use existing functionality to perform conditional statements using data from storage slots, by using conditional or exclusion references to select between different results or groups. You could even include a reference which returns no content at all if a certain condition isn't met.
veryalien wrote:Is there any way to force a particular group entry without it being a random result? My brain says that Instead of just using Animal; to always get a random entry from the Animal group, a simple extension would be Animal; to always access entry 2 in the group. Sorry if that's already possible, if it is I didn't find it yet. Maybe this is already possible using other methods?
This isn't currently possible as a built-in function - the way to achieve the effect, if desired, would probably be to add numbered labels to each entry in a group and then use a label reference to return the desired result.
I have to admit that I'm not sure I can think of any obvious use for this type of functionality, though? If you already know the result you want to return, would it not be easier to simply include it as text, rather than via a reference?
veryalien wrote:Automatically stepping through all group entries in an ordered sequence each time a group is accessed would also be a nice feature. Regnus keeps an index of which entry was last accessed and returns the next one in the sequence.
Again, I'm not sure I can think of an obvious use for this, since you're achieving a non-random result? It's already possible to ensure the return of every entry in a group in a random order, but if the object is to return the entries in a set order, would it not be simpler to just add those entries directly to the content, rather than via a reference?
If the aim is to ensure that three selected entries remain in the same order once generated, you could do something like this:
Code: Select all
ENTRY <Repeat Three Names In The Same Order>#>(0):(#&Names;, #&Names; and #&Names;); always referred to themselves in the same order: ##;.
veryalien wrote:As I am writing for web pages I would like to include HTML tags within the Regnus output. I know this can be done in PHP outside of Regnus, but being able to add dynamic HTML and CSS tags and values directly within Regnus would be very useful.
Again, I'm not sure if this is already possible, but HTML tags probably conflict with the Regnus label < > syntax, and they are stripped out, so I don't know how I could format the scripts correctly.
The overstep (escape character) AGC
will do this.
Code: Select all
ENTRY *<p*>This is a paragraph!*</p*>
Edit: perhaps it would be interesting to consider adding some method of switching off parsing of particular characters for an entire entry, rather than necessitating the use of escape characters for every reference? You're quite right that it becomes a little messy when overstepping a lot of AGCs in one entry - especially when dealing with HTML! I'll give it some thought. Ryan