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 4 ... 9
16
Wish List / Re: An updated Eclipse Plugin
« on: June 08, 2023, 10:14:32 AM »
Hi Gord


Long time no talk, hope you're doing well
Would definitely like a VSCode implementation as it is already my editor of choice for almost all non-PVX coding
Depending how such an extension is done, I could even contribute (I think I could still write some decent C# code...)

17
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.

18
Programming / PxPlus 2023 Projects
« on: May 25, 2023, 06:10:43 AM »
Hi
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 €

19
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
i.e.
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
...
Do_Some_Logic:
if some_condition then return
if some_other_condition then return
if yet_another_condition then return
! // now do the logic
return


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
next


20
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=new("*viewer/preview")
->? preview'*
AlwaysUseDefaultOpenPath,Banner,Bottom,Caption$,Close(),Collate,Color,Colour,Col
umn,Columns,Copies,DPIPrinter,DPIScreen,DefaultFixedFont$,DefaultFixedFontSize,D
efaultOpenPath$,DefaultOrientation,DefaultOrientation$,DefaultPaperSize,DefaultS
aveAsPath$,Delete(),DisableBanner,DisableDelete,DisablePrint,DisableSaveAs,Disab
leSearch,DisableWatermarks,Event(),FileName$,Find(),FindNext(),FindPrevious(),Fi
rstPage(),GotoPage(),HelpContents$,HelpFile$,HelpIndex$,Icon$,Init(),Language$,L
astPage(),Left,LookAndFeel,MinimumColumns,MinimumRows,NextPage(),Open(),OutputEv
enNumberOfPages,Page,PageGutterHorizontal,PageGutterVertical,Pages,PaginationAt,
PreviousPage(),Print(),Printer$,PrinterDescription$,Process(),Quit(),Range$,RePa
int(),Report,Right,Row,Rows,SaveAs(),SaveAsPDF(),ScaleToFit,ScrollDown(),ScrollL
eft(),ScrollRight(),ScrollUp(),SetCallBack(),SetWindowStateOnCreate,SetWindowSta
teOnFirstPage,SetWindowStateOnSpoolComplete,SetWindowStateOnSpoolStart,Software$
,SuppressAllBlankPages,SuppressBannerInfo,SuppressFirstBlankPage,SuppressPrinter
Selection,SuppressSplashScreen,SuppressStatusBar,SuppressToolBar,SuppressToolTip
s,SuppressWaterMarks,ThemeName$,Top,UsePrinter$,Version$,View,View(),Visible,Wat
erMark,WaterMarkPages,Zoom,Zoom(),ZoomIn(),ZoomOut(),_revision$,

Regards

21
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
next


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
next

Anyway, thanks guys for your input

22
Programming / Syntax error in IF with string expressions
« on: March 13, 2023, 04:28:01 AM »
Hi
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

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

24
Programming / Re: Apache HTTP Interface
« on: January 07, 2023, 02:26:14 AM »
Hi
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
https://manual.pvxplus.com/PXPLUS/Webster/Webster%20Setup.htm#iis_setup
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

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

When you do
PO EXCEL_OBJ

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

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

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

Code: [Select]
-}x=new("*obj/xml","<prestashop><products><product><id>1</id></product></product
s></prestashop>")
-}
-}xpath$="prestashop/products/product/id"
-}? x'find_node(xpath$)'value$
1
-}?xpath$
prestashop

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

TIA

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

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 ?

Regards

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

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 :)

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

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

Regards,





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

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

Pages: 1 [2] 3 4 ... 9