Jump to content

Recommended Posts

Posted

Is there a way to get a random line from a text file?

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Posted

Nope, none at all. Its not like this is a scripting language capable of advanced tasks or anything.

Honestly, was this "Ask question before thinking" day? I've just read half a dozen posts (Including another by the author of this thread) and if the authors would just think for two minutes about their question, they'd realize the answer instead of running off to the forum. Is thinking taboo?

Posted

thanks valik, *sigh*

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Posted

icic, ok :) here comes another question. is there a way to find the ammount of lines in a text file?

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
  • Developers
Posted

icic, ok :) here comes another question. is there a way to find the ammount of lines in a text file?

<{POST_SNAPBACK}>

#include <file.au3>

$cnt = _FileCountLines( $sFilePath )

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

and now for the final question. =-o can i make it so the random number is always an integer?

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Posted

and now for the final question. =-o can i make it so the random number is always an integer?

<{POST_SNAPBACK}>

if only there were a function that returned an integer... that'd be great.

"I'm not even supposed to be here today!" -Dante (Hicks)

  • Developers
Posted

can i make it so the random number is always an integer?

<{POST_SNAPBACK}>

F1 (open the helpfile from your editor)...

click on search.

type Integer

Hit Enter..

Make an educated guess which function would be the best option.

try it....

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

omg lol i asked three very dumb questions in a row, thanks guys

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Guest BL@(K-R34P3R
Posted

Hey Jon, future suggestion. Make a random function like that of Java. It can randomly generate numbers between a given range. I was making a script for Java with that earlier today.

Posted

Hey Jon, future suggestion. Make a random function like that of Java. It can randomly generate numbers between a given range. I was making a script for Java with that earlier today.

<{POST_SNAPBACK}>

How does Java's differ from the current random function?
Guest BL@(K-R34P3R
Posted

Ya, what ezzetabi said. It actually choses a random number.

Posted

Black, are you braindead today or is it a reoccurring tragedy? ezzetabi was refering to AutoIt not java. It may hurt but you should consider thinking before you post anything.

*** Matt @ MPCS

Posted

lol. Matt, next to Valik you are one of the funniest people on this forum :). Ah but Valik, he just has so many quotes, you still need some work :)

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Guest BL@(K-R34P3R
Posted

No, if you know Java look at the random funciton. It takes in int's parameters... Like 10 -20 and will chose a random number between them.

Posted

Whats your point? That's functionally identical to:

Int(Random(10, 20))

AutoIt returns floating pointer numbers by default. If you want an Int, tell it to give you an Int by casting it to one.

Guest BL@(K-R34P3R
Posted

I know that... I already learned that the AutoIt random function does that after posting my first thing.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...