• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

cJASS Definition Library

Status
Not open for further replies.
Starting a thread where we can post definitions for common use or w/e : ). They may be keywords that are in C and are missing in cJASS, or they may be keywords to make life easier that are just obvious : ).

JASS:
define 
{
    <const> = constant
    <init> = initializer
    <Int> (x) = R2I(x)
    <Float> (x) = x.
}

JASS:
//Use
const int x = 0
scope Hi init ini
Int(7.2)
Float(7)

Trying to make the last 2 into this
JASS:
(Int) 7.2
(Float) 7

This is the start of my list. Everyone feel free to reply with more keywords for shortcuts and better ways to do stuffs =P.
 
Last edited:
Level 3
Joined
Oct 20, 2008
Messages
43
If you want print, you'd better use "cj_print.j" - among all others, it introduces "printf" function, which uses C-like formatting rules for output formatting and "DisplayTextToPlayer" for text output.

For now, you can read about it here


Anyway, the manual is coming in a couple of days =]
 
I think a very simple print statement should still be added, like Perl's simple print. I'm not into typing a whole lot of extra parameters I really don't need and I def hate the idea of typing sBJDebugMsg O-o.

sBJDebugMsg should just be print ^_^.

Also, for the float, didn't think about that, but really I'm still trying to get it to go with just plain typecasting =).

(float) (int) (unit) etc : D. The other handle types will require a special object handling thingie tho that Spawn uses : \.
 
Level 11
Joined
Feb 22, 2006
Messages
752
cJASS has not really become a standard yet. And in my opinion it's not going to become a standard anytime soon because all it really is is a bunch of syntactical eye candy that doesn't really add anything truly functional to JASS.

And in any case, I don't think this is the right place for this thread. I'm moving it to the triggers and scripts section.
 
Status
Not open for further replies.
Top