PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Thomas Bock

Pages: [1] 2 3 ... 12
1
Programming / Re: accessing mySQL-DB
« on: March 25, 2024, 04:57:34 AM »
Are there any new insights?

2
Programming / Re: accessing mySQL-DB
« on: March 18, 2024, 04:25:53 AM »
The customer uses openSUSE Leap 15.5
We use a Gentoo and can reproduce the issue

3
Programming / Re: accessing mySQL-DB
« on: March 14, 2024, 02:52:19 AM »
That's what I'm saying.
But the issue comes with version 3.2.7.

4
Programming / accessing mySQL-DB
« on: March 13, 2024, 11:19:19 AM »
We encounter problems with a newer version of libmariadb.so.3
PxPlus 20.10 is installed on a Linux server.
The program below runs with version 3.1.13 on a Linux server. With version 3.2.7 the result is empty and msg(-1) returns "MYSQL:0:".
Code: [Select]
begin
dbOpt$ = "SERVER=my_server;USER=my_account;PASSWORD=my_password;DATETIME_CONVERT=N"
dbName$ = "[MYSQL]my_database;;"
channel = hfn
open (channel, OPT = dbOpt$, tim = 10) dbName$
query$ = "SELECT * FROM `myTable` limit 1"
write record (channel)query$
gosub buildPVXIOList
repeat
read record(channel,err=*next)sqlResultItem$
if tcb(2) {
print msg(err)
print msg(-1)
break
}
print ++c,": ",sqlResultItem$
until 0
close( channel)
end
buildPVXIOList:
local sqlIOL$    = ken(channel, ind = 3)
local pvxIOL$    = "IOLIST "
local separator$ = $$
local items      = pos(";" = sqlIOL$, 1, 0)
local counter    = 0
local virtual    = 0
repeat
fieldDefinition$ = arg(sqlIOL$, counter + 1, ";")
read data from fieldDefinition$, sep = "," to fieldName$, fieldType$
fieldName$  = tbl(nul(fieldName$), fieldName$, "_VIRTUAL" + str(++virtual))
pvxIOL$    += separator$ + fieldName$
if (mid(fieldType$, 1, 3) = "CHR") or (fieldType$ = "DATE") {
pvxIOL$ += "$"
}
separator$ = ","
until (++counter > items)
pvxIOL$ = sub(pvxIOL$, "-", "_")
dim sqlResultItem$ : cpl(pvxIOL$)
return

What needs to be done in order to work with then newer version?

5
Wish List / constantly visible scrollbar buttons
« on: December 15, 2023, 07:22:06 AM »
With Windows 11 the scrollbar buttons are only visible, if the mouse hovers over them. This makes the buttons of a spinner control invisible. We like to have constantly visible scrollbars and/or buttons as it used to be. MS-Outlook shows it can be done.

6
Thin Client/WindX / Re: Auto Updater
« on: December 14, 2023, 03:54:20 AM »
Take a look at the static download. You need to do some configuration.

7
Programming / Re: temporary error 11
« on: December 13, 2023, 10:05:07 AM »
Here is another one, which throws an error 11 every now and then without need.

KEYED "M50002",[1:1:1]+[1:2:8]+[1:10:4]+[1:21:20]+[1:14:7],[1:21:20]+[1:1:1]+[1:2:8]+[1:10:4],[1:41:3]+[1:44:10]+[1:21:20]+[1:1:1]+[1:2:8]+[1:10:4],[1:54:10],0,-512,BSZ=4,OPT="0",SEP=$8A$

It is a VLR file.

8
Programming / Re: create a pivot table
« on: December 01, 2023, 04:24:13 AM »
SOLVED!

The trick is to use piTable'dataFields()
Code: [Select]
lastItem = piTable'dataPivotField'pivotItems()'count
lastPiField = piTable'dataFields(lastItem)
lastPiField'function = -4106
lastPiField'numberFormat$ = mask$
lastPiField'caption$ = title$

9
Programming / create a pivot table
« on: November 30, 2023, 02:57:10 AM »
Has someone created a Pivot table with an average column so far?
I recorded a macro in MS-Excel

Code: [Select]
    With ActiveSheet.PivotTables("Pivot1").PivotFields("Percent")
        .Caption = "Average %"
        .Function = xlAverage
    End With

This is my translation to PxPlus
Code: [Select]
pivotName$ = "Pivot1"
fieldName$ = "Percent"
title$ = "Average %"
piTable = sheet'pivotTables(pivotName$)
piField = piTable'pivotFields(fieldName$)
piTable'addDataField(*piField)
lastItem = piTable'dataPivotField'pivotItems()'count
lastPiField = piTable'dataPivotField'pivotItems(lastItem)
lastPiField'caption$ = title$
piField'function = -4106 ! xlAverage

I always receive an error 88 on the last line.
The macro seems to be wrong, because the caption can only be set on lastPiField instead of piField.
Help is appreceated.

10
Programming / Re: temporary error 11
« on: November 29, 2023, 07:43:17 AM »
KEYED "BA_TEXT",[1:1:10]+[2:1:3],0,-256,BSZ=4,OPT="2",SEP=$8A$

IOLIST TEXT_NR$,LFD_NR$,TEXT$

TEXT_NR$ delimited 10
LFD_NR$ delimited 3
TEXT$ delimited 80


11
Programming / temporary error 11
« on: November 29, 2023, 02:50:34 AM »
On customer sites we encounter temporary error 11 on ky$=key(channel,kno=0,end=*next). When we try to reproduce the errors on these systems then the errors are gone. A change to "err=*next" is no option, because that would hide a corrupted file.

What is the reason for these errors 11?

12
Wish List / string interpolation
« on: November 15, 2023, 08:45:15 AM »
In C# there is the possibility to build strings by referencing/including variables.

Code: [Select]
string name = "Tom";
var date = DateTime.Now;
Console.WriteLine($"Hello, {name}! Today is {date.DayOfWeek}, it's {date:HH:mm} now.");

These strings are much more readable than coding a concatenation of several small strings. E.g. building a SQL-statement becomes more straight forward.
If PxPlus would provide such functionality, we could gain speed, because the interpreter would not need to translate several lines of code.

13
Programming / Access IOL variables as properties
« on: November 10, 2023, 05:03:32 AM »
I'm trying to save the variables of an iolist as a property with a dynamic approach. The purpose is to retrieve extermal parameters only once without the need to adjust anything when new parameters are introduced. So far I had no luck.

Here ist my class
Code: [Select]
def class "GetIOL" create required
property params$
function whatParams()
print "whatParams()"
print lst(iol(params$))
print sub(params$,sep,"~")
print params.name$
return 1
function end
end def
ON_CREATE:
call "GetIOL.pvc;FETCH_PARAMS", params$
print "ON_CREATE"
print lst(iol(params$))
print sub(params$,sep,"~")
print params.name$
return
FETCH_PARAMS:
enter p$
dim p$:iolist id$,name$,value
p.id$="ABC"
p.name$="XYZ"
p.value=42
exit

No variable arrives inside the object, though the iolist is constantly present.
I also tried static iol=iol(params$) and several other approaches. But everything failed.

This is my test program
Code: [Select]
begin
g=new("GetIOL")
g'whatParams()
delete object g
end

All suggestions are welcome.

14
Wish List / Re: Weeknumbers in multiline-calendar
« on: September 06, 2023, 08:02:54 AM »
I think ISO 8601 can help here.
If you add a week to the calendar, then it is important to handle the weeks 52, 53 and 1 correctly.

15
Programming / performance of select record
« on: August 24, 2023, 10:20:36 AM »
So far we don't use "select record" a lot. I did some tests and found that it is slower than an old style read loop. I'm wondering why. As it knows all the keys I'm interested in including all conditions it should be much faster than any programmed logic.
I tested with a file constisting of 600,000 records and read all records from then second to the last but one using the primary key. All runs with "select record" needed 3 seconds longer than the old style read loop.

In my opinion it should be much faster.

Pages: [1] 2 3 ... 12