Search found 221 matches

by pneumatic
30 May 2019, 13:14
Forum: Scripts and Functions
Topic: UTF-8 ini files
Replies: 8
Views: 1532

Re: UTF-8 ini files

Thanks.

To be safe I changed all my ini files to UTF-16, aka "USC2-LE-BOM", by using the parameter UTF-16 with FileAppend.

In future I think I'll just avoid using iniread/write and do it manually.
by pneumatic
29 May 2019, 10:17
Forum: Scripts and Functions
Topic: UTF-8 ini files
Replies: 8
Views: 1532

Re: UTF-8 ini files

I guess UTF-8 is using 1 byte per character which makes it compatible with ANSI which Get/WritePrivateProfileString are interpreting the file as.

But I still don't understand how it knows how many bytes per char are being used by UTF-8 as it could be up to 3.
by pneumatic
29 May 2019, 08:06
Forum: Scripts and Functions
Topic: UTF-8 ini files
Replies: 8
Views: 1532

Re: UTF-8 ini files

UCS-2 LE BOM = UTF-16 LE BOM There's nothing 'wrong' with the IniRead/IniWrite functions per se, just that they can only handle UTF-16 (UTF-16 files are often bigger in size than UTF-8 files if your language uses the Latin alphabet) and ANSI (Unicode to ANSI is lossy). FileAppend,, ini.ini, UTF-8-R...
by pneumatic
27 May 2019, 07:05
Forum: Bug Reports
Topic: DropDownList undocumented behaviour
Replies: 5
Views: 287

Re: DropDownList undocumented behaviour

Why do you want to use a timer to check if the selection in the DropDownList has changed? That's a task for a g-label Unfortunately I have some cases where I can't do that because the DDL selection controls some things external to the application which could change and needs to be enforced with a t...
by pneumatic
27 May 2019, 03:31
Forum: Bug Reports
Topic: DropDownList undocumented behaviour
Replies: 5
Views: 287

Re: DropDownList undocumented behaviour

lexikos wrote:
27 May 2019, 02:30
When the script explicitly assigns to it (or uses it as an output variable)

On further consideration, this isn't actually what my code does, because GuiControlGet uses the output variable CurrVal, not DropDownList, nor does it explicitly assign to DropDownList.
by pneumatic
27 May 2019, 03:07
Forum: Bug Reports
Topic: DropDownList undocumented behaviour
Replies: 5
Views: 287

Re: DropDownList undocumented behaviour

Gui , Main: New Gui , Add , DropDownList , vDropDownList w150, One||Two|Three Gui , Add , Text , vText xp+180 w150 , vDropDownList: Gui , Show , Center SetTimer , GetDDL , 250 return GetDDL: GuiControlGet , CurrVal , Main:, DropDownList GuiControl , Main: , Text , vDropDownList: %CurrVal% return ht...
by pneumatic
27 May 2019, 01:47
Forum: Bug Reports
Topic: DropDownList undocumented behaviour
Replies: 5
Views: 287

DropDownList undocumented behaviour

When the Gui Submit command is used, the control's associated output variable (if any) receives the text of the currently selected item. But it should also mention the output variable receives the item's text before the Gui Submit command is used, if the user is hovering the mouse over a DDL item. ...
by pneumatic
08 May 2019, 17:39
Forum: Ask For Help
Topic: Round() inconsistency
Replies: 6
Views: 284

Re: Round() inconsistency

This is no bug, the result is because the number 1.005 cannot be exactly represented as a float. Instead, 1.005 is stored as something sligthly less. 1.05 cannot either but is stored as something sligthly larger. You can use format to display the float with as many decimal places you like. Thanks, ...
by pneumatic
08 May 2019, 11:14
Forum: Ask For Help
Topic: Round() inconsistency
Replies: 6
Views: 284

Round() inconsistency

Code: Select all

n := 1.05
MsgBox % Round(n,1)
Image

Code: Select all

n := 1.005
MsgBox % Round(n,2)
Image
by pneumatic
04 May 2019, 11:36
Forum: Bug Reports
Topic: SetFormat inconsistent behaviour
Replies: 2
Views: 237

Re: SetFormat inconsistent behaviour

If I SetFormat to 15 or 16 decimal places, the result is the same, but 17 decimal places and the numbers are no longer identical in the MsgBox. Putting SetFormat 15 or 16 decimal places directly before the calculation and MsgBox, doesn't change this behaviour.
by pneumatic
03 May 2019, 13:26
Forum: Bug Reports
Topic: SetFormat inconsistent behaviour
Replies: 2
Views: 237

SetFormat inconsistent behaviour

MsgBox tells me my vars are equivalent, but behind the scenes they aren't. Can't debug my script with MsgBox because it's telling me lies :( #SingleInstance Force SetFormat , Float , 0.3 ;also, removing this makes both tests not equal, ;but only if I don't put it in any functions Test1() Test2() ret...
by pneumatic
28 Mar 2019, 20:45
Forum: Ask For Help
Topic: Efficient way to remove elements from array Topic is solved
Replies: 13
Views: 636

Re: Efficient way to remove elements from array Topic is solved

The most efficient way would be to pluck the elements you would like to remain and place them in their own new array But I didn't want to change the name of the array, I just wanted to remove elements from the already existing array. Restoring the original name seems to require a lot of extra proce...
by pneumatic
28 Mar 2019, 18:38
Forum: Ask For Help
Topic: Efficient way to remove elements from array Topic is solved
Replies: 13
Views: 636

Efficient way to remove elements from array Topic is solved

Hello

Code: Select all

Array := [1,0,1,1,0,1,0,0,0,1,0]
What is the most efficient way to remove all the 0's from this array, leaving no "blank" elements?

Thanks
by pneumatic
08 Mar 2019, 20:12
Forum: Ask For Help
Topic: OnMessage threads clarification needed Topic is solved
Replies: 4
Views: 309

Re: OnMessage threads clarification needed Topic is solved

Thanks just me. I'd prefer to use the workaround of increasing the message check interval, as it seems less convoluted than posting a second message to the script. But it doesn't seem to work: setting Critical 1000 doesn't block the second mouse click from arriving if clicked within a second. Also w...
by pneumatic
07 Mar 2019, 23:05
Forum: Ask For Help
Topic: OnMessage threads clarification needed Topic is solved
Replies: 4
Views: 309

OnMessage threads clarification needed Topic is solved

Consider the following: OnMessage(0x1, "Function1") OnMessage(0x2, "Function1") What would happen if message 0x2 arrived during 0x1's function1? If a message arrives while its function is still running due to a previous arrival of the same message...such and such Yes, but what if its function is sti...
by pneumatic
22 Feb 2019, 11:03
Forum: Scripts and Functions
Topic: CNG (Cryptography API: Next Generation)
Replies: 53
Views: 11027

Re: CNG (Cryptography API: Next Generation)

encrypt(string, iv, key) { this.CloseAlgorithmProvider(ALG_HANDLE) } decrypt(string, iv, key) { this.CloseAlgorithmProvider(ALG_HANDLE) } Should these be this. BCrypt CloseAlgorithmProvider? After changing the above, my encrypted strings are longer and are not case sensitive.
by pneumatic
22 Feb 2019, 10:01
Forum: Scripts and Functions
Topic: CNG (Cryptography API: Next Generation)
Replies: 53
Views: 11027

Re: CNG (Cryptography API: Next Generation)

Because the encryption functions use crypt32.dll and does not explicitly load it with DllCall("LoadLibrary") I wanted to add it to the static variables in the class definition like so: static hBCRYPT := DllCall("LoadLibrary", "str", "bcrypt.dll", "ptr") static hCRYPT32 := DllCall("LoadLibrary", "str...
by pneumatic
22 Feb 2019, 06:43
Forum: Scripts and Functions
Topic: CNG (Cryptography API: Next Generation)
Replies: 53
Views: 11027

Re: CNG (Cryptography API: Next Generation)

Thank you jNizM for providing these very useful functions. I plan on using them to encrypt a hash of my script's executable so it won't run if it's tampered with. I am interested in using the encryption AES + CBC posted on page 1. I see the encrypt function takes an Initialisation Vector and a Key a...
by pneumatic
06 Feb 2019, 22:05
Forum: Ask For Help
Topic: Determine if a Unicode character is supported
Replies: 17
Views: 883

Re: Determine if a Unicode character is supported

1. Microsoft Sans Serif might not be the best font, relative to the language. Like if you were using Chinese, etc... You might want to make sure that the font is the recommended one for the language or is good for the different languages on the computers. My GUIs are entirely in English and I've fo...
by pneumatic
05 Feb 2019, 09:32
Forum: Ask For Help
Topic: Determine if a Unicode character is supported
Replies: 17
Views: 883

Re: Determine if a Unicode character is supported

just me wrote:
05 Feb 2019, 06:34
It depends on the font used to show the text. Many fonts do not support the whole range of Unicode characters.
Yes, that's why I'm always using the default font, and I set it explicitly too just to be sure (Microsoft Sans Serif S8 Norm cDefault)

Go to advanced search