=> Operator?

Joined
Jul 19, 2015
Messages
3
Reaction score
1
First Language
English
Primarily Uses
I searched for => on 2 different sites but cannot find what it does.
 
http://www.tutorialspoint.com/ruby/ruby_operators.htm
http://www.rpg-maker.fr/dl/monos/aide/vx/source/rgss/syntax04.html
 
It looks like a symbol used to indicate output resulting from code; for example:

foo = 42defined? foo # => "local-variable"=> is mostly used in the Luna engine and only rarely in the vanilla scripts. For example:

# ----------------------------------------------------------------- # This allows you to set a variable to change the skin of this particular # section of the menu. The default is Variable 1. Remember that it reads # it as a string (e.g. $game_variables[1] = “Menu_Green”). # ----------------------------------------------------------------- :background_variable => 1,Does this mean it changes itself to Variable 1?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
don't know about the first example. In the second it's placing the value of 1 into the hash with the key :background_variable so yes, it's an assignment operator for hashes, but you can't do the same for any type of variable.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
# starts a line  comment so.... it does nothing on the first example.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
oh yeah - I was assuming he wanted to know what it would do if the comment sign were not there. I still don't know :)
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Actually if foo is not a part of a hash table neither do I I suppose. :)
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top