News:

Official release of PxPlus 2025 Update 1 (version 22.10)  NOW available for download.

Main Menu

Recent posts

#61
Programming / Re: Working with External obje...
Last post by Astecom - Koen - December 08, 2025, 07:48:01 AM
No idea about the report issue, using a 1 or 0 for True of False generally works.

The xmlsig issue can probably be fixed by prefixing cert with a *:
LET SIG'SETX509CERT(*CERT,1)

Passing a COM-object to another COM-object needs a * prefix.
#62
Programming / Re: Working with External obje...
Last post by Devon Austen - December 05, 2025, 04:42:21 PM
Check the properties and methods available to pxplus by doing a

print EXP'*
or
print SIG'*

You can verify that Export() and SETX509CERT() are methods.

Other things to debug is check msg(-1) after you get the error for any more detailed error info. You could also checked

print EXP'PvxError$ for the same.
#63
Programming / Re: Working with External obje...
Last post by HendersonS - December 05, 2025, 01:43:29 PM
hi james, yes, we have tried with: true,false,"true","false",$00$,-1,0, and in all cases we get the same error.
#64
Programming / Re: Working with External obje...
Last post by James Zukowski - December 05, 2025, 01:25:18 PM
Have you tried passing "true" or "false" instead of 1 or 0?
#65
Programming / Working with External objects
Last post by HendersonS - December 05, 2025, 12:43:47 PM
Hi everyone. Lately, we've been working with third-party objects to interact with xmlsig, CR reports, etc., and we're having the same problem when passing a value to a method that requires another object as its constructor, or when passing a boolean value to the method. Does anyone know how we should handle these kinds of interactions? Thanks in advance.

Example with cr reports:
!
 DEF OBJECT CR_APP,"CrystalRuntime.Application"
 LET REPORT=CR_APP'OPENREPORT("C:\temp\customers.rpt") ! // This opens the report and creates the 'Report' object
 !
 LET EXP=REPORT'EXPORTOPTIONS
 LET EXP'DESTINATIONTYPE=1
 LET EXP'FORMATTYPE=31 ! pdf
 LET EXP'PDFEXPORTALLPAGES=-1
 LET EXP'DISKFILENAME$="C:\temp\customers.pdf")
 !CR Expects a boolean (true or false) !false no show dialog
 REPORT'EXPORT(0) ! this give an error 88 Invalid/unknown property name

example with xmlsig:
DEF OBJECT SIG,"Chilkat.XmlDSigGen.11" ! xmlsigner object
DEF OBJECT CERT,"Chilkat.Cert.11" ! cert object
LET CERT'LOADPFXFILE("C:\temp\cert.p12","pass")
LET C=CERT'LOADPFXFILE("C:\temp\cert.p12","pass") ! also we try this
LET SIG'SETX509CERT(CERT,1) ! this give an error 88 Invalid/unknown property name
LET SIG'SETX509CERT(C,1) !this give an error 88 Invalid/unknown property name ! also we try this
#66
Programming / Re: JSON get_num validation
Last post by Aaron Woodhouse - December 02, 2025, 09:05:36 AM
We'll look further into error trapping for the JSON Object to make it work better using ERR.

In the meantime, another solution could be to use the 'Exists(key$) function, which would tell you if it's safe to get a value, since it'll return 1 or 0.
#67
General Announcements / PVX Plus November 2025 Update
Last post by PxPlus - December 02, 2025, 07:49:17 AM
Keep up to date with what's happening at PVX Plus.  Please see our latest newsletter.

November 2025 Newsletter
#68
Programming / Re: JSON get_num validation
Last post by martinp - December 01, 2025, 04:24:29 PM
Thanks Mike.  Setting with 'NE'=0 did the job with the ERR=*NEXT clause BUT only if I disabled my "ERROR_HANDLER"   LOL  Somehow that was overruling it. 

The ,1 still seems to work best with GET_STR after all this.

let X$=J'GET_STR$(Y$,1)
#69
Programming / Re: JSON get_num validation
Last post by Mike King - 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 "".
#70
Programming / Re: JSON get_num validation
Last post by martinp - November 27, 2025, 11:25:27 AM
Thanks for the discussions appreciate it!

Well I had 'NE' on, setting it off just brings me back to my program with the same error 11 still.  I was hoping ERR=*NEXT would then work on:

let TEX$=J'GET_STR$("edges."+str(I)+".texture",err=*next)

however it still does not.

The "Try-catch" worked to trap the error, I'm not used to that but could work.

The most elegant solution is just

let TEX$=J'GET_STR$("edges."+str(I)+".texture",1)

It just doesn't feel intuitive for me I would never remember that but I guess I would if I use it more.

Maybe this is normal working with JSON.

Long story short the data coming back sometimes had "edges.XX.texture" and some records, did not so I got the error.  My solution before the ",1" was to just load it into an array and I had no errors after.

Thanks again.