(New message)
Subject review (reverse sequence)
Posted by
Tkl1129
Hong Kong (43 posts) bio
Date
Sat 16 Jul 2011 12:38 AM (UTC) [ quote
]
Message
ah..--__--"
yes...How stupid I am !!!..
Thanks~ top
Posted by
Fiendish
USA (849 posts) bio
Global Moderator
Date
Fri 15 Jul 2011 06:48 PM (UTC) [ quote
] Amended on Fri 15 Jul 2011 06:50 PM (UTC) by Fiendish
Message
for i=5,2,-1
the for loop has a 3rd parameter implicitly set to 1 if not used for how much to step by
http://aardwolfclientpackage.googlecode.com/ top
Posted by
Tkl1129
Hong Kong (43 posts) bio
Date
Fri 15 Jul 2011 02:40 PM (UTC) [ quote
]
Message
I have question for "for" function.
Numberic For can
for i = 2,5 do
print(i) -- This return 2 ..3..4..5
end --for
But I want to make a reverse
for i = 5,2 do
print(i) -- Hope display 5..4..3..2..but fail
end --for
do there any method to achieve this?
or only do a stupid thing like
local loop1 = 5 - 2 + 1
local loop2 = 5
for i = 1,loop1 do
print(loop2)
loop2 = loop2 - 1 -- display 5..4..3..2
end-for
Any other method?
Thanks~ top
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
879 views.
Reply to this subject
Start a new subject
  Refresh page
Go to topic:
(Choose topic)
Area Editor: Bug reports
Area Editor: General
Area Editor: News and updates
Area Editor: Suggestions
Area Editor: Tips and tricks
Dawn of Time: Administration
Dawn of Time: Configuration
Dawn of Time: Installing/compiling the server
Dawn of Time: New Dawn Muds Announcements
Dawn of Time: Playing
Dawn of Time: What is Dawn of Time (Dawn)?
Electronics: Microprocessors
Electronics: Operational Amplifiers
Forum: About
Forum: Announcements
Forum: Mailing other users
Forum: Problems
Forum: Registering
Forum: Searching
Forum: Subscribing
Forum: Suggestions
Forum: Test
Forum: Time zones / time display
Forum software: Administration
Forum software: Installation
MUDs: Announcements
MUDs: General
MUDs: MUD Design Concepts
MUSHclient: Announcements
MUSHclient: Beta testing
MUSHclient: Bug reports
MUSHclient: Development
MUSHclient: General
MUSHclient: Getting Started
MUSHclient: International
MUSHclient: Jscript
MUSHclient: Lua
MUSHclient: Miniwindows
MUSHclient: MXP and Pueblo
MUSHclient: Perlscript
MUSHclient: Plugins
MUSHclient: Python
MUSHclient: Suggestions
MUSHclient: Tips and tricks
MUSHclient: VBscript
MUSHclient: Wine
PennMUSH: Compiling the server
PennMUSH: Running the server
Programming: General
Programming: STL
Quilting: General
ROM: Compiling the server
ROM: Running the server
SMAUG: Commands
SMAUG: Compiling the server
SMAUG: Lua
SMAUG: Running the server
SMAUG: SMAUG coding
Search the forum
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )