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
Language / Re: Tree_view with check_boxes
January 19, 2026, 03:29:11 PM
You need to use item states as in:

0010 BEGIN
0020 LET tv=100
0030 LIST_BOX tv,@(40,11,30,10),OPT="e|!",SEP="/"
0040 LET tv'statebitmaps$="!Emptybox|!CheckBox"
0050 LET tv'autostate=1
0060 WHILE 1
0070 READ DATA city$,prov$,END=*BREAK
0080 LET items$+="{;1}"+prov$+"/"+city$+SEP
0090 WEND
0100 LIST_BOX LOAD tv,items$
0110 ESCAPE
1000 ! 1000 - Data
1010 DATA "Toronto","Ontario"
1020 DATA "Montreal","Quebec"
1030 DATA "Calgary","Alberta"
1040 DATA "Ottawa","Ontario"
1050 DATA "Edmonton","Alberta"
1060 DATA "Winnipeg","Manitoba"
1070 DATA "Mississauga","Ontario"
1080 DATA "Vancouver","British Columbia"
1090 DATA "Brampton","Ontario"
1100 DATA "Hamilton","Ontario"
1110 DATA "Surrey","British Columbia"
1120 DATA "Quebec City","Quebec"
1130 DATA "Halifax","Nova Scotia"
1140 DATA "Laval","Quebec"
1150 DATA "London","Ontario"
1160 DATA "Markham","Ontario"
1170 DATA "Vaughan","Ontario"
1180 DATA "Gatineau","Quebec"
1190 DATA "Saskatoon","Saskatchewan"
1200 DATA "Kitchener","Ontario"
Basically you define the images to appear in front of the elements then assign a state to the elements you want to have images on. 

In the above I assigned two images (an empty check box and a checked one) then set every element with a state of 1 (the first image - emptybox). 

You can read and change each items state when they get clicked or use the Autostate property to have the control automatically change the state when clicked.

You can used the 'ItemState property to retrieve current state.
#2
One quick thought -- which WindX are you using?
 
Is it possible you are using the 32 bit WindX and trying to run a 64 bit DLL (or vice-versa)?
#3
Programming / Re: Question TLS
January 05, 2026, 09:25:05 AM
I'm sorry, but off the top of my head I cannot remember which OpenSSL was supported by version 12.5.

Generally, on Linux, PxPlus uses the OS installed version of OpenSSL however there are changes within the OpenSSL interface that limit which version can be used without code changes within the PxPlus kernel.
#4
Web Services / Re: access pxplus variable in Javascript
December 31, 2025, 09:44:11 AM
PxPlus, like PHP, runs server side thus the answer is no, you cannot directly access JavaScript variables from PxPlus.

Below is a link to the same question asked about PHP where they discuss why server side processing, like PxPlus and PHP, cannot directly access JavaScript variables.

https://stackoverflow.com/questions/2379224/how-can-i-use-a-javascript-variable-as-a-php-variable
#5
Programming / Re: Question TLS
December 28, 2025, 01:56:19 PM
While upgrading your PxPlus would likely be your best solution, you might want to consider simply using 'curl' (or 'wget') to send your requests, especially since you said curl can connect.

Obviously it would require some coding changes but invoking curl to submit the request wouldn't be all that difficult and would remove the need to update your PxPlus to a version that supports TLS1.2 or TLS1.3.
#6
Programming / Re: Working with External objects
December 10, 2025, 12:54:50 PM
I suspect your call to the export method is incorrect.

I did a search on the web and on this page found an example that appears to show the Export method wants the exportOptions to be passed, not a boolean.

    Dim wordExportOptions As New ExportOptions()
    wordExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
    wordExportOptions.ExportDestinationOptions = dfDestinationOptions
    wordExportOptions.ExportFormatType = ExportFormatType.WordForWindows
    wordExportOptions.ExportFormatOptions = Nothing
   
    rd.Export(wordExportOptions)
#7
Programming / Re: Working with External objects
December 09, 2025, 04:17:46 PM
Have you tried setting 'VAL$ of the *VARIANT object then changing its type?

->def object v,"*variant"
->v'val$="false"
->?v'val$
false
->print v'type$
S
->v'type$="B"
->print v'val
 0
->v'val$="true"
->print v'type$
S
->v'type$="B"
->print v'val$
-1
As per the docs, setting the type will cause the *VARIANT to properly convert the value.
#8
Programming / Re: Working with External objects
December 09, 2025, 10:58:24 AM
The routine may require that you explicitly pass a boolean.  If so you can likely define a *VARIANT object, set its type to boolean and value then pass that.

Here is some information on *VARIANT

https://manual.pvxplus.com/PXPLUS/Automation%20in%20PxPlus/PxPlus%20COM%20Interface%20Extensions/Overview.htm#variant
#9
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 "".
#10
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
#11
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.
#12
Thin Client/WindX / Re: Auth Failure error
November 04, 2025, 11:48:53 AM
You are most welcome.
#13
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)
#14
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.
#15
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.