ChrB is from 0 - 255 so you are trying to test over 255 which is probably never gonna happen.
I think you want to check for 0-31 (inclusive), these characters are always invisible in text editors.
see here:
Chr >= 128 are ASCII extended (or UTF-8)
Const invisible_lower_bound = 0
Const invisible_upper_bound = 31
Var character As Integer = AscB(Mid(AnEntry, Char_Pos, 1))
If character >= invisible_lower_bound And character <= invisible_upper_bound Then
// Remove or skip this character from printing
End If
I think you want to check for 0-31 (inclusive), these characters are always invisible in text editors.
My fault, I do not say where the text come from. These are file names, so no ASCII 0 - 31.
ascii-code.com
No one (or he do not care) ever told him that the notion of “Extended ASCII” does not exists.
There is definitely something in my text as I already wrote in my original text because Xojo IDE remove something and the ListBox Sort works fine.
When I sort on a specific column, I get a strange behavior on Column(0) who holds the magazine name and issue number. In some cases, the story was reprinted some years after the original and the lower issue number Row sometimes appears after the higher issue number. This have no sense: the clicked column group Cells with the same contents, but a second sort is done to produce that.
The original text shows the magazine with ascending numbers (1 to 481 in this case).
Back to Xojo:
I will check if I can do something with a MemoryBlock.
Talking about MemoryBlock: the doc page talks about 32-bit applications…
The example (link below) do not have any sense (to me): it display how to create a MemoryBlock with 8 Bytes from a 8 Bytes MemoryBlock !
I was awaiting:
Mandrake 023
Mandrake 024
Mandrake 341r (023)
Mandrake 342r (024)
and I still do not know why.
Remember: the sort is done on another Column. The data in that column for the 4 lines above is the same. I do not have implemented any custom Sort for any other Column.
As previously mentioned, AscB() returns the value of a byte which can never be greater than 255. Characters with codepoints higher than 255 are multi-byte. So you need to use the Asc() function instead of AscB().
Why?
The order you want is the one governed by THIS column.
Clearly the thing that is causing a strange order is in ‘the other column’
The most likely cause is that ‘the other column’ does not actually contain the same text.
Maybe there are simply 2 spaces between Mandrake and 341r
No, one space only. I removed “r (023)” and “r 024)” and get the same strange behavior.
When no special sorting code is set (using default), and you have duplicate cells in the Column you click for Sort, a secondary sort is done, but I do not know the criteria nor what Column is/are used.
I will let time run some days and come back (next week)… I may come with a new look… This is the good side of having hazardous memory…
I may forgot to say that all Rows appeared from issue 1 thru issue 451. If the Sort is done on a single column, the one I clicked on, the returned order in the Magazine Issue Number will be the lower value first, until the higher value (when some Cells in the sorted column contains the same String).
When I Sort Column(0) - the Magazine Issue Number - the ListBox contents is sorted numerically (1 thru 451 or 451 thru 1).
If you are not getting the data in the order you want by clicking a column, get the data from a database using a sort that operates on two fields.
Populate the listbox using the sorted dataset.
Back home yesterday (and a reboot later), I continued to add code to store the text in a data base (SQLite) and in a run, I looked what I had on the screen (instead of the generated .sqlite file and discovered the data appears correctly.
I have to check once more - just in case I was not dreaming - and understand my troubles in what is stored in the .sqlite file to be sure there is no more a problem.
Some of the other entries have a difference in the story title (not the magazine/issue #).
With the Data Base creation, I spotteds some errors in my text data (’ instead of 4 for example - sqlite does not liked that - or standard single quote ’ instead of curly single quote ’).
A last clue is the Memory: too many application that are running together, maybe. I closed some and try again.
It tooks me time, but after introducing some bugs in the code, I changed the structure of the Method, add a call to read the data and write them in a SQLite data base, then Add a button and code to read and sort based on two columns.
Results: far clear code / working feature.
Now I get the similmar entries displayed from the older magazine number to the latest number.
I had a moment yesterday when I was at home (without internet to search how to sort a data base on two Columns), then recall that I certainly have the SQLite documentation (as html) and found it (so simple, but I forgot it).
Now, I have my data displayed on the correct order.