BP7 questions about random filenames and text input 
Author Message
 BP7 questions about random filenames and text input

Quote:

> Hi,
> I would like for my program to be able to accept long strings of input

> (i.e. notepad or something), currently I am just using ReadLn which is

> limited to about 255 char or something.

     The limitation is probably in the data structure (though Readln,
which I pronounce "Read Line", is designed to read a "line" of text).
If you want to read in "unlimited" (up tothe size of memory) text, you
need an "unlimited" data structure, such as a linked list.  You probably
also want to read in single characters, and not worry about
end-of-lines.

Quote:
> Also,
> I would like for this same program to generate random file names but
> with a specific format (i.e. S8990800.899 etc...).
> Where should I be looking?

Simply code the algorithm you want for the "random" file name.  If you
want a random letter at a certain point, generate a uniform random
number from 1 to 26 and use it to index into the alphabet.  If you want
a random digit, choose from 1 to 10.  If you want amixture of letters
and digits, choose from 1 to 36, with the rule that if 1..10, it's a
number,
if 11..36, it's a letter (or reverse the rule).  If you want an 8.3
pattern, generate 8 "random" characters, output the dot, then three
more.

Bob Schor
Pascal Enthusiast



Sat, 18 Dec 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. BP7 questions about random filenames and text input

2. BP7 questions about random filenames and text input

3. BP7 questions about random filenames and text input

4. Random filenames in BTP7.0

5. Random filenames in BTP7.0

6. BP7 / Long Filenames LFN

7. long filenames under BP7.0 ?

8. Release LFN v1.10 - Long filename unit for Win9x and TP6 up to BP7

9. Release LFN v1.10 - Long filename unit for Win9x and TP6 up to BP7

10. Release LFN v1.09 - Long filename unit for Win9x and TP6 up to BP7

11. Release LFN v1.09 - Long filename unit for Win9x and TP6 up to BP7

12. about random() in BP7

 

 
Powered by phpBB® Forum Software