Search found 6331 matches

by infratec
Thu Mar 14, 2024 1:28 pm
Forum: Coding Questions
Topic: WebViewGadget: SetGadgetText is not displaying content
Replies: 5
Views: 139

Re: WebViewGadget: SetGadgetText is not displaying content

You can do it with a timer for a demo.
by infratec
Sun Mar 10, 2024 9:07 pm
Forum: Coding Questions
Topic: Help with Query
Replies: 4
Views: 226

Re: Help with Query

No working code... no help. Is it so hard to create a code which demonstrate this behavior? Why should 10 people do this to help you? You spent, maybe, 15 minutes. If 10 people tries to help you and write code, it needs 150 minutes. This is not fair. It costs less time for the helpers to modify your...
by infratec
Sun Mar 10, 2024 1:58 pm
Forum: Coding Questions
Topic: Gest string length problem
Replies: 12
Views: 297

Re: Gest string length problem

This works for me: TFile.s="filetest.txt" If ReadFile(0, tfile, #PB_UTF8) String.s = ReadString(0) Debug Len(String) Debug String SetClipboardText(string) CloseFile(0) If CreateFile(0, "filetest2.txt", #PB_UTF8) WriteStringN(0, String) CloseFile(0) EndIf Else Debug "no file&...
by infratec
Sun Mar 10, 2024 12:17 pm
Forum: Coding Questions
Topic: How to read a point() from catchimage (from datasection) in startdrawing?
Replies: 3
Views: 126

Re: How to read a point() from catchimage (from datasection) in startdrawing?

You should always:

1. Check the return values of procedures
2. Use EnableExplicit

Than you would have noticed, that already your CatchImage() failed.
by infratec
Thu Mar 07, 2024 9:05 pm
Forum: Coding Questions
Topic: AddSysTrayIcon (1, WindowID(0), ImageID(0)) ?
Replies: 12
Views: 478

Re: AddSysTrayIcon (1, WindowID(0), ImageID(0)) ?

This works: EnableExplicit ; Author: PWS32 (updated for PB4.00 by blbltheworm) Define Event.i, Quit.i If OpenWindow(0, 100, 200, 195, 260, "Test Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget) If CreatePopupMenu(0) MenuItem(1, "Restore Window&qu...
by infratec
Thu Mar 07, 2024 5:06 pm
Forum: Coding Questions
Topic: Can a structure be defined dynamically by csv headers
Replies: 24
Views: 872

Re: Can a structure be defined dynamically by csv headers

tored wrote: Thu Mar 07, 2024 3:17 pm Nice. You can simplify it even more if you have the CSV file on disk by letting sqlite import it after you created the table.

Code: Select all

.mode csv
.import myfile.csv mytable

This is only possible with the command line tool.
So you have to use RunProgram()
by infratec
Thu Mar 07, 2024 11:07 am
Forum: General Discussion
Topic: AddElement() behaviour
Replies: 11
Views: 385

Re: AddElement() behaviour

Yes, in all these years I used AddElement() only to create a fresh list.
And in this case it adds always at the end (as expected).

So, I forgot, that this is not always the case.
Maybe I'm getting old.

:oops:
by infratec
Thu Mar 07, 2024 10:26 am
Forum: General Discussion
Topic: AddElement() behaviour
Replies: 11
Views: 385

AddElement() behaviour

Yesterday I came across the behaviour of AddElement(). I use a Logger.pbi file which is runs a thread to write the entries in a file. The log entries are first stored in a list for speed reasons. In the thread I use FirstElement() to always write the correct entry to the log file. In the log file th...
by infratec
Thu Mar 07, 2024 8:27 am
Forum: Coding Questions
Topic: Can a structure be defined dynamically by csv headers
Replies: 24
Views: 872

Re: Can a structure be defined dynamically by csv headers

I extended the listing above.

It returns now also the content of the table as JSON array.
by infratec
Wed Mar 06, 2024 9:50 pm
Forum: Coding Questions
Topic: Can a structure be defined dynamically by csv headers
Replies: 24
Views: 872

Re: Can a structure be defined dynamically by csv headers

A quick implementation with an user function: EnableExplicit Structure IndexArray *Index[0] EndStructure PrototypeC.l Prototype_CallBack(*pCtx, argc.l, *argv.IndexArray, *colnames.IndexArray) ImportC "sqlite3.lib" sqlite3_create_function.l(DatabaseID, zFunctionName.p-utf8, nArg.l, eTextRep...
by infratec
Wed Mar 06, 2024 7:52 am
Forum: Coding Questions
Topic: Drawtext and PB
Replies: 8
Views: 373

Re: Drawtext and PB

Do you get compiler warnings or errors?
If not, your code is not affected.

In this case it happens, because the parameters x and y from DrawText() are changed from integres to doubles.
by infratec
Tue Mar 05, 2024 2:11 pm
Forum: Coding Questions
Topic: Drawtext and PB
Replies: 8
Views: 373

Re: Drawtext and PB

Or ... an other bracket

Code: Select all

 DrawText(((iw - tw) >> 1), ((ih - th) >> 1), txt, tColor)
by infratec
Tue Mar 05, 2024 8:37 am
Forum: Coding Questions
Topic: Connecting to AWS/RDS Postgres instance
Replies: 11
Views: 389

Re: Connecting to AWS/RDS Postgres instance

The problem is/was how Postgres starts SSL: https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-SSL To initiate an SSL-encrypted connection, the frontend initially sends an SSLRequest message rather than a StartupMessage. The server then responds with a single byte containing S ...
by infratec
Tue Mar 05, 2024 7:45 am
Forum: Coding Questions
Topic: Connecting to AWS/RDS Postgres instance
Replies: 11
Views: 389

Re: Connecting to AWS/RDS Postgres instance

Yes.
But as written: you need to write a SSL proxy for Postgres.