Raised This Month: $51 Target: $400
 12% 

Programming for starters


Post New Thread Reply   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 20:59   Re: Programming for starters
Reply With Quote #61

Quote:
Originally Posted by Atspulgs View Post
Ok,
1st of all it doesnt even tells me what language it is.(so what is this language?)Edited: Ok i see now its pawn or something (never been able to remember the name of this language) Oh and rly small letters there

Is it object oriented?

2nd i was confused about the variable declaration you used. As im more familiar with variables such as short, long, int, char, boolean and so on. (i would like some clearing there.)

3rd (this is more personal understanding) I noticed that you explained the function. I dunno but it looked like a method to me so it confused me a bit. (so what is a method now and what is a function).

there are loads of things that could be added but i consider they were not meant to be included in this tutorial. (but i would like to see somewhat more advanced stuff after clearing my first questions and confusions i mentioned above)

(i would say im looking forward to next parts and i will read trough posts that were made and edit my post if anything changes)

P.S. i am a beginner at programming and i have little understanding of it, in my opinion.

Added later on: is there an ebook on differences between pawn and java? its just that im more familiar with java than C. thx.
Not objected orient, a method is a function associated to an object, there are not int, long, short, double (or any type keyword) because pawn is typeless. There's only a type in pawn called "cell".
__________________
joaquimandrade is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-01-2009 , 21:07   Re: Programming for starters
Reply With Quote #62

thx, that explains a lot.
im reading the wiki and i just want someone to explain this to me more clearly
Quote:
new a = 3
//This is also totally invalid.
//a must be a constant number.
new BadArray[a]

//So this is valid:
const b = 3
new GoodArray[b]
thx
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com

Last edited by Atspulgs; 06-01-2009 at 21:13.
Atspulgs is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 21:15   Re: Programming for starters
Reply With Quote #63

Quote:
Originally Posted by Atspulgs View Post
thx, that explains a lot.
im reading the wiki and i just want someone to explain this to me more clearly

thx
It's a constraint of the language. Arrays must have a constant size, known at compile time.
__________________
joaquimandrade is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-01-2009 , 21:25   Re: Programming for starters
Reply With Quote #64

so basically const says this variable cannot be changed, correct?
another question i stumbled upon is:
if i wan to declare an array of numbers that happened to be between 0 and 255, how will it know whether to use ascii or not?
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 21:37   Re: Programming for starters
Reply With Quote #65

Quote:
Originally Posted by Atspulgs View Post
so basically const says this variable cannot be changed, correct?
another question i stumbled upon is:
if i wan to declare an array of numbers that happened to be between 0 and 255, how will it know whether to use ascii or not?
Correct.

When you save a value between 0 and 255 in a variable you can read it as character or as a number. It doesn't depend on how you store it. It depends on how you use it.
__________________
joaquimandrade is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-01-2009 , 21:43   Re: Programming for starters
Reply With Quote #66

ok that answer is going to be alright for now as i havent finished reading the wiki page and i have a feeling there might be an answer so that would be it for now thx.
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 21:52   Re: Programming for starters
Reply With Quote #67

Quote:
Originally Posted by Atspulgs View Post
ok that answer is going to be alright for now as i havent finished reading the wiki page and i have a feeling there might be an answer so that would be it for now thx.
Ask what you want whenever you need.
__________________
joaquimandrade is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-01-2009 , 22:04   Re: Programming for starters
Reply With Quote #68

i have been introduced with pawn. Now when i make an include, it allows me to use prewritten functions for example amxmodx functions right? Are they written in pawn? (just to clarify)
either way can u briefly explain the use of public and private and/or other function prefixes (not sure how to call them).

i also noticed that there is a bit of a hierarchy. can you also warn me on can's and cant's
thx
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com

Last edited by Atspulgs; 06-01-2009 at 22:09.
Atspulgs is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-01-2009 , 22:22   Re: Programming for starters
Reply With Quote #69

Quote:
Originally Posted by Atspulgs View Post
i have been introduced with pawn. Now when i make an include, it allows me to use prewritten functions for example amxmodx functions right? Are they written in pawn? (just to clarify)
either way can u briefly explain the use of public and private and/or other function prefixes (not sure how to call them).

i also noticed that there is a bit of a hierarchy. can you also warn me on can's and cant's
thx
With an include you include another file. Just that. It's not a special file. The "prewritten functions" you are talking about are called natives and are provided by amxmodx modules. They are declared in include files but you don't need an include file to declare them.

Public and private are visibility modifiers. A private function can't be called from outside it's plugin so you can't associate it to a command or call it via a scheduled task.

About the hierarchy I don't know what you are talking about.
__________________
joaquimandrade is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-01-2009 , 22:25   Re: Programming for starters
Reply With Quote #70

thx for that.
ill be taking my leave for im tired.
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode