Updates
I will be out of town for the next few days (real vacation for once

). When I get back the following week I plan to release 0.7c and then start working on 0.8.
Here are the new features I want to implement in 0.8 so far:
- ActiveX controls support.
- Visual Form Editor on the PocketPC.
- Ability to run a .ppl program within the same scope as the calling program. Almost like the eval function except it's using .ppl files.
- Finish the Editor Find/Replace dialogs.
Hurrah!
I cant wait for PPC visual form builder! Hope you enjoy a well earned holiday!
Kind regards
andy
Here is a new feature to look for in version 0.8 beta:
- Multiple variable assignment.
Example:
- Code:
// Test multiple assignment
func test
return(10, 20);
end;
proc main
a$ = 10;
a$, b$, c$ = test, 30;
ShowMessage(a$+","+b$+","+c$); // display "10,20,30"
a$, b$, c$ = test;
ShowMessage(a$+","+b$+","+c$); // display "10,20,0"
a$, b$, c$ = 10, 20, 30;
ShowMessage(a$+","+b$+","+c$); // display "10,20,30"
end;
Here are some new features to look for in v0.8.
Example:
- Code:
// String operators test
a$ = "ABCDEFGH";
ShowMessage(a$[1,2]); // "BC"
ShowMessage(a$[0,2]); // "AB"
ShowMessage(a$[3,0]); // "FGH" takes value from the right instead.
ShowMessage("ABCD" + 10); // "ABCD10"
ShowMessage("10"+10); // 20
ShowMessage("ABCDBCDBCD" - "BC"); // "ADDD" removes all occurences of "BC"
ShowMessage("ABCD" - 2); // "AB" removes 2 characters from the end
ShowMessage("10" - 5); // 5
ShowMessage("ABC" * 3); // "ABCABCABC"
ShowMessage("ABC" * 1); // "ABC"
ShowMessage("ABC" * 0); // ""
ShowMessage(3 * "ABC"); // "ABCABCABC"
ShowMessage("10" * 2); // 20
a$, b$, c$ = "ABCDEFGHIJ" / 3;
ShowMessage(a$+","+b$+","+c$); // "ABCD", "EFGH", "IJ"
Edit: Added some comments and the indexing on strings in the code.
Here we go, time for another update:
- Regular expressions functions: Match(), Search()...
- Ability to pass output arguments in COM Invoke() function.
- Editor.ppl now has Find, Find Next, Replace, Replace Next fully working.
- Rewrote the PIDE source code formatter from scratch.
- Rewrote the internal debugger in PPL. Should be more stable now.
- New operators: += -= *= and /=
- New SetWaitCursor() function.
- Removed CheckMenu, MenuChecked, EnableMenu, MenuEnabled, GetSubMenu functions. They are all accessible through Windows API.
- Structures doesn't allow for duplicate element names.
- Some optimizing and more bug fixes...
What to do before the beta release:
- Finish Visual Form Builder on the PocketPC. About 15% done so far.
- I need to make a nice word page to promote PPL and it's key features. I would like to do a major promotion for version 0.8. Anybody has experience and/or ideas to help me with this?
It is now possible to type variables in PPL to use with API functions.
Example:
type(integer$, TINT);
type(string$, 50);
type(byte$, TBYTE);
- Code:
type(startpos$, endpos$, TINT);
PostMessage(e$, EM_GETSEL, &startpos;$, &endpos;$);
ShowMessage(startpos$);
Before you had to do this:
- Code:
struct(startpos$, "result", TINT);
struct(endpos$, "result", TINT);
PostMessage(e$, EM_GETSEL, &startpos;$, &endpos;$);
ShowMessage(startpos.result$);
Kornalius, Hi!
Would use of the typed variables (say, int) be any faster in practice for general programming? ie. Do they bypass any code used to administer typeless vars?
btw, really looking forward to the next release and indeed the full version 1.0!
Kind regards,
Andy.
Hi,
I don't know if the use of typed variables would be faster. A good test would be:
- Code:
type(i$, TINT);
t$ = tick;
i$ = 0;
repeat
i$ = i$ + 1;
until (tick-t$ >= 10000)
ShowMessage("Typed variable iterations per second" + i$ / 10);
Clear(i$);
t$ = tick;
i$ = 0;
repeat
i$ = i$ + 1;
until (tick-t$ >= 10000)
ShowMessage("Normal variable iterations per second" + i$ / 10);
Btw, I will run this test later and let you know once the typed variable's internals are fixed.
Think it's about time for a new update...
Things have been going pretty smoothly implementing the matrix system.
Tomorrow I will implement a few more matrix functions and finish it up.
I will also rewrite a few very critical internal routines to be more optimized. I have all this planned on paper, ready to be coded.
Early next week.
I will make the PIDE compatible with the Intel PC version of PPL. And I will work on the re-open menus a bit.
The Visual Form Builder written in PPL is what will hold the release of 0.8 for a later date. It is still in early stage and I need to finish it up before 0.8 comes out.
Then I need to prepare a nice PPL ad to post on the internet and post all the great PPC sites the news of PPL 0.8 release.
If everything is going smoothly, we can expect a open-beta 0.8 around the 22nd to 25th of September. Don't forget, 0.8 is huge in new features and enhancements.
Sorry for the delay in the pre-release guys, it should be available on the weekend of early next week at the most. I plan on making the PC version available as a pre-release as well before 0.8 comes out. Anyone interested?
I'm game. It would be cool to be able to write apps in the same language that can work between the PC and PocketPC. Will the PC version have available any of the commands that let a PC app do things like transfer files to the PPC?
Thanks for the update ... sounds good.
I'll be happy to test run the PC stuff also. Looks like there's a lot of new stuff to test out in this next pre-release.
Great. Then the PC version pre-release will be available at the same time as a seperate download. The PC version will allow faster debugging and faster execution. All the PPL programs that I have written so far are working on the PC and PPC with VERY LITTLE code modification. The are some functions not available on the PC, like the SIP functions.
Today I have optimized PPL, fixed a few demos that weren't working on the PC version and enhanced the PIDE quite a lot. It is now possible to do all the development (fast debugging! Yahoo!) on the PC using the PC version of PPL. Just by toggeling an option you can switch between PC and PPC compiling.
Oh yeah, I worked on the Visual Form Builder for the PPC and things are looking a bit better now.
Sunday might be the day for the long-delayed (wow, first major delay in PPL's history I think!

)pre-release of beta 0.8.
Not that every enhancement you do isn't awesome, but I think the ability to compile / debug PPL on the PC first is going to be the best one ever! I can't wait to test all this new functionality out! What did you find out about PocketFrog's compatability with PC?
PocketFrog/PocketHAL and Hekkus Sound System are fully operational on the PC. However PocketFrog cannot run fullscreen at this moment, we are trying to get this resolve soon. The developer should be back from vacation soon (well I hope).
More updates on what I did since the last build:
It is now possible to loop through arrays using the ForEach() statement:
- Code:
#include "console.ppl"
proc winmain
InitConsole;
ShowConsole;
dim(a$, 10, 10);
foreach (a$, v$)
v$ = i$;
i$++;
end;
foreach (a$, v$)
writeln(v$);
end;
return (true);
end;
I thought it was worth mentionning that the next build will have that.
EDIT: Oh, yeah, I forgot... The ForEach() statement will work with matrices too. I will post an example in a few minutes...
Thank you. Foreach on arrays is something I've wanted for quite a while. You're the man even when we don't ask

Here we go, ForEach() on matrices:
- Code:
a$ = [10, 20, 30, 40, 50];
ForEach(a$, x$)
writeln(x$);
end;
Here is something really cool that has just been added to PPL. Functions/procedures can be defined with the same name but with different number of parameters and PPL will know which one to call, just like in C.
You can also overwrite functions/procedures now. This feature is the first piece of integrating OO into PPL.
Forward definition has been there for a while but just to show the complexity that can handle PPL.
- Code:
//test procedure
forward proc test (a$)
proc test2 (b$)
test(b$);
end;
proc test (a$)
ShowMessage(a$);
end;
proc test (a$, b$)
ShowMessage(a$+b$);
end;
overwrite proc test (a$, b$)
ShowMessage("overwritten:",a$-b$);
end;
proc main
test2("Hello world!");
test(30, 10);
end;
I hope to have a new build tomorrow. I have some issues with the new func/proc calling standard I have built. Plus, the problems I am seeing in the forum. I want to have the next build a bit more stable.
Btw, sorry for all the changes every build and broken stuff, but I'd rather go through this pain now than later.
Hey, as long as you fix it in the end, it's all good. Besides, we knew what to expect getting into this. That's why it's called beta. Not to mention the fact that even with the breaks you keep adding new features.
Kornalius,
I agree 100% with Eric. "Beta" testing is all about finding errors and providing feedback to improve the final product.
I can't speak for the others, but I'm cetainly having a lot of fun, and getting an excellent education at the same time.
You've got the "hard job" - putting up with us ....
Well, putting up with Merv, anyway. I'm a saint

New pre-release is available. Have fun!

I'm not having fun

Just loaded the latest update. Tried to run the program I've been working on all morning (which has been running fine). It doesn't seem to be finding any of my custom include files now, even though I've copied them to the \Program Files\PPL\Lib\ directory. Help!
What? Doesn't make sense. Can you elaborate a bit more?
Yeah, I rushed into reporting this problem too quickly. I thought the #include mechanism wasn't working because it was telling me it couldn't find certain functions, but it turns out the problem is that it doesn't like a function being called when it's not assigned to something. In other words:
func Test(...)
has to be called as:
result$ = Test
and not just:
Test
Is this something new? What if I want to call a function but don't care about the return value?
I'll look into it. Certainly not something I want. The other way is what I have implemented ie:
proc test
return (value);
end;
proc main
s$ = test;
end;
This was possible before, but now it is not.
That actually makes sense, though. I wouldn't expect a proc to return a value. My problem is that I tend to make everything func, even though I don't necessarily need to, and a bunch of code was blowing up because I called funcs without assigning them to anything.
Don't worry it will be fixed tomorrow!

Ok, I have fixed the problem. However if you have a proc and a func with the same name it will call the proc instead of the func.
Check out the following example to see what I am talking about:
- Code:
func test
ShowMessage("func");
return (10);
end;
proc test
ShowMessage("proc");
end;
func test2
ShowMessage("func2");
return (10);
end;
proc main
test;
x$ = test;
test2;
end;
Output is:
proc
func
func-2
That's fine. I can't really think of a reason to define both a proc and a func with the same name anyway.
Newest build available now.
Fixes and new features:
- Memory leak for list variables fixed.
- Fixed function calling when not in expression and is not assigned to a variable.
- GetFile() and PutFile() accept initial dir paramater.
- ConsoleApp.ppl doesn't display result if they are none, when entering a command line.
- Trim(), RTrim(), LTrim() functions.
- LPad() and RPad() functions.
- Font for the Editor.ppl should be installed properly now.
23:50 17/09/2004 UTC:
Looking good from here! Sorry, I can't find a "bug" to report - I'll keep trying
cheers
Don't try to hard, they will certainly come at you!

Great to hear.
There "may" still be a slow memory leak. My program leaks about 250K over 4 hours. Of course I'm not ruling out that I am doing something stupid in my coding.
I have not undertaken localising the problem yet.
No action that you can take at this time. I'll get back with more details .....
As soon as I can get my memory analyzer tool, it will help me figure out all the little memory issues inside PPL. I am sure there are plenty.
And don't forget this leak might not be from PPL too. You are getting the global memory status. Windows does some stuff in the background too. Try pieces of your app on the desktop and you will thing the whole PPL is leaking 20,000 bytes every seconds. Sometimes you will get 20,000 bytes more memory available the next one.
Kornalius,
The fact that we are seeing "global" memory just makes it a little more challenging ... firstly to minimize any "outside" interference and then to be able to reproduce any suspect code so as to eliminate the "outside" influence.
Any tool you come up with will certainly be a blessing. It just gives you that last bit of confidence that all is well. I think you have the "core" stuff well and truly "in-control".
Anyway ... I found the "leak" - it was my problem - forgot to free a Pen Handle in one of the plot routines.
I don't know whether I am doing something wrong but I am yet to run anything successfully on the PC target.
I can compile the demo projects with target set to PC. But when I do a "run" from the PIDE I get a "stack too small" error, the form never displays and I have to do a "Stop" from teh PIDE.
Running Windows 98 .....
That is with any of the provided demos?
Anybody else tried to run the PC version of PPL so far?
Kornalius,
There are 3 Project Demos:
API Demo: compiles Ok both locations, runs on ppc, fails on pc. Error msg "Stack too small error!" (Char/Line 10/14 in MAIN.PPL)
Calc Demo: compiles OK both locations, runs on ppc, fails on pc. Error same as above.
Meeting Demo: fails to compile on both platforms: Error Msg is "(Main.frm#FORM100) Cannot find matching function or procedure [ASKSAVE] at 'ASKSAVE' (124,17)"
I have also tried the "Benchmark Demo" .. Again it compiles Ok, but exactly the same error message when running on PC.
I would understand with the project demos, there are kinda old now. But with the benchmark? Did you try the other demos? Strings.ppl, Arrays.ppl etc...
Did you update all the libraries in the lib\ directory correctly?
I can't seem to run any of the programs that include .bmp. It always errors. Seems to run fine on my PPC. I am using XP home.
Example of error:
App: SIMPLE2.PPL
Proc: MAIN
Char/Line: 8,130
Error loading image D:\Program Files\Pocket Programming Language\PPL\Projects\background.bmp
Kornalius,
All files should be correct ... before I do a new install I manually delete all associated directories on both ppc and pc after performing the "uninstall", so anything after the install must be a result of the new "install".
Yes, I tried strings and arrays ... they both work fine. It appears that any demos that only use "showmessage" run .... Any that attempt to create a form fail
That is because the .bmp file cannot be found. You are running Simple2.ppl from D:\Program Files\Pocket Programming Language\PPL\Projects\ and the .bmp files are not in there. Run Simple2.ppl from D:\Program Files\Pocket Programming Language\PPL\Demos i think that is where the files are located. You can specify the target directory just before you run the file for the first time.
DOH! I feel stupid now.
Don't, because there is no documentation on the PIDE yet!

Hey, I'm working on those docs... okay, I will be working on them. Anyway, they'll get done at some point

The new pre-release is available now. I mainly worked on memory leaks (a lot less now) and fixed the bugs mentionned on the forums since the last pre-release.
NB: Can you guys tell me if the font Lucidia Console (lucon.ttf) has been installed in your \\Windows\\Fonts folder on the PocketPC?
Kornalius,
You got most of the bugs, I think the access violations on startup are gone. I'll test some more on that one. Unfortunately, LUCON.TTF didn't install. I tried both of the provided PPL Setup files, I tried a soft reset before install... The file only exists on \\sd card\\save where I put it.
The other thing I see that is curious, is that PointOfLight's ini_test is a project dir under the PC version of PPL. Is this where you intended to put it? The INI_LIB file doesn't seem to exist anywhere nor did I see the project file.
That's it for my first glance.
Brad
BTW: PointOfLight really good job on the ini demo!
Thanks. Someday I might try writing a real program

I didn't include the ini files library into the latest release, it will come soon. Probably an earlier install you did.
I am now working on trying to get most the issues out with the debugger. There are quite a few still. Then I will start working on the object-oriented system.
Hello All,
Just installed the Zip release dated 20/09/2004. As usual de-installed and deleted all directories/files first.
Ran up the PIDE. Loaded my program. It compiles OK (target=ppc), but when I attempt to run it, the ppc "locks up".
I then did a "soft reset" on the ppc. Ran up PPL on the PPC. Did a "compile" - works fine. Did a "make EXE" and that works fine. Tried to run the "exe" and the ppc locks up again requiring a "soft reset".
The "program" ran perfectly last install .....
Will try some other programs and report back
Finally, the debugger is working quite good now. I have rewritten most of it. The latest build is now available. Btw, I found the problem with the ppc font install.
I will start working on the Object-Oriented programming next. I can't wait to have this functionning.
I have investigated my problem above a little further. The offending block of code is;
- Code:
proc LoadMapList
global (MapList$);
List(MapList$);
local (fi$,s$,buff$,i$);
sdim (buff$,tbyte,4096);
type (nBytesRead$,tint);
fn$ = concat(AppPath$,"maplist");
fi$ = CreateFile(fn$,
GENERIC_READ,
0, // exclusive access
NULL, // no security
OPEN_EXISTING, //
FILE_ATTRIBUTE_NORMAL, // no overlapped I/O
NULL); // NULL template
S$ = "";
while (not(fi$ == INVALID_HANDLE_VALUE))
hReadRC$ = ReadFile(fi$,&buff;$,4095,&nBytesRead;$,NULL);
if (not (hReadRC$ == 0))
if (not (nBytesRead$ == 0))
i$ = 0;
Repeat // here to process nBytesRead$
if (buff$[i$] == 13)
s$ = trim(s$);
if (not (s$==""))
if (not(mid(s$,0,1) == "#"))
temp$ = "NAme FIle DAtum PRojection TL BR";
Case (SubCommand(temp$,GetArgStr(s$,1)))
1: // NAME - starts a definition
print(s$);
// if (count(MapList$)>0)
// SetBitmapSize(&MapList;$);
// if ((MapList.width$ == 0) or
// (MapList.height$ == 0))
// del (MapList$);
// else
// SetQuality(&MapList;$);
// end;
// end;
//
//********** Enabling THIS BLOCK causes the problem!
add(MapList$);
struct(MapList$,MapList);
// initialize the current element
MapList.name$ = "";
MapList.file$ = "";
MapList.datum$ = "";
MapList.projection$ = "";
MapList.tlx$ = 0;
MapList.tly$ = 0;
MapList.map$ = 0;
MapList.brx$ = 0;
MapList.bry$ = 0;
MapList.width$ = 0;
MapList.height$ = 0;
MapList.quality$ = 0;
MapList.name$ = GetArgStr(s$,2);
//********** Enabling ABOVE BLOCK causes the problem!
2: // FILE
// MapList.file$ = GetArgStr(s$,2);
3: // DATUM
// MapList.datum$ = GetArgStr(s$,2);
4: // PROJECTION
// MapList.projection$ = GetArgStr(s$,2);
5: // TOP LEFT
// MapList.tly$ = int(GetArgStr(s$,2));
// MapList.tlx$ = int(GetArgStr(s$,3));
// MapList.map$ = int(GetArgStr(s$,4));
6: // BOTTOM RIGHT
// MapList.bry$ = int(GetArgStr(s$,2));
// MapList.brx$ = int(GetArgStr(s$,3));
end;
end;
end;
s$ = "";
else
if (not(buff$[i$] == 10))
s$ = Concat(s$," "); MemCpy(&s;$+(length(s$)-1),&buff;$+i$,1);
end;
end;
i$++;
until (i$ == nBytesRead$);
else // Eof(fi$)
if (count(MapList$)>0)
SetBitmapSize(&MapList;$);
if ((MapList.width$ == 0) or
(MapList.height$ == 0))
del (MapList$);
else
SetQuality(&MapList;$);
end;
end;
CloseHandle(fi$);
fi$ = INVALID_HANDLE_VALUE;
end;
else // Error condition on fi$
if (count(MapList$)>0)
SetBitmapSize(&MapList;$);
if ((MapList.width$ == 0) or
(MapList.height$ == 0))
del (MapList$);
else
SetQuality(&MapList;$);
end;
end;
CloseHandle(fi$);
fi$ = INVALID_HANDLE_VALUE;
end;
end;
foreach (MapList$)
s$ = ^MapList.name$;
combobox_add(cb1$,s$);
end;
end;
The code is part of a file read loop, initializing my Mapping Info. It worked previously.
I started with the whole block commented out and enabled a block at a time until teh "lockup" occurred.
Any thoughts?
If you post the structure definition for MapList, I will try it and see what happens. Do you know which line of that block in particular hangs up?
Good Day Eric,
a structure might help .....
- Code:
#define MapList {"name","file","datum","projection","tlx","tly","map","brx","bry","width","height","quality",tDouble}
and the file that it is attempting to load is:
==============================================
# template for map decalaration file
# for "gpstrak" for the pocketpc
# by Mervyn J Joyce
# (C) August 2004
#
name "SEQ (level 1)"
file "\Storage Card\Maps\GPStrak\SEQ-OVW1.bmp"
datum WGS84
projection UTM
TL 7098544 438488 56
BR 6853360 564376
name ubd_gc39
file "\Storage Card\Maps\GPStrak\ubd_gc39.bmp"
datum WGS84
projection UTM
TL 6904188 539104 56
BR 6899188 543104
==============================================
I haven't done the final bit of detective work yet to narrow it down ... there are only three statement types list add; structure definition and element assignments - all pretty innocent!
You will also have to comment out the call references to SetBitMapSize and SetQuality.
thanks for the offer ........
UPDATE 0453 UTC
The problem is being caused by the last line:
MapList.name$ = GetArgStr(s$,2);
I have included my routine GetArGStr() below for completeness. Note however this is NOT the first call to GetArgStr(). It is called to get the first argument of the line read at the top of the "case" code. In that call it obviously returns a "correct" value or we could never reach the first case statenment.
- Code:
func GetArgStr(s$, p$)
local (i$,l$,TokenCount$,State$,White$,token$);
white$ = true; State$ = 0;
i$ = 0; TokenCount$ = 0; token$ = "";
l$ = length(s$)-1;
while (not (i$>l$))
Case (State$)
0:
if ((mid(s$,i$,1) == #09) OR
(mid(s$,i$,1) == #32) OR
(mid(s$,i$,1) == #13) OR
(mid(s$,i$,1) == #10))
if (not (white$))
if (TokenCount$ == p$)
return(token$);
else
token$ = "";
end;
White$ = true;
end;
else
if (white$)
TokenCount$++;
White$ = false;
if (mid(s$,i$,1) == #34)
State$ = 1;
else
if (mid(s$,i$,1) == #39)
State$ = 2;
else
token$ = Concat(token$,mid(s$,i$,1));
end;
end;
else
token$ = Concat(token$,mid(s$,i$,1));
end;
end;
1:
if (mid(s$,i$,1) == #34)
State$ = 0;
else
token$ = Concat(token$,mid(s$,i$,1));
end;
2:
if (mid(s$,i$,1) == #39)
State$ = 0;
else
token$ = Concat(token$,mid(s$,i$,1));
end;
end;
i$++;
end;
if (TokenCount$ == p$)
return(token$);
else
return("");
end;
end;
UPDATE 0545 UTC
if I replace the suspect statement by:
MapList.name$ = "This is a constant string";
the problem still occurs. (Remember the "problem" is that tehppc "locks up" - it requires a "soft reset" to recover. I think this eliminate the func call as teh source of trouble.
I suppose the next obvious question: "Have there been any changes to list/structures that might make this assignment of a string to a list element behave differently to the previous release.
I was able to reproduce the "lockup", though I had to play a little bit, since I didn't realize you had posted your GetArgStr function. What I noticed was this:
if you comment out the line 'MapList.name$ = "";', everything seems to work fine. It's as though once you've allocated a variable to be a string of size 0, it doesn't like you reallocating it to a bigger size.
Try commenting out that line on your side and see if it helps. Also, even though you included GetArgStr, you forgot SubCommand, so you still can't run your sample "as-is".
Hello Eric,
Firstly ... shouldn't you be in bed!
You are so right ... I have just come to the same conclusion : if I enable all the code except the short block of "initialisation" of the element variables then everything runs perfectly. It appears that the second attempt to (re)assigm any structure element is causing a problem.
HOWEVER ... if I take this concept in isolation and just write a short piece of code to do exactly that I cannot get a failure.
True ... really ... I haven't had too many red wines, but am seriously considering such an option ...
Yes, I should be in bed. And I probably would be if it wasn't for your pesky problem... well, actually, this is the only time I get to play on my computer any more, what with 3 kids and all, so I try to take advantage of it whenever I can.
Eric,
Certainly many thanks for your time and comments ... I still don't quite believe what I am seeing, but feel a little more convinced when you have similar results.
In fact, I have commented out that initialisation block, recompiled and the program runs perfectly as it has always in the past.
That may solve my "program problem", but as a "beta" tester it's a long way from a satisfactory result - I thinks there is a problem laying in wait for us here .... anyway I'll keep snooping (and have a glass of red) .... be interested in any comments from Kornalius later in the day.
Thanks again .....
CUL
Create a new project, throw a button on it, and try the following code. I think you will find that the project should lock up on you.
- Code:
#define MapList {"name","file","datum","projection","tlx","tly","map","brx","bry","width","height","quality",tDouble}
proc MakeItBlow
Global(MapList$);
List(MapList$);
i$ = 1;
while(i$ <= 10)
add(MapList$);
struct(MapList$, MapList);
// initialize the current element
MapList.name$ = "";
MapList.file$ = "";
MapList.datum$ = "";
MapList.projection$ = "";
MapList.tlx$ = 0;
MapList.tly$ = 0;
MapList.map$ = 0;
MapList.brx$ = 0;
MapList.bry$ = 0;
MapList.width$ = 0;
MapList.height$ = 0;
MapList.quality$ = 0;
MapList.name$ = "This is string #" + str(i$);
i$++;
end;
foreach(MapList$)
s$ = s$ + ^MapList.name$ + "\n";
end;
ShowMessage(s$);
end;
Hi guys,
This problem has been fixed yesterday. The garbage collection was getting in a loop (pointers not resetted right) when a string was re-assigned to a struct or array element when a value was already there previously.
There will be a new build today, you should try it out.
Look at that, mervjoyce. Now he's fixing our bugs
before we find them

Isn't it cool?
I fixed this problem while investigating a bug bmanske found in the VFB that was locking up his device. And your problem was pretty much the same thing that caused it to get in a loop internally.
Btw, newer build is available!

Okay, the code I posted no longer blows up, but how do I get the value of the string variable out of the structure? If I use:
s$ = s$ + MapList.name$
I get a string that contains a bunch of addresses, which I would expect. However, if I do:
s$ = s$ + ^MapList.name$
I get an access violation. What's wrong?
I figured out my problem (because I actually remembered for once going through this before). The actual syntax should be:
s$ = s$ + (^MapList.name$);
I forgot that I needed the parentheses.
What does s$ contains before doing s$ = s$ + ^...?
Just tried this and it works well:
- Code:
struct (t$, "a", "b");
t.a$ = "HELLO";
s$ = "BLA";
s$ = s$ + ^t.a$;
ShowMessage(s$);
I didn't have s$ initialized to anything. That wasn't the problem, though, because I initialized:
s$ = "";
and still got the problem. But, there was something I forgot to write in the post. The full snytax was:
s$ = s$ + ^MapList.name$ + "\n";
This did not work, even initializing s$. So, I either had to do:
s$ = s$ + (^MapList.name$) + "\n";
which is no big deal, or:
s$ = s$ + ^MapList.name$;
s$ = s$ + "\n";
either solution worked.
The reason why it doesn't work is because the ^ operator grabs the expression that comes after.
so s$ = s$ + ^MapList.name$ + "\n"; was evaluated like this:
s$ MapList.name$ "\n" + ^ Therefore the pointer location was a bad one. I could change the parser to just grab the variable that comes after the ^ operator but you couldn't do things like this in the future.
s$ = s$ + ^MapList.name$+3; This would return the fourth caracter after MapList.name$ string value.
No need to change anything, I just like to know why things work the way they do

Kornalius, Downloaded the latest pre-release ... all looking good so far ... thanks
Eric, I have found that using the Concat() func when joining strings (even in ShowMessage) is more reliable, but it does take a while to break from the habit of just a$ + s$ ....
I wonder if anyone else is having the same problem.
I can load my program from the desktop PIDE, compile and run without a problem.
If I attempt to run PPL from the ppc and then "run" my program I get an error - a Syntax error at 1,1. However if I run PPL (on the PPC) and "compile" first, then do a "run" then the program works OK.
I have also noted that attempting to generate an "exe" appears a bit of a "hit and miss". PPL always advises that the "exe" was created (and there is in fact an exe file created) but only under some circumstances does it "run".
Can you give me the exact error message merv?
Hi Kornalius,
The problem I describe applies each time I run PPL on the PPC (even if I have had things working fine previously).
I start PPL. Select "run" from the menu. Select my program from the file list. A "PPL Runtime Error" message box is displayed:
App: MAIN.PPL
Proc: (null)
Opcode; RUN
Char/Line: 0,0
(*EndProc)
Access Violation at 0x31ec8
I then select "compile" and again select my program file. The compile is successful. If I now attempt to do a "run" from the open "compile" window I still get an error - Syntax error at 1,1 - I note the progress bar is showing "analyzing (null)".
Selecting "File"/"Close" exits the "compile" window. I then select "run" (from PPLs main window). I still get the same message as I first did.
I do a "make exe". PPL reports successful. Again attempting a "run" from the open window fails. I do a "file"/"close" to return to PPLs main window. I now select "run" - just like my very first selection ... the PPL compiler runs, my program screen appears and all is well.
I have transcribed the above sequence of events as I just performed them
cheers
Why don't you try deleting the .ppc files before running .ppl programs. They could have been leftovers from a previous build and not being rebuilt properly. Just a thought.
I just followed the steps you have mentionned above and one is not good. You can't run from the compile results window. It will try to run the report text that you see in the window, therefore giving the error mentionned. All other steps works perfectly here with Simple2.ppl. Did you try with some other program?
Can you send me your code, this way I can try to figure out what is the problem?
The latest build is now available!
Enjoy.
Kornalius,
Release dated 1-10-2004 installed OK. All PPL directories on both ppc and desktop were deleted before installation.
All functions OK except my "run" problem on the ppc persists. The ONLY way to run a PPL program from the ppc is to first "make an exe", then choose "run" from PPL's main menu. The program then runs without a problem. Note however that the "exe" made above "does nothing" - when "executed" it just "exits" immediately without any error message.
I have tried a number of the sample demos and they "RUN" OK.
Kornalius, if you are still interested I'll send a zip of my project directory direct to your email address.
Merv,
Yes please send me your code, I am very curious about what is not working. I will try to fix for the next build.
Hi Merv,
Problem fixed. It was an internal problem with the .ppc save and load procedures.
New version is available.
Updates:
- OO system is more complete.
- Fixed bug .ppc loading.
- Package file system functions.
- A bit faster.
- != works just like <> operator.
- Better eval() system.
- No #OPTIMIZE compiler directive anymore. PPL does it automatically now.
- Better installation on the PPC.
- And more bug fixes...
Have fun!
great, menu problem is fixed.
Great to hear. I had to write a little utility to update my install script. I'm glad it worked well.