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 - Stéphane Devouard

Pages: [1] 2 3 ... 8
Programming / Re: PxPlus 2023 Projects
« on: May 27, 2023, 01:54:17 AM »
Nevemind, just spotted the little statement in the release notes. My bad. Sorry for the noise.

Programming / PxPlus 2023 Projects
« on: May 25, 2023, 06:10:43 AM »
Up until PxPlus 2022, projects metadata were stored in KEYED files *plus/proj/wkids.dat and *plus/proj/wkseq.dat
A change had been made in recent years to allow those files to be LINK files pointing to another location to be able to retrieve projects when upgrading PxPlus
I understand PxPlus 2023 changed this to a more traditional way with a folder and a dedicated settings file (like package.json for NodeJS projects and composer.json for PHP projects)
This is great. But apparently it means that I have to re-create all the projects I had set up (not so many fortunately), since I copied the two LINK files from my pxp2022/lib/_plus/proj folder to the same location in my pxp2023 installation, and no automatic migration happened, I have only the "default" project in the IDE.
Again, not a big issue, just something that would be useful -- either an automatic process first time the project maintenance is opened, or an additional option to run once in the utility that was previously used to create the LINK files
My 0.02 €

Programming / Re: Strange if then else behavior
« on: May 13, 2023, 03:48:19 AM »
After using IF {} ELSE {} for several years
I found it hard to follow especially when having several nested IFs
I started adding remarks to denote the level of nesting such as :
Code: [Select]
if some_condition { ! <-
if nested_condition { ! <--
if yet_another_condition { <---
... some code ...
} ! --->
} ! -->
} ! ->
But it is still hard to follow

I started coding in other languages (C#, PHP, JS) with fancy IDEs that have indentation
But even witht all the bells and whistles, a complicated algorithm is hard to follow
And I have watched numerous coding tutorials where it is recommended to avoid complicated nested if/else structures and use guards instead
Do all the tests that prevent the main logic to be processed, and return from the routine/method/functions
Then do the processing
Using Mike's GOSUB technique, that would be :
Code: [Select]
GOSUB Do_Some_Logic
if some_condition then return
if some_other_condition then return
if yet_another_condition then return
! // now do the logic

I also use the simple FOR/NEXT structure A LOT :
Code: [Select]
for (1)

if some_condition then break
if some_other_condition then break
if yet_another_condition then break
! // now do the logic

Programming / Re: Preview / Viewer Object
« on: April 08, 2023, 03:10:55 AM »
Hi Jeff

Is that what you're looking for ?
Code: [Select]
->? preview'*


Programming / Re: Syntax error in IF with string expressions
« on: March 13, 2023, 12:26:07 PM »
I usually use nul(string$) or not(nul(string$))

I usually avoid complex conditions with nested IF ELSE and { }

Even in languages that have fancy IDEs with indentation and code folding, developers recommend using "guards"
ie simple IFs to prematurely exit from a given process or function

I often use
Code: [Select]
for (some condition)
! // do the work

Or if there are more conditions to test
Code: [Select]
for (1)
if (some condition) then break
if (some other condition) then break
! // lets do the work

Anyway, thanks guys for your input

Programming / Syntax error in IF with string expressions
« on: March 13, 2023, 04:28:01 AM »
My boss found the issues in the attached image while doing some code

I've tried some variations with parentheses to transform variables into values but still getting the error 20

Wish List / Re: An updated Eclipse Plugin
« on: January 11, 2023, 11:57:08 AM »
… or a VS Code extension ;)

Programming / Re: Apache HTTP Interface
« on: January 07, 2023, 02:26:14 AM »
Up to 4 years ago, the Apache interface used to be compatible with IIS as well and there were some information about it in the « Running on the web » section of the doc IIRC.
It looks like this information has been moved to the Webster+ docs at
Basically you need to create a CGI handler for the .pxp file extension in IIS, and give all you web-based programs this common extension, and you should be good to go.
Hope this helps

Programming / Re: Passing a COM Object to a CMD
« on: November 18, 2022, 06:17:49 AM »
Hi Jeffrey

When you do

ProvideX does a CALL to *cmd/PO and passes it whatever you've type after PO as a string
So in PO you need to do
ENTER args$

And if you check args$ you'll see that it has been loaded with " EXCEL_OBJ"
So there is not much you can do with it as your EXCEL_OBJ variable is available in the calling context only, not in your called *cmd program

However, you may want to check out the *cmd/system/tlb CLI program and borrow its first few lines of code which do basically what you want to achieve

Hope this helps

Language / *obj/xml issue
« on: October 11, 2022, 03:59:41 AM »

There is a minor issue in *obj/xml with the find_node() method

Code: [Select]
-}? x'find_node(xpath$)'value$

I can work around by sending the parameter by value with parentheses or as an expression such as xpath$+""

But I think it should be handled in the method itself by protecting the _tag$ input parameter


Programming / Addressing an object
« on: September 28, 2022, 10:46:08 AM »

This code returns an error 29 on line 581

Code: [Select]
0580 IF XL[J]=0 THEN XL[J]=NEW("*obj/xml")
0581 XLIG=XL[J]'ADD_NODE("ligne")

I told the boss to change it to :

Code: [Select]
0580 if xl[j]=0 xd=new("*obj/xml"); xl[j]=xd else xd=xl[j]
0581 xlig=xd'add_node("ligne")

And it worked

Looks like this type of syntax
Code: [Select]
array[index]'some_method() While valid, is not supported by the parser or compiler

That being said, we are on a V16 with V15 license, maybe it has been fixed in a more recent version ?


Nomads / Re: NOMADS in Linux
« on: July 30, 2022, 01:58:24 PM »

If you are using WindX from your Windows workstation to connect to your Linux server, then everything you do, create, edit is on the Linux server. Run the IT editor, do a File > Open, and you will see the directory tree of your Linux server, not your workstation. WindX is just a smart terminal here, which happens to run on a local version of PxPlus for Windows. More precisely, a thin client for your PxPlus host.

At my new job, everyone is using Chromebooks or Chromeboxes and run the internal applications via the Chrome browser using a ssh client extension, since the internal apps are all CHUI-based and running on Linux. However since I have been using a PC for the last 30 years or so, I have setup a simple cs host and I am using WindX to do my development work. I also intend to setup the WebIDE for my boss to be able to have some code colorization after decades using *e :)

Nomads / Re: NOMADS in Linux
« on: July 29, 2022, 02:44:13 AM »

Run a PxPlus prompt from WindX
Make sure your START_UP and any other initialization routine requred ti setup your runtime environment has executed, as it will make your life easier
Type ide at the console
Here you go, you have now access to all the tools of the PxPlus Development -- graphical editors (*IT and ED+), Nomads Designer, Data Dictionary Maintenance, etc


Programming / Re: error handling in objects
« on: July 18, 2022, 06:36:50 AM »

If you have a common ERROR_HANDLER, maybe you could modify it to detect if _OBJ<>0 which means you are running in an object context
You could then caputre some of the ERR() values in local properties that would be declared in base class with error management routines that you would have to inherit in all your other classes
As for TRY and EVN/EVS encapsulation, have you also checked the TRY() function which can also intercept errors and return default values ?

Hope these general thoughts will help

Language / Re: Json element class
« on: July 12, 2022, 10:58:13 AM »

Unless there are some undocument features in PxPlus JSON support via associative array, I have bad news : you must provide all the array keys that have numeric values in the with num() clause

PxPlus JSON support is great but it lacks some helper functions, especially in the area of JSON arrays
Something like DIM(READ NUM(json$["po.order_items."]) would be nice to count the number of elements in the order_items[] array
As well as being able to specify something like "po.order_items.{*}.price" in the with num() clause


Pages: [1] 2 3 ... 8