JASS: Moving From GUI to Jass, the Start

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
yeah u make me more understand about return
+rep
_______
SPREADING xIDS
 
H

Hjalle

Guest
Im a total beginner at JASS (almost really), so this helped me alot. Good tutorial. At last i understand the return, takes things :p

+rep and 5 stars :)
 

Tt112233

TH.net Regular
Reaction score
6
on your tutorial, you introduced an example about multiplying function

JASS:
function multiply takes integer a, integer b returns integer
    local variable counter = 1
    loop
        exitwhen counter > b
        set a = a + a
        set counter = counter + 1
    endloop
    return a
endfunction


Suppose the parameter given for this code is

a = 3
b = 3

which the result should return 9 right?

However, if you actually run the code, you would get 12 if you examine the loop since a gets a + a

First loop : 3 + 3 = 6
Second loop : 6 + 6 = 12
Third loop : Counter = b, loop exits here

You might want to make some changes :D

Sorry about double post. I thought that you should include a warning about global variables.

In any practice of computer programming (Yes, this includes JASS), it is almost always a good idea to avoid global variables. They are usually considered bad practice precisely because of their nonlocality: a global variable can potentially be modified from anywhere, and any part of the program may depend on it. A global variable therefore has an unlimited potential for creating mutual dependencies, and adding mutual dependencies increases complexity.

Furthermore, the use of global variables makes software harder to read and understand. Since any code anywhere in the program can change the value of the variable at any time, understanding the use of the variable may entail understanding a large portion of the program. They can lead to problems of naming because a global variable makes a name dangerous to use for any other local or object scope variable.

Well I suppose, in a few cases, global variables can be suitable for use. For example, they can be used to avoid having to pass frequently-used variables continuously throughout several functions.

But the bottom line is, unless if you are absolutely sure that having a global variable would be advantageous in your code, avoid using them.

P.S : (I do not understand why JASS tutorials here do not emphasize this enough. This is a crucial matter in programming).
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Very nice spotting about the function, I will fix it right a way. Thanks!

As for global variables, I agree with you completely, most people agree that locals are better then globals, and locals should be used if possible.
 

Naminator

Coming Back To Life
Reaction score
76
It really made me saw Jass in a different way. Help me a lot!

+Rep. Really good tutorial!
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Great tutorial, it was really helpfull.

Actually, isn't JASS similar to Visual Basic?

People say it is, I have no idea, I never bothered learning C++.

~Gals~, yes locals, if used correctly make a good MUI spells.

So, mods / admins, what's happening with this tutorial, is it approved or disapproved?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
no idea...many tut just scattered around...+rep and push to 5stars :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> So, mods / admins, what's happening with this tutorial, is it approved or disapproved?

Well, at least it's not in the Graveyard yet. :p

> you could get rid of the center alignment from the table of contents and use the default font, as well. Makes easier to read.

I DO agree with that. Somewhat. I think you should make the headers for each of the sections larger and maybe bold, then make the sub-headings beneath them smaller. Also, you might add a blank line between each big section.
 

Tinki3

Special Member
Reaction score
418
>is it approved or disapproved?

I vote for approval.
-Long, and explanatory
-Useful
-Adds to the 'JASS Tutorial' collection(*)

>at least it's not in the Graveyard yet

Wait, AceHart's lurking around the corner!
Joking :p

(*) Wait, that is a good thing, right?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> I vote for approval.

Is there a poll on it? :p Make it happen, then.

I agree. The content certainly warrants approval.
 

Weebl

New Member
Reaction score
5
Very nice tut. I've read a few but they all manage to make even the most basic things look really scary. This however was really comprehensive and made it perfectly clear to me just how simple JASS actually is to learn.

O and by the way I disagree with all the people who say this is too long. Although I don't like unneccessarily drawn-out tuts, this one only takes half an hour (maximum) to read and it teaches you ALL the basics. As far as I'm concerned anyone who isn't willing to spend half an hour learning a comlpete new set of tools shouldn't call himself a modder.
 

cowmenace

New Member
Reaction score
22
I knew absolutely nothing about jass, custom scripts, I was hardcore GUIer I took this tutorial I understand functions, loops, ifthenelse, and so much more that looked like gibberish. Only took me about 1 hr to get thnx u r awesome!!!!!
 

mr_fj

New Member
Reaction score
10
OMG OMG OMG Thank you so much. If you havn't written this, i would never have begun learning Jass. Thx +rep (and maybe next time i see you post somewhere, because of this toturial ^^)

Thanks.























Thanks again :D



















Last time: THANKS!!!! THX THANK'U XD XD XD
 
M

MeRn00b

Guest
WoW, Thats truly a 11 of 10
Goodbye GUI, Hello JASS
+Rep
You really, really did create, it's like >:eek:< just simply amazing

~My thought is, lucky me, for waiting to learn JASS~
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top