Stupid Question

C

CJ Taylor

Alright,

Bring on the flames

What is pascal case? I think I know it, but after an argument today, I
quesiton myself and want to get the answer from some people.

Thanks,
CJ
 
T

Tom Leylan

CJ: There are no stupid questions only stupid answers :)

lowercase
UPPERCASE
camelCase
PascalCase
 
P

Peter van der Goes

CJ Taylor said:
Alright,

Bring on the flames

What is pascal case? I think I know it, but after an argument today, I
quesiton myself and want to get the answer from some people.

Thanks,
CJ
First, an unsolicited plug for the Microsoft public newsgroups: I doubt you
need be concerned about getting flamed here. IME, the inhabitants here tend
to be far more civilized and helpful than the denizens of many alt. and
other groups. You're unlikely to find self-appointed off-topic police, etc.
here, for example.
As to your question: Assuming you are referring to the capitalization style
and not to the logic structure in Pascal, I found the following definition
in the Visual Studio .NET 2003 help:

"Pascal case
The first letter in the identifier and the first letter of each subsequent
concatenated word are capitalized. You can use Pascal case for identifiers
of three or more characters. For example:
BackColor
Camel case
The first letter of an identifier is lowercase and the first letter of each
subsequent concatenated word is capitalized. For example:
backColor"

I included the Camel case definition, on the off chance that has something
to do with the disagreement you mentioned.
Hope this helps.
 
C

CJ Taylor

Tom,

Thanks for the answer, then in C/C++ when something is declared pascal, what
does that mean?

-CJ
 
T

Tom Leylan

Ahh... you're talking about the Pascal calling convention.

This is an "agreement" about what order the parameters are pushed onto the
stack and who is responsible for popping them off. Pascal pushes them on in
the order they appear in the function call and the called routine cleans
them up afterward. The C convention pushes them on in reverse order and
leaves it to the calling routine to clean them up.

It is called "Pascal" but it is also called STDCALL ... everybody just has
to agree or you couldn't write a DLL in C/C++ that other languages could use
(or vice versa.)

Tom
 
C

CJ Taylor

Tom Leylan said:
Ahh... you're talking about the Pascal calling convention.

This is an "agreement" about what order the parameters are pushed onto the
stack and who is responsible for popping them off. Pascal pushes them on in
the order they appear in the function call and the called routine cleans
them up afterward. The C convention pushes them on in reverse order and
leaves it to the calling routine to clean them up.

It is called "Pascal" but it is also called STDCALL ... everybody just has
to agree or you couldn't write a DLL in C/C++ that other languages could use
(or vice versa.)

Ahh... now I understand. Much appreciated Tom!
 
C

CJ Taylor

So does that mean every function that is exported from ANY DLL that is
readable by another program (exclude .NET for our purposes) is declared
Pascal?
 
T

Tom Leylan

CJ: I don't the exact "rules" but I do know that everybody has to agree on
a convention or the cross-language calls won't operate. It isn't impossible
to have a middleman (function) translate however but in the end everybody
has to agree.

I believe you will find that STDCALL is the typical term but PASCAL, STDCALL
and WINAPI are apparently synonyms. You will also encounter the term
"decoration" it's the additional information oftentimes added (by a
compiler) to a function/procedure name. If that isn't taken into account
what you believe the name of the function to be is not as it appears in the
DLL or library. You can turn off the decorating as I recall, it's been
quite some time since I've written any C/C++.

I'll answer with "probably" and I wouldn't exclude .Net.
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top