Search found 77 matches

by oO0XX0Oo
Sat Mar 09, 2019 2:46 pm
Forum: Tricks 'n' Tips
Topic: Save JSON data with object members well-arranged
Replies: 19
Views: 13458

Re: Save JSON data with object members well-arranged

I'm sorry for the inconveniences.
No need to be sorry!

The new version looks fine currently, test data with about 65kb is sorted as expected
(one sort order on root level + 2 additional sort orders for the arrays). Different
structure as in my example ofc^^

Many thanks for fixing the bug!
by oO0XX0Oo
Thu Mar 07, 2019 7:11 am
Forum: Tricks 'n' Tips
Topic: Save JSON data with object members well-arranged
Replies: 19
Views: 13458

Re: Save JSON data with object members well-arranged (Module

@Little John

I've noticed a small quirk...


hJSON = CreateJSON(#PB_Any)
If hJSON
InsertJSONList(JSONValue(hJSON), Profile())
JSave::InitObjectStr("", "ID, Position, Enabled, Name, ClickType, Control, Description, MatchOn, MatchType, Modifier, MouseButton, SkipOn, SkipType, Items")
JSave ...
by oO0XX0Oo
Fri Aug 10, 2018 1:38 pm
Forum: Coding Questions
Topic: Writing a DLL
Replies: 19
Views: 7097

Re: Writing a DLL

@chi

Is it possible to distinguish #WM_LBUTTONDBLCLK from #WM_LBUTTONDOWN in your hook?

My problem is that a left double click generates a sequence of four messages:
#WM_LBUTTONDOWN, #WM_LBUTTONUP, #WM_LBUTTONDBLCLK and #WM_LBUTTONUP

and something like this:

Select wParam
Case #WM ...
by oO0XX0Oo
Tue Apr 17, 2018 3:44 pm
Forum: Coding Questions
Topic: MessageBox() - How to make it safe?
Replies: 8
Views: 1835

Re: MessageBox() - How to make it safe?

It isn't a problem, another parameter "ontop.b=#False" is enough to solve that situation...
by oO0XX0Oo
Tue Apr 17, 2018 8:07 am
Forum: Coding Questions
Topic: MessageBox() - How to make it safe?
Replies: 8
Views: 1835

Re: MessageBox() - How to make it safe?

That's purely a recommended guideline, because while a separate event loop is running, all other processes from the main event loop would be suspended; for example, a timer. Otherwise, it's perfectly valid and safe.
Ok, I'll use these kind of message boxes as a "hey user, I need your attention now ...
by oO0XX0Oo
Tue Apr 17, 2018 1:01 am
Forum: Coding Questions
Topic: MessageBox() - How to make it safe?
Replies: 8
Views: 1835

MessageBox() - How to make it safe?

Hi,

I haven't found a way to subclass the MessageRequester() and using a different font in it (I need a monospaced font!)
so I've created a normal window that looks like it.

We are supposed to have only one! Repeat .. Until loop regardless of how many windows we are using.

So my problem with my ...
by oO0XX0Oo
Wed Apr 11, 2018 11:23 am
Forum: Coding Questions
Topic: Code optimization (indent lines)?
Replies: 6
Views: 2151

Re: Code optimization (indent lines)?

Thanks again, wilbert!

Your modified version works absolutely fine now, including truncating the dst file
and even if the src file doesn't end with a CR/LF...
by oO0XX0Oo
Wed Apr 11, 2018 10:45 am
Forum: Coding Questions
Topic: Code optimization (indent lines)?
Replies: 6
Views: 2151

Re: Code optimization (indent lines)?

Holy cow, that's fast!

Instead of taking about 500ms for the testfile (still 72k entries) it needs only about 75ms now.
5-6 times faster...

One little quirk:
If the src file does not end with an empty new line, the last line in dst will non contain the content
of the last (converted) line from src ...
by oO0XX0Oo
Wed Apr 11, 2018 8:20 am
Forum: Coding Questions
Topic: Code optimization (indent lines)?
Replies: 6
Views: 2151

Re: Code optimization (indent lines)?

Hi wilbert,

How many files do you need to process ?
Can be up to a million items

You could open the input and output file at the same time.
Tried that yesterday (open both the input and the (temp) output file at the same time),
directly converting each line and writing it. It wasn't noticeable ...
by oO0XX0Oo
Tue Apr 10, 2018 11:09 pm
Forum: Coding Questions
Topic: Code optimization (indent lines)?
Replies: 6
Views: 2151

Code optimization (indent lines)?

Hi,

a small console app that takes 3 params (last one is optional):
- A file (full path), UTF-8 BOM encoded that contains full paths of files / folders, #CRLF$ separated
- The "root level" of indentation
- Number of spaces to prefix deeper nested hierarchies

It creates this:

Chromium_x64 [64.0 ...
by oO0XX0Oo
Mon Mar 05, 2018 6:46 pm
Forum: Tricks 'n' Tips
Topic: keep some characters and reject others
Replies: 1
Views: 1324

Re: keep some characters and reject others


Declare.s retain(mainString.s, maskString.s)

Procedure.s retain(mainString.s, maskString.s)
Protected.s result = ""
Protected.i pattern

pattern = CreateRegularExpression(#PB_Any, "[" + maskString + "]", #PB_RegularExpression_NoCase)
If pattern
If ExamineRegularExpression(pattern, mainString ...
by oO0XX0Oo
Mon Mar 05, 2018 8:36 am
Forum: Coding Questions
Topic: Image inside the source code
Replies: 13
Views: 3086

Re: Image inside the source code

In your original post you've stated that the image would be about up to 300kb large :D

For an image with your ~30 kb size, you could use e.g. this:
http://www.purebasic.fr/english/viewtop ... 27&t=59301
by oO0XX0Oo
Sun Mar 04, 2018 1:46 pm
Forum: Coding Questions
Topic: Image inside the source code
Replies: 13
Views: 3086

Re: Image inside the source code

Look at the command: IncludeBinary
by oO0XX0Oo
Mon Feb 19, 2018 10:06 pm
Forum: Windows
Topic: Check if a date value was in DST or not?
Replies: 3
Views: 3214

Check if a date value was in DST or not?

Hi,

E.g. DirectoryEntryDate(hDir, #PB_Date_Modified) gets the date for a file / folder
without correcting it when the file / folder was created during the DaylightSaving time
(first sunday in april through the last sunday in october) so this date is one hour off.

Is it possible to check if such a ...
by oO0XX0Oo
Mon Feb 19, 2018 2:02 pm
Forum: Coding Questions
Topic: Search/replace phrases in the same case
Replies: 14
Views: 2608

Re: Search/replace phrases in the same case

This won't work if Alot is at the beginning of a sentence...