Beta release 1.9.9b
Moderator: Moderators
I updated the YakYakReader-project to use the new string functionality. The code to parse the html-page becomes much cleaner and shorter:
And when a link is clicked then we can simply assign the Url-property directly without having to use arrays:
Updated zgeproj file here.
Code: Select all
Color1.Color.B=0;
IsUpdating=0;
string topicmatch="topictitle";
string data=Web1.ResultString;
string display="";
int linkCount=0;
int end=0;
int i=0;
for( ;end!=1; ) {
//Sample string that we are trying to parse:
//<a href="./viewtopic.php?f=2&t=78879" class="topictitle">Question about English language?</a>
//We want to extract the topictitle and the topicID (the number after "t=") so that we can create a url to it
i=indexOf(topicmatch,data,i);
if(i==-1) {
end=1;
} else {
//Extract topic id
int k=indexOf(";t=",data,i-25) + 3;
int l=indexOf("\"",data,k);
Links[linkCount]=strToInt( subStr(data,k,l-k) );
linkCount++;
if(linkCount==Links.SizeDim1)
end=1;
//Extract topic title
k=indexOf("</a>",data,i);
i+=length(topicmatch)+2;
//Add topic title to displaystring
display+=subStr(data,i,k-i) + "\n";
i=k;
}
}
Rtext1.Text=display;
Code: Select all
int clicked=round( (1.0 - ((App.MousePosition.Y+1.0)/2.0)) * 9 );
Web2.Url="http://www.yakyak.org/viewtopic.php?f=2&t=" + intToStr(Links[clicked]);
Beta updated today with more pieces of string support present. These updates will hopefully make things like highscore tables much easier to implement!
I've updated the first post, but here are the details for easy reference:
- char(charcode) function for creating a string based on a ansi-code
- while-loop support. "while(i<42) { i++; }".
- special characters in string literals to make strings containing double quotes and newline.
- DefineVariable and DefineArray now supports "string" type.
Note:
-- Persistent arrays of string-type are not supported
-- Don't make your string arrays larger than you need because even unused array-slots affect performance of the garbage collector
I've updated the first post, but here are the details for easy reference:
- char(charcode) function for creating a string based on a ansi-code
- while-loop support. "while(i<42) { i++; }".
- special characters in string literals to make strings containing double quotes and newline.
- DefineVariable and DefineArray now supports "string" type.
Note:
-- Persistent arrays of string-type are not supported
-- Don't make your string arrays larger than you need because even unused array-slots affect performance of the garbage collector

Just downloaded the ( latest ) Beta with String support. Already a impressive list of String related functions

First bug I ran into is that when you assign the result of strToInt() to a DefineVariable ( integer ), the editor throws a exception ( access violation ) as soon as you click on the Component. Even when first assigning the value to a local variable before writing to the Component, the bug still occurs ..
And since you did already include chr() .. don't forget about ord()

+ Did you make some changes to the code editor syntax scheme? I could have sworn comments used to turn blue ( now they are black ).
K
Thanks!Kjell wrote:Just downloaded the ( latest ) Beta with String support. Already a impressive list of String related functions
Oops, this turned out to be quite a serious bug, so I've already fixed it (including the strange default integer value) and uploaded an updated version. Also comments are blue againKjell wrote:First bug I ran into is that when you assign the result of strToInt() to a DefineVariable ( integer )

OK, I got all the .zproj fles in this thread working now.
I used shadowCaster for this testing.
They all had the same problem (for my rig). The Render Target components all had 0 as values for CustomWidth/Height, and I would get nothing happening. I get good display with 512/512. With 256/256, 128/128 etc. things get progressively granulated, and with 1028/1028 I get nothing again.
I'm suggesting a default value for Render Target of 512/512.
And I get nothing with the fish-eye demo, probably for the above reason.
Also, the drop downs of half/quarter don't seem to have any effect.
I used shadowCaster for this testing.
They all had the same problem (for my rig). The Render Target components all had 0 as values for CustomWidth/Height, and I would get nothing happening. I get good display with 512/512. With 256/256, 128/128 etc. things get progressively granulated, and with 1028/1028 I get nothing again.
I'm suggesting a default value for Render Target of 512/512.
And I get nothing with the fish-eye demo, probably for the above reason.
Also, the drop downs of half/quarter don't seem to have any effect.
Code Editor / FBO
Loved the code editor autocomplete/string improvements.
I'm still way behind regarding shaders, FBO and passes, because my notebook has a crappy intel onboard card, and is practically unusable for this.
BTW ZGE rocks!
I'm still way behind regarding shaders, FBO and passes, because my notebook has a crappy intel onboard card, and is practically unusable for this.
BTW ZGE rocks!
Close, but not there yet.
Minor update today:
- not-syntax in scripts ("!(lives==0)", "!finished" etc)
- DefineConstant-component now has a type-property so you can define string and integer constants.
- App.Caption is now assignable from scripts so you can type things like "App.Caption = "Frame rate: " + IntToStr(App.FpsCounter);" when you quickly want to display a value and not bother with a RenderText-component.
- Generated exe-files now display the standard application icon in the task-bar (instead of "missing icon"-icon that was displayed previously).
- not-syntax in scripts ("!(lives==0)", "!finished" etc)
- DefineConstant-component now has a type-property so you can define string and integer constants.
- App.Caption is now assignable from scripts so you can type things like "App.Caption = "Frame rate: " + IntToStr(App.FpsCounter);" when you quickly want to display a value and not bother with a RenderText-component.
- Generated exe-files now display the standard application icon in the task-bar (instead of "missing icon"-icon that was displayed previously).
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact: