generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: diffrence between pairs and ipairs

Previous Thread :: Next Thread 
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 11:46 AM
??
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
16 Mar 2015 11:48 AM
pairs gets all values in the table


ipairs gets array values only
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 11:51 AM
okay but what are array values again?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
16 Mar 2015 11:58 AM
integer indices. Up to the first nil value.
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 12:00 PM
and will it also break at object values?
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
16 Mar 2015 12:09 PM
It doesn't break at object values.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
16 Mar 2015 12:34 PM
i tested it. there is no difference. at least, i dont see one
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
16 Mar 2015 12:37 PM
local t = {hi = 1, "fsih", "Tuber", scrub = "Newb",8}

for i,v in ipairs(t) do print(v) end

--> fsih
--> Tuber
--> 8
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
16 Mar 2015 12:41 PM
so ipairs doesnt print variables in tables?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
16 Mar 2015 12:58 PM
No, it works only on integer keys. We already said that >:(
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
16 Mar 2015 02:54 PM
So only numbers, strings, objects?

{1,"Hello",game.Workspace.BasePlate}
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
16 Mar 2015 02:59 PM
No, only integer indices.


Table = {Index = Vale, Index = Value, Index = Value}
Some people also use the term Key instead of Index.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image