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 - Mike King

#1
Programming / Re: JSON get_num validation
November 29, 2025, 01:52:49 PM
You should just be able to disable the 'NE' and then re-enable it around the function call. That being said, I confirmed the operation of 'NE' using the following Object and test programs:

Object (with error cascading):
  def class "test"
 !
 ! Method
 !
  function method$(a$)
  enter a$
  x$=_obj'subMethod$(a$,err=CascadeErr)
  return x$
 !
 CascadeErr:
  exit err
 !
 ! Submethod
 !
  function subMethod$(a$)
  enter a$
  if a$="bad" \
   then exit 11
  return ucs(a$)
 !
  end def
Test Program:
  oTest=new("test" for program)
  set_param 'NE'=0 ! Default setting
  gosub DoTest
 !
  set_param 'NE'=1
  gosub DoTest
 !
  end
 !
 DoTest:
  print "--------",'LF',"Test with 'NE'=",prm('NE')
 !
  print oTest'method$("good")
  print otest'method$("bad",err=RptErr)
  escape ! Should not get here
 !
 RptErr:
  print "Error exit taken"
  return

When I ran this I got the following:

->run "test
--------
Test with 'NE'= 0
GOOD
Error exit taken
--------
Test with 'NE'= 1
GOOD
Error exit taken

If you remove the ERR=CascadeErr from the object the error occurs if running with 'NE' enabled:

->run "test
--------
Test with 'NE'= 0
GOOD
Error exit taken
--------
Test with 'NE'= 1
GOOD
0007 LET x$=_obj'subMethod$(a$) ! ,err=CascadeErr)
Error #11: Record not found or Duplicate key on write

I would strongly recommend you use the ERR= branch to detect if a item is missing.  The return value of a null string ("") doesn't let you know if the value is undefined versus defined explicitly in the JSON as "".
#2
Programming / Re: JSON get_num validation
November 25, 2025, 10:24:37 AM
Generally internal errors being reported by objects or subprograms should be cascaded back to the user application.

I suspect that the json object is making some form of internal call that itself is returning an error that is not being properly cascaded back to your application.  This means if the 'NE' system parameter is set your application will fail with an error inside the object.

Normally when creating an object for which you anticipate returning an error from, if you need to invoke another method, object or subprogram that can return an error, you should explicitly provide an error trap that itself invokes an EXIT ERR.  This should allow the error condition to be passed back to your application regardless of the setting of 'NE'.

For Example:

Method1:
  ENTER A$,B$
  X$=_obj'SubMethod(A$, ERR=CascadeErr)
  ...
CascadeErr:
  EXIT ERR
#3
Programming / Re: JSON get_num validation
November 23, 2025, 09:18:58 AM
Do you enable the 'NE' system parameter? 

The problem you are having sounds a lot like the error is being generated in the object and it may be assuming that the error will be cascaded back up the stack which it would be if the 'NE' parameter is not enabled.
#4
Thin Client/WindX / Re: Auth Failure error
November 04, 2025, 11:48:53 AM
You are most welcome.
#5
There are any number of ways to do this using the PxPlus charting facility. You simply need to define the data set you want charted using the Nomads Query system and the type of chart and settings.  The system will do the rest. 

The charting utility can create charts in a couple of formats such as a fixed image (JPG/PNG) which you can embed in your web page, or it can create a HTML page that you can use in an iframe or directly copy into your pages.

If using Webster+ you can also use the [chart] short code to automatically embed a chart.  (ref: https://manual.pvxplus.com/PXPLUS/Webster/Short%20Codes.htm#chart)

Using Webster+ you can also assign events to the chart so that the user can use it to drill down to the underlying data.

You could also use the *OBJ/CHART routine to create the chart directly from your code and then embed/use the output (JPG, PNG or HTML)
#6
Web Services / Re: PxPlus pipe issue on Windows with curl
September 21, 2025, 02:13:13 PM
The issue might be a missing end of line terminator in the data.

Using RCD the system assumes the input contains a proper end of line terminator which is 0A on Linux, but 0D 0A on Windows.  If there is no terminator an error may be generated since the pipe will return EOF status and the record will be considered incomplete.

Try using a read record with a SIZ= small TIM= value to see what CURL is actually returning.
#7
Web Services / Re: Unexpected Response in an HTTP Request
September 21, 2025, 02:07:49 PM
If running on Windows, instead of using *plus/web/request try calling *wininet which is a Windows only alternative that uses the Windows internet DLL (wininet.dll).

The calling sequence is the same as *plus/web/request.
#8
The extra information that Explorer shows generally comes from reading the physical file.  It extracts various pieces of information based on file type. Attributes such as address and subject are simply being determined based on the contents of the file and are not truly physical file attributes.

Explorer uses the file suffix and contents to determine how to extract the information based on known file types.

You could replicate that functionality however that would require to know how to parse each of the file types you encounter.
#9
Hi Phil,

Since retiring from PVX Plus Technologies I have been offering my services to assist people with PxPlus application development.  While I am not looking for full time work, I'm available to assist both developers using PxPlus or with other software development issues.

I don't know exactly how long I will continue to offer my services but I'm not in any hurry to put software development/consulting completely behind me.  I still enjoy a good challenge.

#10
Nomads / Re: Grid Images
May 20, 2025, 05:07:44 PM
Here is a simple program you can use to copy an image to the clipboard.  Simply set this program as the 'popup' processor for the grid cells for which you have the bitmap$ attribute set.

! Utility to copy image from Grid cell to clipboard
! Set the "popup" attribute of the image cell to perform this program
  local file$
  file$=pth(id'bitmap$,err=*next)
  if file$="" \
   then msgbox "Cannot copy";
        exit
  popup_menu "[Copy image=1001]",x
  if x<>1001 \
   then exit
  open (hfn)"|powershell.exe"
  x$="Add-Type -AssemblyName System.Windows.Forms;"
  x$+="Add-Type -AssemblyName System.Drawing;"
  x$+="[Windows.Forms.Clipboard]::SetImage($([System.Drawing.Image]::Fromfile("+quo+file$+quo+")));exit;"
  open (hfn)">powershell.exe"
  print (lfo)x$
  close (lfo)

NOTE: You would need to tweak the code a bit to work under WindX.  Basically you would need to copy the file from the server to a scratch file on the workstation and pass that workfile name to powershell.
#11
Nomads / Re: Grid Images
May 07, 2025, 12:53:37 PM
Not directly but you should be able to detect/process the right click yourself and use a utility such as nircmd to copy the image file to the clipboard.  You can also use a powershell script to copy the image.
#12
Nomads / Re: Standard List Boxes
May 01, 2025, 02:47:27 PM
If you are using a formatted list box there is a option of setting full line highlight in Nomads on the list box.  This will highlight the whole line in the list box as opposed to just the text in the item.

Also, while I don't remember which release it was added but there is a way to change the background color for all formatted list boxes when they don't have focus using the 'OPTION' mnemonic.

PRINT 'OPTION'("LvuSelBackClrNoFocus", ColorDescriptor),

Where ColorDescriptor could be any color specification in PxPlus such as "RED", "RGB: 100,200,200", "#Orange".

You can actually tweak a number of system colors using the 'OPTION' mnemonic.
#13
Nomads / Re: Grid Images
May 01, 2025, 02:16:06 PM
Jeff

Do you want to copy the image or the text of product option?

#14
Wish List / Re: SELECT DIRECTIVE OUTPUT
April 28, 2025, 01:53:52 PM
You can do something similar by defining a query that has the fields you need then open the query using *query* ; panel ; library.

While it doesn't create actual files, it does provide a logical file that you can read and the data can come from multiple data sources using file links in the query definition.
#15
Nomads / Re: Standard List Boxes
April 24, 2025, 10:49:43 AM
Is the light gray the background colour or the text (foreground) colour?

Also what version PxPlus and Windows?