Computer Science Canada tokens |
Author: | pokerface [ Tue Nov 09, 2004 7:49 pm ] |
Post subject: | tokens |
i would like to know how to out put a certain amount of tokens coming from a file example: if my text file has 10 words in it, i want to out put 2 words at a time right after each other *********************file************************* one two three four five six seven eight nine ten ********************end of file********************* ************************************************* *******************output************************ one two three four five six seven eight nine ten *******************end of output******************** do u know what i mean? im sorry that i always post new topics but i didnt find anything on tokens from files? ty! |
Author: | myob [ Tue Nov 09, 2004 8:18 pm ] | ||||
Post subject: | |||||
okay i did a program that does that, hopefully it helps this is the code for the program
this is what is in the file "data.txt"
|
Author: | pokerface [ Tue Nov 09, 2004 10:10 pm ] |
Post subject: | |
yes your right about that but i want the user to say how many tokens they want to be on each line! my example was only a example! is there some other code that may do that? |
Author: | myob [ Wed Nov 10, 2004 2:26 am ] | ||
Post subject: | |||
i see you just not very efficient with ur codes yet. look at the following codes and tell me if they do what u want, and check out how much of a different it brings comparing to my first set of codes. sometimes generalization is all you need.
|
Author: | pokerface [ Wed Nov 10, 2004 7:12 pm ] |
Post subject: | |
i have no idea what Quote: var data : flexible array 1 .. 0 of string is? could u explain it to me or show me another way? |
Author: | wtd [ Wed Nov 10, 2004 9:00 pm ] |
Post subject: | |
pokerface wrote: i have no idea what
Quote: var data : flexible array 1 .. 0 of string is? could u explain it to me or show me another way?This is a declaration of an array of strings which can grow later in the program, if necessary. Declaring it with initial bounds of 1 .. 0 means that it has space for nothing, initially. |
Author: | pokerface [ Sat Nov 13, 2004 4:15 pm ] | ||
Post subject: | |||
i think this is easier!
this is all i know how to do it? is there a way to get rud of the second loop without changing to much to my snytax? |
Author: | pokerface [ Mon Nov 15, 2004 10:50 pm ] | ||
Post subject: | |||
Does anyone know how to right justify the output? Every that i tried always makes it funky!!! This is what i got so far!
|
Author: | HyperFlexed [ Tue Nov 16, 2004 8:57 pm ] | ||||
Post subject: | |||||
pokerface wrote: Does anyone know how to right justify the output? Every that i tried always makes it funky!!! This is what i got so far!
|