difference between a library and a scope?

Sartan

New Member
Reaction score
23
as topic, whats the difference between a library and scope?
can a library be called a "class" in c#/c++?
if not, what "function" can you draw a synonym too "class" for?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
library is placed at the topmost part while scope is lower.
If you want systematic coding in your map, ignore scope, use library.
Vexorian removed scope in Zinc.
IMO, scope is quite useless. :p
 

Sartan

New Member
Reaction score
23
library is placed at the topmost part while scope is lower.
which means? :p

If you want systematic coding in your map, ignore scope, use library.
how is library more systematic than scopes?
Vexorian removed scope in Zinc.
i have no idea w/e Zinc is :p

care to explain why?^^
and also what is the defination of class (in c#) in JASS?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Libraries will enable you to use all of the functions (If they aren't [ljass]private[/ljass] functions :p) in any other trigger in your map...

This is done my, when you start the map, it's all moved into the Map Header which is, as kingking said, at the top of the map (Meaning at the top of the trigger list in the trigger editor XD)

Scopes simply doesn't do that, but it's the same otherwise ;)

Bot hscopes and libraries enables you to use vJASS features, such as private/public keyworks for functions, globals, struct, methods etc.

They also enable you to use structs (Don't know if you can do this outside scopes/libraries, but I believe not... It's a vJASS feature still) which basically is an integer, but you can still store information in it... (It's hard to explain for me, as I don't exactly know the deppest information on it :p)

how is library more systematic than scopes?

Well, I'd believe that it's ones oppinion, as I still use scopes more than libraries... Simply because if you make a spell, you will not want to use the functions in it outside the spell, and therefore you make it unable to be so by using scopes :p
But, if you make a system, then you'll definately want to be able to use the functions outside the library/scope, and here you should use libraries :D

i have no idea w/e Zinc is :p

Then don't mind if... It's simply an alternative of the vJASS language, if you don't like the syntax of it :D

And, I'd believe that libraries/scopes are just about the same as classes in C languages, because they aren't really namespaces... :S
 

Sartan

New Member
Reaction score
23
Libraries will enable you to use all of the functions (If they aren't [ljass]private[/ljass] functions :p) in any other trigger in your map...

This is done my, when you start the map, it's all moved into the Map Header which is, as kingking said, at the top of the map (Meaning at the top of the trigger list in the trigger editor XD)

Scopes simply doesn't do that, but it's the same otherwise ;)

Bot hscopes and libraries enables you to use vJASS features, such as private/public keyworks for functions, globals, struct, methods etc.

They also enable you to use structs (Don't know if you can do this outside scopes/libraries, but I believe not... It's a vJASS feature still) which basically is an integer, but you can still store information in it... (It's hard to explain for me, as I don't exactly know the deppest information on it :p)



Well, I'd believe that it's ones oppinion, as I still use scopes more than libraries... Simply because if you make a spell, you will not want to use the functions in it outside the spell, and therefore you make it unable to be so by using scopes :p
But, if you make a system, then you'll definately want to be able to use the functions outside the library/scope, and here you should use libraries :D



Then don't mind if... It's simply an alternative of the vJASS language, if you don't like the syntax of it :D

And, I'd believe that libraries/scopes are just about the same as classes in C languages, because they aren't really namespaces... :S

ty for the detalied information!

then i understand the basic concept of these.
libraries sounds axactly as classes in c# and can you call libraries "global triggers" and scopes "local triggers"?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
They also enable you to use structs (Don't know if you can do this outside scopes/libraries, but I believe not...
Structs are certainly not dependant on scopes and libraries. Why would they be?

For that matter, the use of almost everything else you said (private/public keyworks for functions, globals, struct, methods etc) isn't either. The only exception is public or private functions, since they need to be within a scope or a library to be public or private. Members of structs can certainly be private or public without involving scopes, and global blocks... Well, the members within global blocks can only be private or public if they're within a library or scope, but global blocks certainly do not need scopes or libraries to be declared. In fact, it seems as though it's far easier to list off where global blocks can't be declared than where they can be. You can stick them just about anywhere. And I mean anywhere:
JASS:
function vJassIsEpic takes nothing returns nothing
    globals
        string s = "Horrifying syntax abuse win!"
    endglobals
    call BJDebugMsg(s)
endfunction
 

Komaqtion

You can change this now in User CP.
Reaction score
469
For that matter, the use of almost everything else you said (private/public keyworks for functions, globals, struct, methods etc) isn't either. The only exception is public or private functions, since they need to be within a scope or a library to be public or private.

That's what I said !
"private/public keyworks for functions, globals, struct, methods etc" meaning, the keywords public/private can be used for functions, globals, structs, methods...
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Oh, I see...
Well, the bit about methods is still wrong, and probably what threw me off to thinking you meant something else. You certainly do not need libraries and scopes for using those keywords on methods :)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, I know... But those things might still be a bit too complicated for this guys, if he doesn't really know what scopes and libraries are yet..

But yeah, it should still be correct information :D
 

Chaos_Knight

New Member
Reaction score
39
Yeah, I know... But those things might still be a bit too complicated for this guys, if he doesn't really know what scopes and libraries are yet..

But yeah, it should still be correct information :D

But if i use a Library, isnt that like a Saving Function , which is used for other maps to use?

like this:
[lJASS]private function Whatever takes nothing extends YOURLIBRARY[/lJASS]

??
 

Komaqtion

You can change this now in User CP.
Reaction score
469
What ?! :S

"Saving Function" ?!

And no, you can't do that to a function...
You can only extend structs, with other structs (If I remember correctly :S)...
 

Sartan

New Member
Reaction score
23
well ofc i'm new too this, never used jass before, and after i readed that JASS tut by Vexorian that said JASS was simulary to c#/c++. so i though i would give it a try.
 

SanKakU

Member
Reaction score
21
one thing that the editor keeps reminding me, is that libraries cannot require scopes. food for thought.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top