Excellent, glad it's working for you It takes a little bit of getting used to, and often I was wondering if it was my code or a bug that stopped some things from working. Good luck with the rest of the project

I can confirm that this is the problem - it used to work the way you had it (although that might have been just an accident), but in recent versions it needs a pointer to the string. I used the new command GetGlobalStrAddr instead to fix it:

MUISet 10, #MUIA_String_Accept, GetGlobalStrAddr("0123456789")

But this needs the latest snapshot of AmiBlitz as the command has been added since the 3.6.1 release was put together. Otherwise, Der Wanderer's solution will work in older versions too.

Der Wanderer wrote:It is because you are using MUISet wrong. It it wants a taglist.

@Der WandererThanks Der Wanderer, Dont know why I didn´t see that MUISet needed a taglist, maybe because, in my code it still accept the introduction of some few letters and maybe because the MUISet command also accept attributes. Also, all examples I had seen are from C.

Daedalus wrote:I used the new command GetGlobalStrAddr instead to fix it:

MUISet 10, #MUIA_String_Accept, GetGlobalStrAddr("0123456789")

But this needs the latest snapshot of AmiBlitz as the command has been added since the 3.6.1 release was put together.

@Daedalus For now will use Der Wanderer solution because in my computer at work, where sometimes I use AmiBlitz too, still have version 3.5 but will update soon. Thanks for your solution, didn´t know about GetGlobalStrAddr..

AlfaRomeo wrote:maybe because, in my code it still accept the introduction of some few letters

Yeah, what's happening is that MUI is looking at a "string" in the address pointed to by your string, which is really a temporary buffer - effectively it will be random bytes, so by chance there are some bytes that are allowed. You might find that the accepted characters change over time, depending on what else your program does. I had the same problem with some old code of mine that worked fine with earlier versions of the compiler, but the characters it did allow were different to yours.

The reason MUISet accepts a string without giving an error is that it doesn't know what the object you're setting is going to use the parameter for. Giving a string makes it pass a pointer to a temporary string buffer, some objects might make a copy of that string which is fine, but others just access it directly which is only ok until the buffer is used for something else, then it causes all sorts of strange problems.

The GetGlobalStrAddr() function actually exists in the older versions as Null(), but you shouldn't use that as it has been replaced by the Null keyword in the later versions, and your code won't compile when you upgrade AmiBlitz. So you're probably right to use Der Wanderer's solution for now.

Daedalus wrote:...effectively it will be random bytes, so by chance there are some bytes that are allowed. You might find that the accepted characters change over time, depending on what else your program does.

@Daedalus

I didn´t detected that the accepted characters changed because I´ve tried and modified the code in different ways over the time and in different days so I saw that it accepted some chars but didn´t figured that they are random.