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.

Bug Reports / [DBPro U7.5] Returning string constant from function crashes on Win 7

Author
Message
Globbits
15
Years of Service
User Offline
Joined: 30th Jan 2009
Location: Cambridge
Posted: 17th Aug 2010 13:27
This code works on XP but not Windows 7 (Vista not tested)

Originally posted on DB Pro main forum
http://forum.thegamecreators.com/?m=forum_view&t=174327&b=1

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Aug 2010 14:33
Help files for exitfunction and endfunction say:

Quote: "Syntax

EXITFUNCTION Variable"


and

Quote: "Syntax

ENDFUNCTION Variable"


Your code isn't using variables.
Globbits
15
Years of Service
User Offline
Joined: 30th Jan 2009
Location: Cambridge
Posted: 17th Aug 2010 16:02
The code should therefore be rejected by the compiler.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Aug 2010 17:03
Agreed - forgot to suggest that.

Also, the Help file for exitfunction mysteriously implies that things other than variables can be returned.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 17th Aug 2010 23:53 Edited at: 17th Aug 2010 23:54
I posted a similar bug report and I'm guessing it could be the same problem.

Quote: "Your code isn't using variables."


A literal can replace any instance of a variable where the operation only reads from it (and doesn't require an address). So it should work fine in this case.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Aug 2010 01:10
Quote: "So it should work fine in this case."


The evidence suggests your theory is wrong.

If you follow the syntax given in the Help file (in this case ) then things work as expected. What more can you ask?
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 18th Aug 2010 03:22
I'm not sure why you think there would be some exception for this operation that would only allow variables (and not literals) to be used.

It's standard in most (if not all) programming languages that any direct value (ie. not passed by address) argument can be either a variable or a literal, they both function the same. I highly doubt DBPro would be any different.

Apart from that, this bug only exists on Vista/7. If it wasn't meant to work correctly in the first place it would not likely work on other operating systems.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Aug 2010 13:02
Quote: "I'm not sure why you think there would be some exception for this operation that would only allow variables (and not literals) to be used."


I read the Help file. Simples.

Login to post a reply

Server time is: 2024-04-20 02:38:54
Your offset time is: 2024-04-20 02:38:54