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 / Code compiles when I run it...but nothing happens.

Author
Message
Sam ONella
11
Years of Service
User Offline
Joined: 8th Jul 2014
Location:
Posted: 5th Aug 2014 20:43
This is strange. Really strange. I started the very first chunk of a game I'm working on. I have been able to test it up to this point. However, just today, whenever I hit "run", it compiles, but nothing happens. No errors, just no window. I can put errors into the code, and the errors are located and highlighted just fine. I've tested other codes, they all run perfectly fine. I tried moving the code and images to a new directory. Nope, code still doesn't run. Tried switching from windowed mode. Mm-mm. Tried switching display modes. Nothing. Searched the whole thing for "end" somewhere, thought maybe the code was killing itself. No. I'm stumped at this point, and am in desperate need of help. here is the code: (note: a lot of this is inconsequential, and just stuff I plan to use later.)



...
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Aug 2014 17:33
Doesn't compile here.

What makes you think it compiles?

[Hint: do you really intend to have two arrays: randomness() and randomness#()?]



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Aug 2014 22:59
set window off
?

29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 6th Aug 2014 23:09
When I first ran this all I got was some unidentified syntax error and the code wouldn't compile or run so after a little investigation:

In the sub-routine "daycycle" you have these two lines:



But randomness(1) had been declared as float so should be written randomness#(1)

Once I change this in both lines the code compiled and ran.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Aug 2014 23:45
Quote: "But randomness(1) had been declared as float so should be written randomness#(1)"


Precisely my point - but I was hoping the original poster would take the trouble to find his error himself. People learn more that way.

Well, some do anyway - others don't learn at all, they just copy.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Aug 2014 23:48
That is why I choose to be vague with my posts, best to figure something out yourself than be shown the solution and not understanding how it all connects...

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Aug 2014 23:56
Quote: "That is why I choose to be vague with my posts"


That's your excuse ...

Seriously though, I agree. There have been a few posts recently which have been dangerously close to the "Gimme da codez" variety. After a while you begin to wonder why you try to help them when they won't help themselves.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Aug 2014 23:59
Glad I am not the only one thinking that...

And what is with OPs disappearing after posting?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2014 00:21
Quote: "And what is with OPs disappearing after posting?"


Yes, that can get very annoying - but there's sometimes a good reason.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Aug 2014 00:24
Can I hazard a guess such as... Not applying for updates to their own ✉ threads?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2014 00:31
I'm guilty of that. On the odd occasion I check my threads I usually find several where I hadn't seen recent posts.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Aug 2014 00:33


Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2014 01:44
Out of curiosity I decided to check. By some fluke there are currently exactly 200 threads of which about 15% haven't been visited by me since the last post. One day I'll check those threads - honest. The earliest such post dates back to 2005.

I hadn't realised I'd been that bad.

Pray for a rainy day I guess - or total boredom with whatever I'm doing at the time.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Aug 2014 01:52
We need a WHIP THAT FORUMITE button...

29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 7th Aug 2014 04:20
Quote: "I was hoping the original poster would take the trouble to find his error himself. People learn more that way"


Yes, I'd agree with that but in this case the OP provided code, the problem just seemed like a typo and the IDE was giving unhelpful feedback. No big deal. Now the OP sees one of the issues that can trip them up so they know what to look for in the future.

I thought your original hint was pointing to the fact the OP had declared two near identical arrays. So that threw me off a little trying to track the problem down. But I thought you were right in asking the OP why they thought the code did compile.

Quote: "That is why I choose to be vague with my posts"


I thought your original response was just unhelpful.

Quote: "And what is with OPs disappearing after posting?"


The OP posted two days ago and it took a day for anyone to reply, it's hardly a major disappearing act.

We all have are own ways of dealing with these sorts of posts but I think people need to relax a little and stop giving new people a hard time. If you want the forum to grow, if you want to "fix DBPro" or make DBPro relevant or you want people to use your "Codictionary: DBPro - Deep Red" then being unfriendly to the new people really isn't going to help.

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Aug 2014 04:33 Edited at: 7th Aug 2014 04:36
Quote: "then being unfriendly to the new people really isn't going to help."


Actually, if you look back down the thread many newcomers drop out entirely, my guess is the non automatic mailback tick box which I raised in the beta forum thread...

Quote: "I think people need to relax a little "


Good idea

Quote: "I thought your original response was just unhelpful."


I was on a coach going from London to Manchester on my mobile, and thought that might hide the window, but I could have been wrong... nothing wrong with suggesting something to look at when the issue was rather vague with

Quote: "whenever I hit "run", it compiles, but nothing happens. No errors, just no window. "


OP clearly said IT COMPILES so I looked at the code... anything wrong there?

And yet people pointed out that they were unable to compile, yet I said nothing...

Relax indeed

EDIT

To be clear After a few posts were made I also thought maybe the OP was unfamiliar with the output window..

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2014 13:18
Quote: "the problem just seemed like a typo and the IDE was giving unhelpful feedback"


When I ran it the IDE plainly pointed to a syntax error involving an undeclared array called randomness() - although the IDE didn't call it an array.

Quote: "I thought your original hint was pointing to the fact the OP had declared two near identical arrays."


I agree the wording could have been improved - but it should have warned the OP to look for "randomness(" in his code. Since he'd managed to code that much already I assumed he'd be able to figure that out.

Quote: "I thought your original response was just unhelpful."


Yes, I couldn't see the relevance of the remark either. But now I've checked the code again I can But it isn't related to the problem as it happens. Incidentally, I've just checked the Help file for those two commands, i.e. set window on/off, and I can't figure out what either of them actually does or when you might need them.

Quote: "After a few posts were made I also thought maybe the OP was unfamiliar with the output window."


That's quite possible thinking about it. I vaguely recall having similar problems many years ago. Perhaps the default setting hides that window?



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Aug 2014 13:28
Now we have to assume the OP is using Synergy Editor [Editor New] and not the old editor lol



Hmm that gave me an idea... just need to wait for my new software to arrive in the post...

James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 7th Aug 2014 18:49
It switches fullscreen exclusive mode on/off as far as I can tell, iirc having fullscreen exclusive set in IDE has proved problematic for me when using set window off in past or maybe it was off then back on - either way it would crash but wouldn`t do so if it wasn`t set in IDE - might have been fixed since as its been some time. There is another command that show/hides window making it borderless think it might be something like set window layout or something like that, can`t check atm so this is from memory so should be taken with a pinch of salt..
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Aug 2014 02:32
The way I see it, if someone wants to just copy and paste code they are wasting they’re time. They’ll never learn how to program and will accomplish nothing. I learned programming in the 80’s on 8-bit machines by typing in code from magazines while reading the programming manual to figure out how and why the programs worked. I think studying someone’s code is the best way to learn. For this reason I have no problem sharing code. 99.9% of the time you can tell by the next post if they are just copying the code. If I sense I’m just wasting my time as well, I quit trying to help.

JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 12th Aug 2014 16:55
Quote: "The way I see it, if someone wants to just copy and paste code they are wasting they’re time."


Actually, that is exactly how I learned. I learned by copying and pasting.. so that I could learn other stuff quicker. Then when I came back to what I had copy and pasted, I needed to know how it worked with the rest of my code. So I don't agree that copy and pasting is not helpful.

HOWEVER.. with that said.. The "Gimme gimme gimme" can get annoyingly bad. When I see those, I don't even bother to respond. Saves my time for those who are actually trying. Like this op, who actually was trying with pasting code and apparently was not understanding what he typed in the first place. The fact is, he might not speak English as the native tongue, so I didn't jump the gun when he said it compiled and everyone else said it wouldn't. Heck, it wouldn't even for me. So I figured there is a language barrier here. If not, maybe a typo ? As one person said.. relax.

This all goes back to the copy and past code for those who are not all about us writing their whole program for them. Some learn better when there is actual working demo code.. key word there.. demo...
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Aug 2014 14:44
@JackDawson - Well that's a bit different. I don't see any problem with using someone else's code you don't understand inside out, as long as you know how to use it (ie a function that you know what input/output to expect), but pasting together things you have no idea how to use and just expecting it all to magically work is ignorant.

Formerly OBese87.
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 13th Aug 2014 17:44
Quote: "but pasting together things you have no idea how to use and just expecting it all to magically work is ignorant."


I totally agree with this.

Login to post a reply

Server time is: 2026-07-05 17:32:57
Your offset time is: 2026-07-05 17:32:57