Evaluate expression

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
User avatar
VilleK
Site Admin
Posts: 2251
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Evaluate expression

Post by VilleK »

Added a new feature: a editbox for evaluate expression. It is located at the bottom right corner, just below the log.

This is a useful debugging and productivity tool.

You can type any expression that is valid in the currently loaded application.

Enter will evaluate expression. Pressing Up and Down will circle to expression history.

Download here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip

Examples:

Code: Select all

1   //will display 1

2*2  //will display 4

strToInt("1")  //built-in functions can be called

"value is " + intToStr(42)  //string results are ok too

MyScore=1000  //Assignments are ok too

@RefreshContent(Component : MyBitmap)  //this syntax is ok too

InitGameLevel(4)   //nice to be able to call user-defined functions during preview
Attachments
zge_evalexpression.PNG
zge_evalexpression.PNG (272.85 KiB) Viewed 9740 times
User avatar
rrTea
Posts: 470
Joined: Sat Feb 15, 2014 9:54 am

Re: Evaluate expression

Post by rrTea »

When the editbox is still new (immediately after launching ZGE for example) pressing cursor up brings a Division by Zero.
Edit: or cursor down :)
User avatar
VilleK
Site Admin
Posts: 2251
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Evaluate expression

Post by VilleK »

Thanks, I'll fix it :). I'll be away for two weeks vacation now so probably will not check the forums during that time.
User avatar
VilleK
Site Admin
Posts: 2251
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Evaluate expression

Post by VilleK »

rrTea wrote: Tue Jul 09, 2019 12:08 pm When the editbox is still new (immediately after launching ZGE for example) pressing cursor up brings a Division by Zero.
Edit: or cursor down :)
Ok this bug is now fixed: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
User avatar
rrTea
Posts: 470
Joined: Sat Feb 15, 2014 9:54 am

Re: Evaluate expression

Post by rrTea »

Thanks! Downloading :)
User avatar
rrTea
Posts: 470
Joined: Sat Feb 15, 2014 9:54 am

Re: Evaluate expression

Post by rrTea »

What is the number printed in the console after assigning, let's say, a value to an array cell? For example if I enter "arr_MyArray[0,0] = 0", the [0,0] in the arr_MyArray indeed becomes 0 but the console will print "4294967296".
User avatar
VilleK
Site Admin
Posts: 2251
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Evaluate expression

Post by VilleK »

rrTea wrote: Sun Jul 31, 2022 11:50 am What is the number printed in the console after assigning, let's say, a value to an array cell? For example if I enter "arr_MyArray[0,0] = 0", the [0,0] in the arr_MyArray indeed becomes 0 but the console will print "4294967296".
That sounds like a bug :). I will make a note to look at that, but it should be unharmful and can be ignored.

It tries to log the result of every expression. If you type something like "5", or "5+5", it will print the result of that. When it is a assignment I suppose it should be the result of that assignment but instead something is incorrectly printed in this case.
User avatar
rrTea
Posts: 470
Joined: Sat Feb 15, 2014 9:54 am

Re: Evaluate expression

Post by rrTea »

Sorry I forgot to mention it in the previous post, yes other expressions work fine, like "5+5" etc (I'm using the expression evaluator quite a bit, it's very handy when I just want to check something real quick). Alright good to know it's nothing to worry about, thanks for confirming!
Post Reply