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.

Newcomers DBPro Corner / Making a menu

Author
Message
Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 22nd Oct 2005 15:29 Edited at: 22nd Oct 2005 18:07
I made this tutorial for someone at C4D cafe, to show how you could use variables in a usable code. I think his name on here is Implosive.

Well here is your tutorial dudes, read the notes as they explain things




[edit]
Forgot to mention this is directed at Dark Basic Professional, but I don't see why it wouldn't work in Dark Basic Classic

The name is back dudes!
http://seppukuarts.afraid.org
Implosive
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location:
Posted: 22nd Oct 2005 15:36
thanks alot! glad i met u over at the cafe

~Implosive
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Oct 2005 17:52
Quote: "`this means the variable 'm' has no value yet, the '#' shows the variable is a number"


Not quite correct and a little confusing so you might want to edit that bit.

Even if you don't have the # on the end, the variable is still a number. The # identifier makes a numeric variable a float. Leave it off and it's an integer - but still a number variable.

In your program m is an integer and not a float so you shouldn't use the # symbol in the variable name.

TDK_Man

Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 22nd Oct 2005 18:05 Edited at: 22nd Oct 2005 18:05
I see, my bad, I'll edit that

@Implosive, your welcome, hope it helps

The name is back dudes!
http://seppukuarts.afraid.org
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 22nd Oct 2005 20:25
Quote: "In your program m is an integer and not a float so you shouldn't use the # symbol in the variable name."


I've noticed that this is very confusing to many newbies (and several non-newbies). They just can't get the concept that integer is a whole number and a real number is a number with a decimial point.
Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 22nd Oct 2005 22:13
I never honestly cared before, and thought the # thing signified its a number, guess I was wrong. To me using # never did anything wrong and lived without an explanation

The name is back dudes!
http://seppukuarts.afraid.org
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Oct 2005 01:38
Quote: "I never honestly cared before, and thought the # thing signified its a number, guess I was wrong. To me using # never did anything wrong and lived without an explanation"


That's probably why a lot of people don't know the difference... using real numbers works just as well as not using real numbers.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Oct 2005 02:37
Yes you can mix and match with them. You can say

Num#=4

and it will still work. The important thing to remember is that it takes DB a lot longer to do things with floats.

Integers are much, much faster.

TDK_Man

Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 23rd Oct 2005 12:01
k kewl, then integers it is...as they say hash is bad for you, just like my jokes

The name is back dudes!
http://seppukuarts.afraid.org

Login to post a reply

Server time is: 2024-09-24 07:29:14
Your offset time is: 2024-09-24 07:29:14