PocketMatrix forums

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

Even more great news!

Well, after announcing the delay with the beta release today, I was able to finish the UI code and test it. It is now very stable compared to before and allow for multiple applications running within the same PPL thread without any problems so far. I will do more testing in the next few days but so far so good.

Also, great news, I will be adding a complete linked-list system fully integrated within the current variable system. A variable could be part of a linked-list and also hold an array or a structure at the same time.

Example 1:
Code:

list(l$); // Create a new linked-list variable
StrToL("A,B,C,D,E,F", ",", l$); // Split a string into a linked-list
ShowMessage(sizeof(l$)); // size is 6. (6 elements).
First(l$); // Go to first element in linked-list l$
while (IsLast(l$) == false) // Loop until the last element of l$
l$ = "Linked List Value "+l$;
ShowMessage(l$);
Next(l$); // go to next element in l$
end;
clear(l$); // free all elements of the list


Example 2:
Code:
list(l$); // Create a new linked-list variable
Add(l$, NULL); // Add a new empty element
dim(l$, 10, 10); // Set element as array
l$[5][5] = "5,5";
l$[0][0] = 0;
Add(l$, "Element 2"); // Add a new element
ShowMessage(l$);
Prev(l$); // go to previous element
ShowMessage(l$[5][5]);
Del(l$); // Delete element
ShowMessage(l$);
Clear(l$);


These are just a few examples to show the power of PPL. I am really exited about this new feature. I hope to finish impementation and testing by mid-next week.

Regards,
Kornalius[/code]
Good news, I just finished implementing the linked-list system into PPL. I have done some testing and so far everything is working nice and smooth. I wasn't expecting such an easy implementation, maybe it's because of the way I kept my source codes; clean, small and optimized. :D

Here is an example of the linked-list system that will be included in PPL:

Code:
// Example on how to use linked-list variables in PPL. Written by Alain Deschenes (c) 2004

list(l$); // Identify variable as being a linked-list type

Add(l$); // Add a new element to the list
l$="String Element"; // Set element value to a string value

Add(l$);
l$=2; // Set element value to a numeric value

Add(l$);
dim(l$, 5, 5); // Make element an array 5,5
l$[1,1] = "Element 1,1"; // Set array element 1,1 to a string value

Add(l$);
struct(l$, RECT); // Make element a struct of RECT
l.left$ = 10;
l.top$ = 10;
l.right$ = 50;
l.bottom$ = 50;

if (First(l$)) // Go to first element in the list
Repeat // Loop until list element is non valid
if (islast(l$)) // If last element in the list
ShowMessage(l.left$+", "+l.top$+", "+l.right$+", "+l.bottom$);
else if (lpos(l$) == 3)
ShowMessage(^l$[1,1]);
else
ShowMessage(l$); // Show element value
end;
Until (Next(l$) == false); // Go to next element if cannot exit loop
end;

if (First(l$))
Del(l$); // Delete element from the list
end;

ShowMessage(Count(l$)); // Show the number of elements in the list


8)

I am very exited about this new feature because it makes the variable system in PPL way more powerfull and so flexible now.

Regards,
Kornalius