Referencing extended to Arrays

The new variable referencing facility has been extended to arrays and even array references… I’ve tested it even on function parameters and it seems to work which is awesome… exhaustive testing has not been done ‘cos, well, nobody seems to use this site much anyway let alone code as deeply as using reference variables (check out my tiny violin), but trust me, it’s pretty impressive stuff, and highly useful.

One tiny note:
You cannot reference individual array elements, because I haven’t REALLY implemented dereferencing properly, you can only reference the whole array and index it from there, e.g.

$x=(5,4,3,2,1);
$z=\$x[0] ;
&print $z; ## expecting 5?

…wont work.
Reference the whole thing and dereference the reference as if it were an array like so:

$x=(5,4,3,2,1);
$z=\$x;
&print $$z[0];

New! Reference Variables

Highly experimental but I now have implemented rudimentary Reference Variables and Pass-By-Reference for functions in SEL. For those who are not familiar with references in programming here’s how it is useful e.g.:

$x=5;
$y=\$x; ## $y is now a reference for $x
&print $$y; ## prints 5, note the DEREFERENCING with $$
$x=10;
&print $$y; ## prints 10 since $$y is effectively what $x is

Example of passing by reference to a function:
sub testPBR(\$x){
$$x=20;
return 5;
}

$z=&testPBR(\$x);
&print $x; ## prints 20! This is because $x has been modified in function
&print $$y; ## also prints 20 since $$y is still a reference to $x
&print $z; ## prints 5, this means you can modify as many vars as you like by calling a function and still have the return variable free for use.

Do Not Use Main Editor

The so-called spiffy new editor is not as spiffy as I thought. It will destroy any code requiring literal strings surrounded by apostrophes i.e. most advanced tags will get deleted without as much as a by-your leave.

I’ve only just discovered this. My apologies of you have lost any work. I know I have lost loads. I will rectify it as and when I can recover my faith in the project.

The in-play editor works fine though. Whoop.

Various Updates

Many fixes etc. have happened:

The new Editor is mostly operational without bugs (except the advanced ABML buttons still aren’t working)

You may now edit your Adventures In-Play without having to go to the Editor now

I have stripped the unfortunate extra weird characters that came about due to a botched find and replace in all adventures (there may be some invisible ones left strewn about)…

And probably loads of other stuff since my last News update that I cannot remember. Don’t forget to join the Facebook Group (link is on the Main Menu) if you want more regular and frequent updates and other nonsense chat…

Major Changes

Major Changes to ABML are underway, please see the Reference text, in short at this time:

1) There are no longer ANY ‘singleton’ ABML tags, that is, tags that take the form:

<tag />

Instead now use:

<tag></tag>

2) Boolean Attributes in tags are being replaced with true/false values, that is:

<tag attribute></tag>

is becoming:

<tag attribute=”true”></tag>

or

<tag attribute=”false”></tag> (although this is redundant you can just leave the attribute out)

Change (1) site-wide substitutions have been made (that is, all your tags oughht to have been replaced with the new form automatically by my scripts, hopefully). Change (2) has yet to have the substitutions made, however since you OUGHT NOT to be using the Editor whilst I am making my major updates this ought not to concern you yet. Just remember the language changes for future coding.