Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1] 2 3 ... 11   Go Down

Author Topic: Programming Q&A  (Read 31337 times)

0 Members and 1 Guest are viewing this topic.
Programming Q&A
« on: June 24, 2008, 11:53:57 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Seeing as 4Sword was having a go at me for not replying to a C++ programming PM from him due to my unfortunate state of being asleep. I figured I would make this topic to help out a bit.

If you have any question about programming (any language you choose) that are to trivial to warrent their own topic; syntax errors, not unstanding certain concepts, etc. Post them here and I'll make sure either I or one of the other programmers on this forum gives you a reply.

When posing a question please include relavent information (source code that produce the error, etc) to help make answers faster.

(Be aware however this isn't a 'How do I build blank engine' topic, those questions should be in their own topics).

Have at it.
« Last Edit: June 24, 2008, 11:57:33 pm by Infini »
Logged
Re: Programming Q&A
« Reply #1 on: June 25, 2008, 12:02:38 am »
  • Super Hero Time!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4859
How do I built engine?

(I just had to...)

Edit: Maybe I should make this a more serious post.

I'm interested in learning a language (GameMaker is... meh), what would be best for me to start? (Not really much knowledge of previous languages.... BASIC BASIC GML THAT'S IT.)
« Last Edit: June 25, 2008, 12:05:07 am by Pyro »
Logged
!@#$% I lost my entire post, god dammit.
Re: Programming Q&A
« Reply #2 on: June 25, 2008, 12:11:49 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Quote
I'm interested in learning a language (GameMaker is... meh), what would be best for me to start? (Not really much knowledge of previous languages.... BASIC BASIC GML THAT'S IT.)
Simplest way of getting into programming is probably by using a BASIC varient, BlitzMax (www.blitzbasic.com), Free Basic (http://www.freebasic.net), .etc, .etc. They tend to have a more abstract higher level interface than languages like C++, and tend to take the burden off the programmer for things like memory management, bounds checking, .etc, .etc. Meaning you can get to do the things you want faster without having to worry about any of the tedious 'behind-the-scene' stuff.

Once you've chosen a language the best way of really getting to grips with it (and importantly the logical methodoligy that goes behind it) is simply through experimentation, try creating a few simple but ambitious games, you may well fail but I can guarantee you will learn more about the language each time you do. Stick with the simple aspects of the language (IF statements, While statements, .etc) while your learning then once you've got the basics down try skimming through some language references and try out some of the more advanced stuff using the same experimentation method, after a while you will being to expand your knowledge of programming a great deal and will be able to do larger scale projects on your own.


/ Long badly spelt post.
« Last Edit: June 25, 2008, 12:18:46 am by Infini »
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #3 on: June 25, 2008, 12:35:38 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
How do I built engine?

(I just had to...)

Edit: Maybe I should make this a more serious post.

I'm interested in learning a language (GameMaker is... meh), what would be best for me to start? (Not really much knowledge of previous languages.... BASIC BASIC GML THAT'S IT.)

I would suggest to start with QBASIC > Javascript > BlitzMax > ???
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #4 on: June 25, 2008, 12:37:27 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
How do I built engine?

(I just had to...)

Edit: Maybe I should make this a more serious post.

I'm interested in learning a language (GameMaker is... meh), what would be best for me to start? (Not really much knowledge of previous languages.... BASIC BASIC GML THAT'S IT.)

I would suggest to start with QBASIC > Javascript > BlitzMax > ???
QBasic is ancient and irrelivent to the current programming world though, it won't really help you start, and will probably leave you with bad habbits (goto and such).

Javascript is just plain slow, and requires a browser to run.
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #5 on: June 25, 2008, 12:41:06 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
How do I built engine?

(I just had to...)

Edit: Maybe I should make this a more serious post.

I'm interested in learning a language (GameMaker is... meh), what would be best for me to start? (Not really much knowledge of previous languages.... BASIC BASIC GML THAT'S IT.)

I would suggest to start with QBASIC > Javascript > BlitzMax > ???
QBasic is ancient and irrelivent to the current programming world though, it won't really help you start, and will probably leave you with bad habbits (goto and such).

Javascript is just plain slow, and requires a browser to run.

I basically suggested those so he could easily grasp some ground rules of programming. They have good syntax that is somewhat similar in other languages. It seems he needs to start with a book for dummies, if you know what I mean.

Quote
Javascript is just plain slow, and requires a browser to run.

Just to get so,me basics down. Besides, who really does not have a browser?

Quote
QBasic is ancient and irrelivent to the current programming world though, it won't really help you start, and will probably leave you with bad habbits (goto and such).

Again, just to get the dirt basics...


@Pyro: Oh and Action script isn't too bad for beginners.
Logged
  • For The Swarm

Xiphirx

wat
Re: Programming Q&A
« Reply #6 on: June 25, 2008, 04:13:48 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
My question:

I'm am trying to find an alternate to <embed src="lol.swf" /> any help? needs to be XHTML 1.0 Transitional


(not sure if we can double post in this topic...)
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #7 on: June 25, 2008, 07:47:05 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Posts: 280
I guess:

Code: [Select]
<object type="application/x-shockwave-flash" data="yourclip.swf" width="x" height="x" id="myclip">
<param name="movie" value="yourclip.swf" />
<param name="quality" value="high" />
Alternative content (images, text, etc.)
</object>
could work fine.

If you want more informations about including any sorts of video files (WMP, QuickTime, Flash etc.) without embedding them, read byebyeembed. ;)
« Last Edit: June 25, 2008, 07:58:44 am by Venyux »
Logged
Re: Programming Q&A
« Reply #8 on: June 25, 2008, 10:28:41 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Infini, actually the QuickBASIC community also greatly discourages the use of goto. Older versions of FreeBASIC were essentially modern versions of QuickBASIC, but now it's moved on from that stage by quite a bit.
Logged
Re: Programming Q&A
« Reply #9 on: June 25, 2008, 10:54:41 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Infini, actually the QuickBASIC community also greatly discourages the use of goto. Older versions of FreeBASIC were essentially modern versions of QuickBASIC, but now it's moved on from that stage by quite a bit.
QuickBasic != QBasic just so you know :). QBasic is a derived dialect written by microsoft. Either way thats not important, its still ancient :S.
Logged
Re: Programming Q&A
« Reply #10 on: June 25, 2008, 10:56:56 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I know, but most people who grab QBasic usually get QuickBASIC afterwards or accidentally anyway, and all the QBasic communities I've seen generally don't care if you use Q or Quick. The words have practically become interchangeable amongst them, and since they were where I started learning programming, I've been using them interchangeably.
« Last Edit: June 25, 2008, 11:00:13 am by TheDarkJay »
Logged
Re: Programming Q&A
« Reply #11 on: June 25, 2008, 11:06:41 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Dosen't matter TheDarkJay, this isn't a debate topic.
Logged
Re: Programming Q&A
« Reply #12 on: June 25, 2008, 11:20:20 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I know, I just always will defend myself when approached with even minor criticism. It's an instinctive thing :)

Anyway, back to the questions!

Actually, they is something I've been wondering. Do operating systems clean up after programs if memory isn't freed by the program? I mean, if I call a new object and don't delete it, when the program closes is that object going to be taking up memory in the RAM until the OS shuts down, or is it going to be gone?
Don't worry, I know all allocated memory should be deallocated in a program, this is just morbid curiosity speaking :)
Logged
Re: Programming Q&A
« Reply #13 on: June 25, 2008, 11:41:27 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Actually, they is something I've been wondering. Do operating systems clean up after programs if memory isn't freed by the program? I mean, if I call a new object and don't delete it, when the program closes is that object going to be taking up memory in the RAM until the OS shuts down, or is it going to be gone?
Don't worry, I know all allocated memory should be deallocated in a program, this is just morbid curiosity speaking :)
Yes when a program finishs the entire working set allocated to it is disposed and recycled.
Logged
Re: Programming Q&A
« Reply #14 on: June 25, 2008, 05:14:17 pm »
  • If not now, when?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 520
Actually, they is something I've been wondering. Do operating systems clean up after programs if memory isn't freed by the program? I mean, if I call a new object and don't delete it, when the program closes is that object going to be taking up memory in the RAM until the OS shuts down, or is it going to be gone?
Don't worry, I know all allocated memory should be deallocated in a program, this is just morbid curiosity speaking :)
Nearly everyone of them does, but do not depend on it. You should not just assume that any mess you make will be cleaned up when the program exits. Instead, you should try to clean up for yourself.
Logged
Re: Programming Q&A
« Reply #15 on: June 25, 2008, 05:18:03 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I know that. Hell, I usually make sure that happens during the testing period with two global integers and a few macros counting the number of new and delete calls, making sure the numbers match by outputting them when the program closes.
Logged
Re: Programming Q&A
« Reply #16 on: June 25, 2008, 05:21:08 pm »
  • If not now, when?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 520
I know that. Hell, I usually make sure that happens during the testing period with two global integers and a few macros counting the number of new and delete calls, making sure the numbers match by outputting them when the program closes.
Oops, I overlooked the last sentence in your post :P In that case, disregard my last sentence.
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #17 on: June 26, 2008, 12:10:26 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Okay what is wrong with this PHP script? My brain hurts so bad....

Code: [Select]
<?PHP
if (isset($_GET['do']))
{
switch ($_GET['do'])
{
case 'home':
echo '<p><h1> Home </h1></p>';
echo 'Content for this item is not yet complete.';
break;
case 'services':
echo '<p><h1> Services </h1></p>';
echo 'Content for this item is not yet complete.';
if (isset($_GET['actionid'])) {
switch ($_GET['actionid']) {
case '0001':
echo '<p> Translation / Interpretation </p>';
case '0002':
echo '<p> Language Program Building </p>';
case '0003':
echo '<p> Online Teaching / Tutoring </p>';
default:
echo '<p> Incorrect actionid, please try again.</p>';
}
} else
{
echo 'Error code# xxx2, actionid was not specified.';
}
break;
case 'aboutus':
echo '<p><h1> About Us </h1></p>';
echo 'Content for this item is not yet complete.';
if (isset($_GET['actionid'])) {
switch ($_GET['actionid']) {
case '0004':
echo '<p> Our Mission </p>';
case '0005':
echo '<p> Our Vision </p>';
case '0006':
echo '<p> Our Goals </p>';
case '0007':
echo '<p> Company Founder </p>';
case '0008':
echo '<p> Our Team </p>';
default:
echo '<p> Incorrect actionid, please try again.</p>';
}
} else
{
echo 'Error code# xxx2, actionid was not specified.';
}
break;
case 'contactus':
echo '<p><h1> Contact Us </h1></p>';
echo 'Content for this item is not yet complete.';
if (isset($_GET['actionid'])) {
switch ($_GET['actionid']) {
case '0009':
echo '<p> Questions / Concerns </p>';
case '0010':
echo '<p> Employment Form </p>';
case '0011':
echo '<p> FAQ's </p>';
case '0012':
echo '<p> Contact Information </p>';
default:
echo '<p> Incorrect actionid, please try again.</p>';
}
} else
{
echo 'Error code# xxx2, actionid was not specified.';
}
break;
case 'products':
echo '<p><h1> Products </h1></p>';
echo 'Content for this item is not yet complete.';
if (isset($_GET['actionid'])) {
switch ($_GET['actionid']) {
case '0013':
echo '<p> Product Showcase </p>';
default:
echo '<p> Incorrect actionid, please try again.</p>';
}
} else
{
echo 'Error code# xxx2, actionid was not specified.';
}
break;
default:
echo '<p><h1> Error code# xxx3, Invalid do.</h1></p>';
echo '<p> Please try again </p>';
break;
}
} else
{
echo '<p><h1> Error code# xxx1, do was not specified.</h1></p>';
}
?>
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #18 on: June 26, 2008, 12:14:54 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Give an error when you post scripts please :D. Saves me reading through it all.
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #19 on: June 26, 2008, 12:19:15 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Give an error when you post scripts please :D. Saves me reading through it all.
no error it just doesn't work...

I put <?PHP inlcude 'file.php'; ?>

and the page stopped rendering at that point , which means something is wrong with the script.
Logged
  • For The Swarm
Pages: [1] 2 3 ... 11   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.05 seconds with 77 queries.

anything