Search found 66 matches

by jacky
Mon Jun 16, 2025 12:31 pm
Forum: Coding Questions
Topic: [Solved] How to use RunProgram() with mixed quote argument?
Replies: 4
Views: 334

Re: How to use RunProgram() with mixed quote argument?

@Caronte3D Thanks, but this isn't necessary.

@Nic
Thanks again, the url encoding was all that was needed, I was blind, I called it with arg2 and not url as the argument for RunProgram()^^

Problem solved, it now works as expected :oops:
by jacky
Mon Jun 16, 2025 12:25 pm
Forum: Coding Questions
Topic: [Solved] How to use RunProgram() with mixed quote argument?
Replies: 4
Views: 334

Re: How to use RunProgram() with mixed quote argument?

Thanks Nic.

The encoded url looks like this:
https://www.google.com/maps/place/56%C2%B033'29.0N%2038%C2%B08'49.3E

When RunProgram() is called it will still fail to supply it to the browser correctly, I still get two tabs:
Address bar part of the first one: xn--5633'29-bla.0n
Of the second one ...
by jacky
Mon Jun 16, 2025 11:35 am
Forum: Coding Questions
Topic: [Solved] How to use RunProgram() with mixed quote argument?
Replies: 4
Views: 334

[Solved] How to use RunProgram() with mixed quote argument?

Hi,

Edit: Solved, I was just a bit blind (apart from the necessary tip by Nic that the url part should be encoded) :)

I want to call my .exe with two arguments:
01. The full path to an executable (a browser)
02. GPS coordinates like: 56°33'29,0N 38°8'49,3E

These coordinates depend on the used ...
by jacky
Sun Apr 02, 2023 8:07 pm
Forum: Coding Questions
Topic: Windows: Set file / folder date to the _correct_ time (regardless of daylightsavingtime)?
Replies: 3
Views: 445

Windows: Set file / folder date to the _correct_ time (regardless of daylightsavingtime)?

Hi!

I'd like to set a file / folder dates (modified / created / accessed) to a specific time that is not shifted by the bias of daylightsavingtime...

E.g. if I use this function from the german forum: https://www.purebasic.fr/german/viewtopic.php?p=71624#p71624

with:

#Day = 15
#Month = 3
#Year ...
by jacky
Sat Mar 26, 2022 2:08 pm
Forum: Coding Questions
Topic: Get file content (UTF-8 and UTF-16)?
Replies: 14
Views: 2293

Re: Get file content (UTF-8 and UTF-16)?

Yeah, it seems that's the way how it works.

If PB would internally use a fast concatenation method that procedure wouldn't fall back in execution time that much...
by jacky
Sat Mar 26, 2022 12:45 am
Forum: Coding Questions
Topic: Get file content (UTF-8 and UTF-16)?
Replies: 14
Views: 2293

Re: Get file content (UTF-8 and UTF-16)?

Thanks for correcting it. It now works as expected :D
Btw. this is much easier and more elegant
Absolutely! But don't dare to try that one on larger files...

E.g. a 10 MB test file

In memory variant: 86ms
"easier and more elegant": 4secs, 463ms

Compiled via the beta 5 C backend (x64)
by jacky
Fri Mar 25, 2022 10:15 pm
Forum: Coding Questions
Topic: Get file content (UTF-8 and UTF-16)?
Replies: 14
Views: 2293

Re: Get file content (UTF-8 and UTF-16)?

Thanks to both of you!

@infratec

Are you sure that

If bom = #PB_Unicode
content = PeekS(*buffer + offset, (length - offset) / 2, #PB_Unicode)
Else
content = PeekS(*buffer + offset, (length - offset), #PB_UTF8|#PB_ByteLength)
EndIf

is correct?

For an UTF-16 LE BOM file with this content ...
by jacky
Fri Mar 25, 2022 9:22 am
Forum: Coding Questions
Topic: Get file content (UTF-8 and UTF-16)?
Replies: 14
Views: 2293

Get file content (UTF-8 and UTF-16)?

Hi,

this procedure works fine (and fast even for larger files) but only for UTF-8.

Is there a way to change it so that it can read both encodings (UTF-8 with or without BOM AND UTF-16 LE with BOM)?


Procedure.s GetFileContent(file.s)
Protected.i size

size = FileSize(file)
If size = -1 ...
by jacky
Thu Jan 07, 2021 9:13 pm
Forum: Tricks 'n' Tips
Topic: Registry Module (windows only)
Replies: 97
Views: 68497

Re: Registry Module (windows only)

Is this a bug or should it work this way for DeleteTree()?

I create a key "HKEY_CURRENT_USER\Software\abc"
and add an empty string value to it, named "huhu"

Registry::DeleteTree(#HKEY_CURRENT_USER, "Software\abc")
will delete the string value but it won't delete the "abc" (sub-) key...
by jacky
Wed Jan 06, 2021 5:47 pm
Forum: Coding Questions
Topic: Only use first console line (Windows) to output things?
Replies: 2
Views: 790

Re: Only use first console line (Windows) to output things?

It's so easy? Wow...

Thank you mk-soft!
by jacky
Wed Jan 06, 2021 4:14 pm
Forum: Coding Questions
Topic: Only use first console line (Windows) to output things?
Replies: 2
Views: 790

Only use first console line (Windows) to output things?

Hello,

I'm currently working on a console app that should provide some progress output.
It's working with (large) folder structures but what I don't want it to spam the whole console line by line for each folder processed.

Is it possible to just use output a progress report to the first line (of ...
by jacky
Fri Jan 01, 2021 10:17 am
Forum: Coding Questions
Topic: How to convert .bat code to .pb GetCommandLine_() ?
Replies: 6
Views: 1844

Re: How to convert .bat code to .pb GetCommandLine_() ?

GetCommandLine_ is not a PB command, but a Windows API command

But what does that have to do with command line parameters? You have just posted the content of a bat file...

Code: Select all

RunProgram("cmd", "/c cd C:\ && shutdown /h", GetTemporaryDirectory(), #PB_Program_Hide)
by jacky
Thu Dec 31, 2020 3:44 pm
Forum: Windows
Topic: Convert small .ahk (COM) to PB?
Replies: 11
Views: 2975

Re: Convert small .ahk (COM) to PB?

Yeah, that makes sense. I've added the change to my last post.
by jacky
Thu Dec 31, 2020 2:59 pm
Forum: Windows
Topic: Convert small .ahk (COM) to PB?
Replies: 11
Views: 2975

Re: Convert small .ahk (COM) to PB?

@fryquez

Thanks again!

I wanted to ask why sFile can be used directly without storing it in a variable of type VARIANT but after reading
https://docs.microsoft.com/en-us/windows/win32/shell/shell-shellexecute
I'll understand it now :P

I've slightly modified your translated code (thanks for ...
by jacky
Wed Dec 30, 2020 9:58 pm
Forum: Windows
Topic: Convert small .ahk (COM) to PB?
Replies: 11
Views: 2975

Re: Convert small .ahk (COM) to PB?

The application that contains this code (and is started with "Run as administrator") can run another application with current user permissions. This should work for every user that is in the administrator group and is currently logged in but not necessarily for the user account "Administrator ...