Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Is this statement valid?

Author
Message
Grook
AGK Backer
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 29th Jun 2012 23:52
Hello all.

I wonder if somebody would be kind enough to tell me if the following assignment is legal and should work ok. It seems to but I'm getting my executable bugging out at variable places at the moment and this was something I started doing recently in the program.



"Happiness is contrary to the human condition" --White (to Black)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Jun 2012 02:13
No, you need to specify the type parameter (I think). IE:



this.mess = abs(sin(times#))
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 30th Jun 2012 05:21
The statement is legal and should work OK, however it doesn't.

It can leave arrays with unpredictable contents which could well lead to program crashes.

I had this logged as an issue on the bug board. It was closed off recently with the comment "Fixed for 1077".

So until we get 1077, baxslash's solution is the one to use.

You could make it into a function, something like

Then when the fix is in, you can just replace the function call with the original statement.
Grook
AGK Backer
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 30th Jun 2012 10:59
Excellent, thank you both for your answers.

"Happiness is contrary to the human condition" --White (to Black)

Login to post a reply

Server time is: 2024-05-02 04:42:41
Your offset time is: 2024-05-02 04:42:41