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
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
#2
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

#3
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
#4
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...
#5
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
#6
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
#7
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 !!! :)
#8
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
#9
Hi Phil

You could try to create the *ezweb/logs directory and see if EZWEB logs any error message in it
#10
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€
#11
Language / Re: Easiest way to create an XML file
June 04, 2024, 04:44:40 AM
MikeH

Working daily at my job with *obj/xml to handle interfaces with an e-Commerce app API, I haven't been confronted with any memory issue in the last 2 years

*obj/xml represents an XML node, so internally, every single node or subnode of your XML document is an *obj/xml instance
IIRC the powerpoints from 20+ years ago, in PVX OOP, all instances of the same class share the logic (the methods are loaded in memory only once), only the instance data (properties) is distinct.
The actual XML string is created only when you use the 'get_xml$() method

In any case, Mike's logic is the best way to go if you're worried about memory usage

My 0.02€
#12
Nomads / Re: Library Query
May 28, 2024, 10:51:20 AM
Mike

The problem here is the inclusion of TCB(13) in the file name

TCB(13) is not a fixed value throughout your session. It varies depending how deep you are in the CALL stack.
In your main program it is 0.
In a subprogram called / performed from your main program it is 1.
In a sub-subprogram called / performed from your subprogram it is 2.


Doing a PROCESS of a panel or a query is like doing a CALL.
So if you created your temp file in your main program, it was named WKFLT0010.
If you PROCESS a query to read it, that's a CALL, so when the query runtime program tries to resolve the file name, it evaluates to WKFLT0011 which does not exist.

You need to change the way you name your WKFL files if you want to make this work.
#13
Nomads / Re: Library Query
May 28, 2024, 01:13:33 AM
Mike
TCB(13) is the current level in the program call stack
If you create the work file in your main level program, its value will be 0
But PROCESS a panel and it's value is set to 1 or 2 because basically PROCESS is a call to *winproc
Invoke a query from the panel (which is a call to *winproc which then performs *winqry) and now your TCB(13) is 4 or 5
Not sure why you want to include TCB(13) in the file name, but it will never work as you've experienced. If you included this for file name uniqueness, maybe TCB(89) would be a better choice as it is the same whatever level you are in the call stack
Hope this helps
#14
Henderson,

Jeff's suggestion is only an example, you need to check the documentation of the API you're trying to interact with and see what is the name of the html form field that this API expects. If filename does not work, maybe it is file_name or xml_file.
Also make sure that the data in the XML file is escaped using either cvs(..., "utf8:xml") if the data may contain utf8 encoded characters, or cvs(..., "ascii:xml") in case the data contains reserved XML chars such as < >


Jeff,

You can spare a call by using the cvs() function
base64_credentials$ = cvs(raw_credentials$, "ascii:base64")
#15
Jeff

Attached is the PVX helper class I use to upload files to APIs

Use it like this :


field_name$="Name of the form field the webservice is waiting for"
file_name$="Name of the file to upload : this will be the value of the form field above"
file_content$="File content"
file_mime_type$="MIME type of the file to upload, application/octet-stream by default"
upload=new("http.upload",field_name$,file_name$,file_content$,file_mime_type$)
! // use upload'content_type$ as mime_type in the *plus/web/request
! // use upload'body$() as body in the *plus/web/request


The file_content$ variable should be loaded with a binary read of the file


open (hfn,isz=-1) file_name$
file_content$ = rcd(lfo,siz=10000000)


Hope this helps