i need to do a loop from 000 to 666 (example)
000 001 002 003 004 005 006 010 011 012 013 014 015 016 020 021 022 023 024 025 026 ..... 666
and put the number to text file.
i need help
Professional Software Development Tools
i need to do a loop from 000 to 666 (example)
000 001 002 003 004 005 006 010 011 012 013 014 015 016 020 021 022 023 024 025 026 ..... 666
and put the number to text file.
i need help
Use a for loop, the AMS helpfile gives you lots of info about loops. There's also the repeat and while loop.
Code:for(i=1, 666)do TextFile.WriteFromString(_SourceFolder.."\\loop.txt", tostring(i).."\r\n", true); end
i dont wont the numbers 7,8 and 9 i need to write to a txt file all the numbers from 000 to 666 but not the numbers with 7,8 or 9 like the example.
000 001 002 003 004 005 006 010 011 012 013 014 015 016 020 021 022 023 024 025 026 ..... 666
and i need it in 3 numbes (example 0 is 000 and 1 is 001)
i dont wont numbers like
108
109
599
619
i dont wont number who include the numbers 7,8 or 9;
thank you for the help
did you try my sample code ..?
it does what exactly you wanted in your first post
but if you changed your mind or want a different thing
just tell us what is it
also i understood nothing from these words
you should elaborate more to get help
i dont wont numbers like
108
109
599
619
i dont wont number who include the numbers 7,8 or 9;
thank you for the help
googling we find: http://www.purplemath.com/modules/numbbase2.htm
Using the formula for converting decimal to base 7 numbers you should be able develop a function to write your text numbers...
hth
Code:for i=0, 666 do local LastNum = tonumber(String.Right(tostring(i), 1)); local s = ""; if(LastNum~=7)and(LastNum~=8)and(LastNum~=9)then if(i<10)then s = "00"..i; elseif(i<100)then s = "0"..i; else s = tostring(i); end TextFile.WriteFromString(_SourceFolder.."\\numbers.txt", s.."\r\n", true); end end
for count1 = 0, 6 do
for count2 = 0, 6 do
for count3 = 0, 6 do
TextFile.WriteFromString("c:\\numbers.txt", count1 .. count2 .. count3 .. "\r\n", true);
end
end
end
thank you for the help![]()