PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

New string feature.

I will be adding support for evaluated strings in the next release of PPL. Any strings enclosed within the single quotes ' ' will be treated as:

1. Character ASCII value if only one character in the string.

2. Or an evaluated string if more than character are found in the string.

Example:

Code:
a$ = 'A'; // a$ = 65

a$ = 'PPL version {version%}'; // a$ = "PPL version 0.8"

a$ = "Hello";
b$ = '{a$} World!'; // b$ = "Hello World"

a$ = "Result of 10 + 20 = {10+20}"; // a$ = "Result of 10 + 20 = 30"


I hope people will like it, it will mostly be slower than a normal string but will offer a huge amount of flexibility.
I finished implementing this new feature today. It's great.

Code:
ShowMessage('The result of 10+20={10+20}');


You can write any PPL code that returns a value within the {}.
Looks great.
PointOfLight · 14 Nov 2005, 00:39 UTC
So can I assume you can place any variable between the {} and have it be evaluated? If so, you're my new best friend all over again (this is a PHP feature that I so miss in many other languages).
Yep, a variable or a PPL expression, even a full program if you want!
PointOfLight · 14 Nov 2005, 20:59 UTC
If I wasn't married I'd ask you to have my children... well, hopefully you get what I mean :oops:
:lol: Sorry, I have a daughter already and my youngest one which I should give birth to soon... PPL! :lol: