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
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€
#2
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
#3
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
#4
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
#5
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
#6
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
#7
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

#8
Wish List / Git interface
September 25, 2024, 04:55:25 AM
Hi all

martinp is currently experimenting with SVN (Subversion) for his versionning / change management needs

The standard for versionning nowadays has become git (either for open-source projects with Github, or more closed-source projects with Gitlabs and other similar services)

Are there any plans for an interface between PxPlus and git ?
Not that I need it personally, but that would be another selling point for the environment for young bloods who are taught git these days
An implementation with the VScode extension would be cool, as VSCode already integrates it seamlessly in its UI

Regards
#9
Programming / Re: Visual Studio Code Extension
August 30, 2024, 09:30:51 AM
Martin

The VSCode extension does require a PxPlus installation and so is Windows only at the moment (I suspect it uses either the .exe or the COM interface to check for syntax errors)

A demo-activated PxPlus is enough though. That's what I've been using since the Software Developer license got cancelled and I was able to use the VSCode extension. I also saw the expiration nag messages when running VSCode so that's why I suppose it needs the interpreter to interface with the language server...
#10
Language / Re: SVN Linux?
August 20, 2024, 11:44:10 AM
Martin

I believe the SVN interface is designed to work with TortoiseSVN which is a Windows SVN client
There are scripts that run to convert your PxPlus components (programs and Nomads libraries) to text source files when you commit to the repo, and these scripts are attached to the source files extensions in the Windows registry somehow.

Regards
#11
Language / Re: SORTBY clause with SELECT directive ...
August 06, 2024, 06:03:57 AM
Hi Jean

As far as I know, there is no SORTBY clause in the PxPlus SELECT, and I do not see any simple one-liner trick that would allow you to sort your results if the field is not indexed in an alternate key.

You'd need to pre-load the data in some temp or memory file.

Regards
#12
General Announcements / Re: Forum Upgrade
July 09, 2024, 09:40:32 AM
Hopefully the new forum app won't add extra linefeeds to my posts

And I won't have to edit them after posting

Let's see...

EDIT : it worked !!! :)
#13
Phil

Well, this just says that the pvxtcp.c (the module / library where the TCP layer of the interpreter is located, I suppose) is now on Devon's local SVN repo after 40+ years being on Mike's machine  ;)

Running services in Windows with the LocalSystem account has always been a major pain.

The underlying issue here is probably some security credentials as pointed out by Loren.
Make sure that the pxplus directory tree is accessible as this is probably somewhere in the lib sub-folders that PxPlus creates files for the web sessions
#14
Hi Phil

You could try to create the *ezweb/logs directory and see if EZWEB logs any error message in it
#15
Programming / Re: Why use PVX?
June 22, 2024, 04:52:25 AM
Sorry for the late response, been away for a few days

I agree with all of the above

On the new blood attractiveness of the language, I had the bad luck of one year of unemployment with the good luck of a web development training funded by the french unemployment agency. I learned PHP, Javascript, Java / C# programming. And refreshed / upgraded my OOP knowledge.

Youngbloods can download PHP, Java or C# on their machine and start programming straight away without paying anything. They don't have to re-init ACTIVATE.PVX with a demo key after 30 days, and they don't have to consider paying a license if they want to test their app with data files above 5000 records.

Youngbloods are shown code editors and IDEs such as VScode, Eclipse, Jetbrain's PHPStorm, etc... So they may be a bit surprised when they see *IT, a little less when they see ED+. Don't show them *e :) The new PxPlus VScode extension in the last PxPlus version is great. However it's limited to PxPlus for Windows at the moment. The great thing with VScode is that it exists for Windows, Linux with GUI and MacOS.

Youngbloods are shown web frameworks that speed up development, often with concepts such as convention over configuration. You put your code in a convention-named script in a convention-based directory, and the framework picks it up by itself when reacting to an URL. No such framework in PxPlus. Because you have to pay for a development license, you want to protect the code and in-house framework you write for your needs. No such thing as open-source in PxPlus, so no ecosystem of ready-to-use modules / libraries. No such thing as PHP's Composer, Python's PIP, Javascript/NodeJS yarn/npm etc... For those not knowing what this is, basically these are package managers, where you can add to your projects/apps external libraries created by others and shared through open-source licenses.

Youngbloods are taught OOP concepts. PxPlus OOP model exists but is a bit different from standard : no 'protected' visibility, no static (=class) members only instance members, no interfaces (another way of implementing inheritance). So even if they know OOP, they have an additional learning curve to get used to PxPlus OOP paradigm.

Youngbloods are taught SQL for data persistence. KEYED files and ISAM b-trees are not concepts you learn nowadays. They have to learn READ/FIND/WRITE/REMOVE/KEY() and understand that they cannot expect a DB engine to optimize their query, they have to know how the files are structured, and they have to join related files in their code. They do not even know about semantic primary keys (customer code, product sku,...), as nowadays everyone design their DB schemas with auto-incrementing integers as primary keys.

I am not saying you shouldn't use PxPlus. I am just describing the difficulties that newcomers to the language may encounter, because I've seen "the other side" after 30 years of Business Basic.

On the other hand, re-developping an app with mainstream languages & framework requires that you re-skill your existing staff on the new technology stack you choose, which takes much more than a few weeks of courses to be productive and efficient. And of course, you cannot freeze your existing code base, so the functional gap keeps widening as you re-develop the app.

IMHO, we PxPlus developers are not to be afraid of AI yet. Generative AIs create source code by analysing and borrowing the petabytes of web pages, blogs and forums where people post code in mainstream languages. There is no such thing in PxPlus. So far I haven't been able to run any of the "PxPlus" code generated by ChatGPT in a pxplus.exe instance :)

My 0.02€