Multiple errors with this project, please help me !

This simple app should do the following:

Load a text file that has been encrypted (using xojo’s encodebaste64), decript it and just display the content on a set of bevebuttons (named Kits).
There are two major problems that I don’t understand:

  1. Even if I used the right encoding it doesnt display correctly unicode characters
  2. For some reason I can only load the files once and then it gets all messed up

I’m sure it’s easier to understad what I’m saying by trying my app here on the link there’s also the text file to be load .

I just can’t get my head around this (also because this is code I recylced from another app where it works fine)

  1. You set the encoding when you read the base64encoded text. That’s the wrong place. You need to set the encoding after you decode the text.
items(i)=DefineEncoding(items(i), Encodings.UTF8)
if app.ISgoodmulti(items(i)) =true then filequestions.append items(i)
  1. You begin by defining 2 separate arrays, Questions and FileQuestions. Then you execute this code in Startmenu:
Questions = FileQuestions

That makes both properties refer to the same array. It does not copy the contents from FileQuestions to Questions, as I presume you intended. It makes them the same array. So then when you execute Startmenu again, this line:

Redim Questions(-1)

removes the contents from the array that both Questions and FileQuestions point to.

Thanks Tim. All solved now.
I would have nerver come to this conclusion on my own because I use very similar code on other projects

So for copying two arrays the only way is copying each individual item with a cycle ?


[code]For i As Integer = 0 To Questions.Ubound

Redim Questions(-1)[/code]