![]() |
How to format a While... Wend correctly? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: How to format a While... Wend correctly? (/showthread.php?tid=2466) |
RE: How to format a While... Wend correctly? - PhilOfPerth - 02-29-2024 (02-29-2024, 03:21 PM)bplus Wrote: Here is my RA method tested with zebra and some of your words, no rootbeer here either but does find zebra OK No, the list was a direct download from the 'net, without sorting (but I did filter my own lists for shorter words and to remove some "F'" and "C" words, to make it suitable for general consumption. RE: How to format a While... Wend correctly? - PhilOfPerth - 02-29-2024 (02-29-2024, 02:53 PM)bplus Wrote: cat = to vomit??? that's what a cat is? That's a weird definition. I searches several dictiomaries and couldn't match it, but a search on VOMIT came up with a slang phrase, "to shoot the cat". ![]() That's as close as I can get! RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 (02-29-2024, 06:33 PM)bplus Wrote: So something else is going on that using count to control stop fixes.I think the issue you're seeing is from the last line being blank. I don't think it terminates with a chr$(10), so you're never actually advancing to the end of the file. Add a check for If temp1$ = "" Then Exit Do in there, and you're golden. Your endless loop is basically start point = 1234567890, end point = 0... then at the end of that loop, start point = end point + 1... so it just starts reading the whole file over and over and over and over and over and over again. Exit it with a check for that blank line, and you skip that reset to 0. ![]() RE: How to format a While... Wend correctly? - SMcNeill - 02-29-2024 (02-29-2024, 11:23 PM)PhilOfPerth Wrote:(02-29-2024, 02:53 PM)bplus Wrote: cat = to vomit??? that's what a cat is? https://en.wiktionary.org/wiki/cat#Verb (02-29-2024, 11:03 PM)PhilOfPerth Wrote:(02-29-2024, 03:21 PM)bplus Wrote: Here is my RA method tested with zebra and some of your words, no rootbeer here either but does find zebra OK The problem wasn't with the list. It was with SINGLE losing precision counting character position with the list. A single variable type can only got up to 16.3 million or so, before it swaps over to scientific notation. The file is over 17 million bytes in size, and thus the issue I was having. ![]() You still might want to grab the version I posted as an attachment a few versions up. It cleans out those 2 header lines and removes a blank line at the end, and makes it so you only have to look for CHR$(10) line endings instead of chr$(13) + chr$(10), which reduces overall size by 275k bytes. (one byte for each line in the file.) RE: How to format a While... Wend correctly? - bplus - 02-29-2024 (02-29-2024, 11:27 PM)SMcNeill Wrote:(02-29-2024, 06:33 PM)bplus Wrote: So something else is going on that using count to control stop fixes.I think the issue you're seeing is from the last line being blank. I don't think it terminates with a chr$(10), so you're never actually advancing to the end of the file. +1 That sounds so likely and nicely reasoned I don't even want to test and find out it's wrong. ;-)) I've been working on getting v3.12 loaded and copying my 13,994 files and 1051 folders to a backup drive and before that, storing away or dumping 2 months of files and pictures, whew! Confirmed, I tested by ending loop with this: Code: (Select All) Loop Until sp >= Len(temp$) Or ep = 0 RE: How to format a While... Wend correctly? - SpriggsySpriggs - 03-01-2024 At a certain point, dealing with a dictionary of that size sounds better suited for a SQLite database. RE: How to format a While... Wend correctly? - mdijkens - 03-01-2024 This file is so small, just keep it in a small corner of your memory Makes life much easier also. Takes 39ms on my older i5 system: Code: (Select All) Dim Shared words As String RE: How to format a While... Wend correctly? - bplus - 03-01-2024 Oh that looks pretty nice and efficient, way to use that tab char! OK I was testing that function and it found another definition for CAT: Code: (Select All) Dim Shared words As String So it found cat somewhere else in Collins.txt??? I verified the Collins def of CAT as 'to vomit' so how are we finding this new definition? Also mouse looked different. RE: How to format a While... Wend correctly? - SMcNeill - 03-01-2024 You're getting the 2nd half of "alley cat" definition. Which is why a look up list is better than a INSTR search. ![]() You might try to search for CHR$(10) + word$ + CHR$(9), for the line ending from the previous line, plus the word, with the tab separator after. RE: How to format a While... Wend correctly? - bplus - 03-01-2024 that might work except for AA but who cares about that ;-)) I am starting to think the RA method wasn't too terrible ![]() The definitions doesn't even have to be RA. |