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 / Heads up on possible problem with change to mid()

Author
Message
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 30th Sep 2011 06:20
Since the change to mid() in AppGameKit v1042, code that uses mid() would need to be adjusted. But it might also be wise to look at code using right() to see if it needs adjustment as well.

I had to change a calculation (I was subtracting one character position before, now I don't need to) after the update. I'm not going to reinstall the previous version to check this, but I did want to get the word out that code using right() might need some attention.

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 30th Sep 2011 09:23 Edited at: 30th Sep 2011 09:38
Left$() and Right$() seem normal, but the Mid$() function in the demo uses inclusive Zero for character positions.



Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 30th Sep 2011 09:29 Edited at: 30th Sep 2011 09:30
Yes, right() works fine now, but previous to the update I had to subtract one from the value to get it to work correctly. I'm not sure all code that uses right() needs adjustment, but I did have to adjust mine after the update.

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 30th Sep 2011 21:47
I needed to amend all my code involving Right$, Left$ and Mid$ after the change.

Not a big deal, but annoying. lol

My signature is NOT a moderator plaything! Stop changing it!
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 9th Oct 2011 03:58
It's best we solve these early conventions immediately so we can set some foundations down. I personally prefer one-based index systems as it's easier for a beginner (and human) to understand (1=1st).

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-11-22 03:59:50
Your offset time is: 2024-11-22 03:59:50