Hiya, Partners!
I have been into it for 12 hours straight this week-end, my son is very unhappy. Looks like I am getting pretty close but need your help, Again. I will post my first Option/Solution, then the next through another post. Here it goes:
'PROPOSED SOLUTION 1
'Button below formats words in one column, the words however, are all
over the place
'I attemepted to use vbCrlf to enable LineFeed, no joy there.
'Well it gets me to the next line, the words are broken in pieces.
'The Big idea I have is to later have the application look through
Text6.Text using a simple function
'that'll grab exactly the words I want, thus 'GiveMeIt= Asc("Rain") something in that kind of a line, but at least what I want :-)
'FIRST THE TEXT ADDED IN Text6.Text, before ClonegetLength is pressed:
'This is working, but I will need to also tell VB the words I do not
need it to find, thus busted.
'A wildcard, if it exists for searching a .txt file should do the
trick, since searching the actual
'database "Bus*" does in fact give me "Bus", addded/found from
different text, typed my son's
'"the magic school bus" grabbed "the wheels on the bus" as well from my
database...
'Oh! here is what my Like operator atttempt loked like: database is
added here just to see how it's
'getting picked up elsewhere
'SECONDLY, HERE IS THE FORMAT RETURED:
's well f
'rom my d
'atabase. (I lost my d here)
'Oh! here
' is what
' my Like
' operato (there is a space in here, Ltrin will take care of it but the
least of our problems right now)
'r atttem
'pt loked
' like:
'Database (looks good here)
' is adde
'd here j
'ust to s
'ee how i
'getting
'picked u
'p elsewh
'REMARKS: I need my format to read whole words, then drop/tuck them
under one another to resamble:
'well
'from
'my
'database.
'Oh!
'here
'is
'what
'my
'Like
'operator
'atttempt
' I will need to repeat do until to record additional characters I
want, if I need bus for instance
'Do Until i = True
'intLength = Len(strGetWords ) ' the first time in we read the whole
piece
'If intLength <= 3 Then 'here is the trick I have been talking
about, I wanted to add...
'Exit Do 'I got what I wanted, 8 chars for database
'End If
'strBringIn = strBringIn & Left(strGetWord s, 3) & vbCrLf
'strGetWords = Right(strGetWor ds, intLength - 3)
'Loop 'do until Loop ends here
'Text6.Text = strBringIn 'add the formatted results in
'Loop ' found end of file, may or may not search again, provided we're
happy...
In a bit (for Option/Solution 2 forthcoming)
I have been into it for 12 hours straight this week-end, my son is very unhappy. Looks like I am getting pretty close but need your help, Again. I will post my first Option/Solution, then the next through another post. Here it goes:
'PROPOSED SOLUTION 1
'Button below formats words in one column, the words however, are all
over the place
'I attemepted to use vbCrlf to enable LineFeed, no joy there.
'Well it gets me to the next line, the words are broken in pieces.
'The Big idea I have is to later have the application look through
Text6.Text using a simple function
'that'll grab exactly the words I want, thus 'GiveMeIt= Asc("Rain") something in that kind of a line, but at least what I want :-)
Code:
Private Sub ClonegetLength_Click() Open App.Path + "\Test.txt" For Output As #1 'file is opened as in Print to get rid of quotes, just learned this :-) Print #1, Text6.Text 'this should hold enough text, wouldn't you say? Close #1 'close, then reopen below Dim strGetWords As String FileName = "\Test.txt" 'here is our fancy text file again f = FreeFile Open App.Path + FileName For Input As #1 'this time we want to, not only see what's inside, we will ATTEMPT to format Do While Not EOF(f) 'all the way 'til we're happy Line Input #1, strGetWords i = False 'wonderful looping mechanism, allows us to chop it up and fromat, 'set to false (Be sure to do this!) Do Until i = True intLength = Len(strGetWords) ' the first time in we read the whole piece If intLength <= 8 Then 'here is the trick I have been talking about, I wanted to add 'to give it the highest length specific to words the if statement will hope to grab 'as one example, database. But ladies and gentlemen, my format will attempt to break down 'database depending on its position. For now we'll move on, we'll get to that later Exit Do 'I got what I wanted, 8 chars for database End If strBringIn = strBringIn & Left(strGetWords, 8) & vbCrLf 'I am reading left here to make sure I get Train, not rain strGetWords = Right(strGetWords, intLength - 8) ' I also want to read right to allow others words to be tucked under 'previous words, having 10 chars Loop 'do until Loop ends here Text6.Text = strBringIn 'add the formatted results in Loop ' found end of file, may or may not search again, provided we're happy... End Sub 'that's it for us...Below are the results of our positioning of these few words
'This is working, but I will need to also tell VB the words I do not
need it to find, thus busted.
'A wildcard, if it exists for searching a .txt file should do the
trick, since searching the actual
'database "Bus*" does in fact give me "Bus", addded/found from
different text, typed my son's
'"the magic school bus" grabbed "the wheels on the bus" as well from my
database...
'Oh! here is what my Like operator atttempt loked like: database is
added here just to see how it's
'getting picked up elsewhere
'SECONDLY, HERE IS THE FORMAT RETURED:
's well f
'rom my d
'atabase. (I lost my d here)
'Oh! here
' is what
' my Like
' operato (there is a space in here, Ltrin will take care of it but the
least of our problems right now)
'r atttem
'pt loked
' like:
'Database (looks good here)
' is adde
'd here j
'ust to s
'ee how i
'getting
'picked u
'p elsewh
'REMARKS: I need my format to read whole words, then drop/tuck them
under one another to resamble:
'well
'from
'my
'database.
'Oh!
'here
'is
'what
'my
'Like
'operator
'atttempt
' I will need to repeat do until to record additional characters I
want, if I need bus for instance
'Do Until i = True
'intLength = Len(strGetWords ) ' the first time in we read the whole
piece
'If intLength <= 3 Then 'here is the trick I have been talking
about, I wanted to add...
'Exit Do 'I got what I wanted, 8 chars for database
'End If
'strBringIn = strBringIn & Left(strGetWord s, 3) & vbCrLf
'strGetWords = Right(strGetWor ds, intLength - 3)
'Loop 'do until Loop ends here
'Text6.Text = strBringIn 'add the formatted results in
'Loop ' found end of file, may or may not search again, provided we're
happy...
In a bit (for Option/Solution 2 forthcoming)
Comment