Menu

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.

Show posts Menu

Messages - Stéphane Devouard

#1
Hi

Just noticed this message in VScode


 You cannot view this attachment.

Is the extension discontinued ?
#2
Web Services / Re: PxPlus pipe issue on Windows with curl
September 22, 2025, 08:48:20 AM
Hi Mike

Bingo, the end-of-line terminator is the issue

The code below seems to resolve the problem and works correctly both on Windows and Linux

->open(1)"<curl -s -w ""\n"" https://jsonplaceholder.typicode.com/posts/1"
->?rcd(1)
{
->?rcd(1)
  "userId": 1,
->?rcd(1)
  "id": 1,
->?rcd(1)
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehe
nderit",
->?rcd(1)
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nr
eprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem evenie
t architecto"
->?rcd(1)
}
->?rcd(1)
Error #2: END-OF-FILE on read or File full on write
Last IO to <curl -s -w "\n" https://jsonplaceholder.typicode.com/posts/1, channe
l 1
->

Thanks for the clarification
#3
Web Services / PxPlus pipe issue on Windows with curl
September 21, 2025, 03:44:06 AM
Hello

Trying to help Henderson with his HTTP POST issue, I suggested using curl from PxPlus as an alternate solution

Trying this dummy API from Powershell, we get what we expect :

╭─� pwsh � ~ �                                                                                                      � � 09:11:15 �
╰─❯ curl -s https://jsonplaceholder.typicode.com/posts/1
{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}


Using a pipe from PxPlus for Windows, we miss the last line of the JSON response :

->open(1)"<curl -s https://jsonplaceholder.typicode.com/posts/1"
->?rcd(1)
{
->?rcd(1)
  "userId": 1,
->?rcd(1)
  "id": 1,
->?rcd(1)
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehe
nderit",
->?rcd(1)
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nr
eprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem evenie
t architecto"
->?rcd(1)
Error #2: END-OF-FILE on read or File full on write
Last IO to <curl -s https://jsonplaceholder.typicode.com/posts/1, channel 1
->


The same code on a PxPlus Ubuntu (WSL) works as expected :

PxPlus-2025 Demo (Ver:22.00/UNIX-Linux-Ubuntu) Serno:2200-664-0799999
(c) Copyright 2005-2025 PVX Plus Technologies Ltd. (All rights reserved)
  Website: http://www.pvxplus.com
->
->open(1)"<curl -s https://jsonplaceholder.typicode.com/posts/1"
->?rcd(1)
{
->?rcd(1)
  "userId": 1,
->?rcd(1)
  "id": 1,
->?rcd(1)
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
->?rcd(1)
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
->?rcd(1)
}
->?rcd(1)
Error #2: END-OF-FILE on read or File full on write
Last IO to <curl -s https://jsonplaceholder.typicode.com/posts/1, channel 1
->

Looks like a problem in the pipe interface on Windows only
#4
Programming / Re: trying to use a web service (API)
September 10, 2025, 05:19:59 AM
Hi

As pointed out by Loren, no data needs to be passed in when you use the GET verb

The minimal parameters for *plus/web/request are
- the URL
- the data to pass to the webservice, "" for a GET
- the response data received
- the reponse headers received

->call "*plus/web/request","https://cataas.com/api/count","",respd$,resph$
->?respd$
{"count":1987}
->?resph$
HTTP/1.1 200 OK
Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept, Origin, Au
thorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Content-Size: 14
Content-Type: application/json
Date: Wed, 10 Sep 2025 09:12:24 GMT
Set-Cookie: __Host-SESSION_ID=858e3b05-3cf7-42f0-95f0-38feecd9e442; Path=/; Secu
re; HttpOnly; SameSite=Strict
Connection: close
content-length: 14

->

This webservice returns JSON data, you can use the JSON interface built-in PxPlus to parse and use the data returned

->dim load data$=respd$
->dump
! ERR=42, CTL=0, RET=2
! **********************************************************
! Level=1
! PGN="<Unsaved>"
DATA$["count"]="1987"
RESPD$="{""count"":1987}"
RESPH$="HTTP/1.1 200 OK"+$0A$+"Access-Control-Allow-Headers: X-Requested-With, C
ontent-Type, Accept, Origin, Authorization"+$0A$+"Access-Control-Allow-Methods:
GET, POST, PUT, DELETE, OPTIONS"+$0A$+"Access-Control-Allow-Origin: *"+$0A$+"Con
tent-Size: 14"+$0A$+"Content-Type: application/json"+$0A$+"Date: Wed, 10 Sep 202
5 09:12:24 GMT"+$0A$+"Set-Cookie: __Host-SESSION_ID=858e3b05-3cf7-42f0-95f0-38fe
ecd9e442; Path=/; Secure; HttpOnly; SameSite=Strict"+$0A$+"Connection: close"+$0
A$+"content-length: 14"+$0A$
! ----
! Global variables (%...)
->

You then do whatever you want with the data$[] associative array / hash table

Hope this helps

#5
General Announcements / Re: PVX Plus August 2025 Update
September 03, 2025, 06:55:50 AM
Looks like the MS forms issue has been resolved

I was able to register for DireXions & the AI assistant beta w/o an MS professional or student account
#6
Hi

I wanted to register for the AI assistant beta but I don't have a professional MS account which seems required for MS Office web forms. I left school 35 years ago so I don't have the other type of MS account that is required ;-) 

Same issue with the DireXions registration.

Any advice ?
#7
Loren & Jeffrey

FYI, this type of JSON data is supported on PVX 16.20

Regards,
#8
Hi

Yes, as Mike pointed out, you only setup one redirection in Apache config file. 
An .htaccess file would also do the trick.

Then the redirection runs one single CGI program (generally called a "front controller"), passing it the URL that was originally used in the HTTP request as an argument.

It is this front controller script that parses this URL, the HTTP verb that has been used (GET/POST etc...), other query string parameters and POST data, and decides which program to call / perform or method in a class (if you want to be fancy) to actually do the job.
#9
Language / Re: PHP Call Time to read
November 05, 2024, 04:58:53 AM
Hello

If you want to call a webservice, no need to re-invent the wheel with TCP socket programming

The CALL "*plus/web/request" program is an HTTP client that can send a request with HTTP headers, and return a response as a string that you can then parse using either the *obj/xml class or convert to an associative array if working with JSON. It supports all HTTP verbs GET/HEAD/POST/PUT/PATCH/DELETE and therefore allows you to interact with RESTful web APIs

My 0.02€
#10
Language / Re: Hash Tables
October 28, 2024, 11:10:27 AM
Hello

You can't. 
You can only assign a numeric or a string value to an associative array element

Basically, what you want is :

names$["Luke", 1] = "1"
names$["Luke", 2] = "2"

But such a syntax is invalid in PxPlus.

However if what you want is actually to convert the hash table to a JSON string, you can do it like this

->names$["Luke.1"]="1"
->names$["Luke.2"]="2"
->? dim(list edit names$)
{
  "Luke":["1","2"]
}
->
Hope this helps
#11
Hello

Our ERP is interfaced to a bunch of external webservice APIs for various purposes
We are using *plus/web/request for all theses interfaces

We randomly get these errors returned by *plus/web/request :


Cannot contact host server xxxxxxxxxxxx;443;secure Unable to connect securely (err/ret=4/4)
This sounds like an issue with SSL/TLS. The last part is returned in MSG(-1). Can PxPlus support confirm in which case such a message is returned ?

The question is : is there any way of knowing if the issue comes from our server or from the 3rd-party host (whose IT department's, when asked, always respond that they haven't found any issue in their infrastructure).

Has anyone else got a similar issue and was able to troubleshoot it ?

TIA
#12
Nomads / Re: SHOW CONTROL
October 18, 2024, 06:49:03 AM
Mike H

Nomads loads the control id in a variable with a .CTL suffix

Try :


IF ARG_4$="INVOICE_ENTRY" SHOW CONTROL SELECT.TEXT.CTL
You could also use Dependency Definition for this
#13
ODBC / Re: INI File and Data Dictionary
October 17, 2024, 10:36:14 AM
Hi

For what's it's worth

I have successfully used the ODBC driver in the past with old legacy files (non-normalized schemas and BIN/DEC encoded numerics) defined in an INI, and newer tables defined in provide.ddf/dde

So it used to work, as long as each file was declared either in the INI or in the ProvideX DD, but not in both

Regards
#14
Programming / Re: Visual Studio extension
September 28, 2024, 03:31:24 AM
Cedric

You could write a script or a PxPlus program that inserts a '!' at the start of every lines between /* and */
That would be a one-time process and it would prevent VSCode from displaying compilation errors on those comment lines

Regards
#15
Programming / Re: Visual Studio extension
September 26, 2024, 11:05:46 AM
Cedric

If I am not mistaken, Visual Studio Code extension can handle both text-based and tokenized programs
That's why you can configure a common file extension for the text-based ProvideX programs

You can execute an application witht text-based program only
PxPlus converts the source code to tokenized in memory before running your programs
There is an overhead, but with nowadays CPUs, you need to have superpowers to be able to notice it ;)

You could probably develop with text programs only, and when deploying to QA / production / clients, you could mass-convert all your source code to binary format, using either some external OS script invoking pxplus with the -cpl command-line option mentioned by Mike, or a PxPlus program using the *pg.cnv utility