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.

DarkBASIC Professional Discussion / strange compiler behaviour

Author
Message
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Apr 2012 13:30 Edited at: 20th Apr 2012 13:31
Can someone tell me why I get the following error on my Vista 64 bit machine but no error, i.e. runs perfectly, on my 32 bit XP machine using exactly the same code? I'm testing the code for someone else.



I wouldn't use the variable "col" to mean two different things although it seems the compiler recognises that "col(" and "col" are intended to be different and work as the user intended on one of my machines. Both machines have U77RC7 installed.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2012 17:29
Anyone any idea how I can stop this weird error?

The following compiles and the whole code runs fine:



The following won't compile and gives the error in the previous post - but only on one machine:

Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Apr 2012 18:06
so we're assuming there's a dimension of col() some place above either snippet ? as neither should compile without it.

None the less, this is parser error. Possibly a fault bracket match in the compiler when on the left side of the assignment.

Andrew_Neale
14
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 21st Apr 2012 18:27
Interestingly if you replace the variables inside the 'int' function with constants it seems to work fine. i.e. 'int(1 + sin(1) * 1)' So I can only assume it is a really weird parser bug as mentioned and we may just have to settle with the work around you already found of pre-calculating the array index into a variable and using that.


Previously TEH_CODERER.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2012 21:31
Hmm. But why should it compile and run without error on one machine but fail to compile on another? Both machines have U77RC7 installed.

Quote: "so we're assuming there's a dimension of col() some place above either snippet ?"


Yes, that's only the fragment where the "error" is highlighted and the workaround suggests that line is the cause for some reason. All the snippets posted by the main poster on the following thread do that, even after a re-boot. I'm baffled.

help with random?

I'll try re-installing the update to see if that fixes things. My other programs don't seem to be affected. I was wondering whether I'd set an option somewhere but if I have I've no idea what.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Apr 2012 21:58
I've come across that error before myself and I've watched this thread to see if anyone yet has come up with an explanation of it. The only thing I can guess is the switching between variable types lots of times during a single statement. Although as mentioned above, it compiles on one but not the other. Do both machines have the same plugins installed on them?

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2012 23:29 Edited at: 21st Apr 2012 23:32
Quote: "Do both machines have the same plugins installed on them?"


Probably not. It could take a while to make sure the two installations are identical - worth looking into though.

I'll see if I can reproduce the error with a simple bit of code - the snippets I'm using are about 200 lines long so the error could be an obscure consequence of something earlier in the file. As Kevin Picone says it looks like some sort of parser error.

In the absence of evidence to the contrary I'll blame IanM's Matrix1 plugins ...

Quote: "I've come across that error before myself"


So have I, but can't now recall whether it was in my code or somebody else's or what the diagnosis was.


Edit The plugin suggestion is probably right. What would happen if one had a function "col" requiring the data type at issue? That theory should be easy to test.
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Apr 2012 23:38
Looks like a plugin has overloaded the "int" function to return a double integer.

[b]
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Apr 2012 00:58 Edited at: 22nd Apr 2012 01:16
Yes, that would be the obvious explanation.

The following simple complete snippet produces the error on one machine:



I'll see if I can track down a plugin causing this.

Edit Definitely a Plug-in. Just moved all of Plug-ins Licensed and Plug-ins User out of the way and the problem has disappeared. Now to narrow it down. I'll edit this post when I have a result.

Edit2 Guess what. I've just reinstated IanM's plug-ins and, voila!, the problem has returned. My machines have different versions of that plug-in - the problem one is more recent. I'll find out which particular one and report back. Does IanM already know about this?

Edit3 Yes. It's IanM's new int() function that's causing the problem - just delete his Matrix1Util_7.dll file and the problem goes away. I'll see if he has a newer update. If not I'll let him know.

Thanks for the suggestions everyone.

Login to post a reply

Server time is: 2024-04-18 22:35:44
Your offset time is: 2024-04-18 22:35:44