PxPlus User Forum

Twitter Twitter Twitter

Recent Posts

Pages: 1 ... 7 8 [9] 10
81
Programming / Re: error handling in objects
« Last post by Peter.Higgins on July 21, 2022, 01:25:26 PM »
Thanks Mike,
The goal is to not do an exit err or escape err which triggers the main error handler.  Just silently return messages so they can be logged unless an exit err or escape err is put into the object for critical tasks.  Perhaps I've over thought this and a generic return on the seterr procedure will work?
82
Programming / Re: ERR option ignored
« Last post by Mike King on July 21, 2022, 08:35:14 AM »
Thomas

Can you confirm the error is on the DEF OBJECT or the call to getNameSpace?
83
Programming / ERR option ignored
« Last post by Thomas Bock on July 20, 2022, 10:42:32 AM »
For a few weeks we encounter a strange error 65 every now and then, when our programs create a COM object.
Code: [Select]
ON_CREATE:
def object outlook, "[LCL]Outlook.Application", err = *next
if not(tcb(2)) then nameSpace = outlook'getNameSpace("MAPI")
return
This has been a save way ever since. On the WindX side MSG(-1) returns "Exception occured (err/ret=2/0)"
According to Eric we should check for the object reference > 0. But I wonder why the err option is ignored in these cases.
84
Programming / Re: error handling in objects
« Last post by Mike King on July 18, 2022, 11:06:01 AM »
You can include a SETERR in the object definition and it will take effect whenever running in the object.

For Example:

0010 DEF CLASS "a"
0020 SETERR Trap_it
0030 PROPERTY name$
0040 FUNCTION Divide(x)
0050 ENTER x
0060 LET a=100/x
0070 RETURN a
0080 END DEF
0090 !
0100 Trap_It:
0110 PRINT "Err=",ERR," line ",ERS
0120 EXIT ERR
->a=new("A")
->?a'divide(10)
 10
->?a'divide(7)
 14.29
->?a'divide(0)
Err= 40 line  60
Error #40: Divide check or numeric overflow
->
85
Programming / Re: error handling in objects
« Last post by St├ęphane Devouard 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
86
Programming / error handling in objects
« Last post by Peter.Higgins on July 17, 2022, 10:59:56 AM »
If the goal is to capture the minor errors in an object create or a method, is there a way to use SETERR and do a proper return integer/string to the stack?  I am looking to save the errNumber and ErrMessage$ and suppress error processing from an escape err or exit err in the stack program so they can handle the error as required.  I can do this using TRY or EVN/EVS encapsulation but it would require extensive additions to every object method of which there are around 100 objects and unknown qty of methods and anticipating all possible errors is not likely.
87
Programming / Re: *web/sftp
« Last post by Peter.Higgins on July 17, 2022, 10:46:17 AM »
Thanks Devon,
I was thinking with some hope bias that this was ignorable.
88
iNomads / Bar Code Reading in iNomads
« Last post by HendersonS on July 14, 2022, 05:41:06 PM »
hello everyone,

we are trying to use the "*plus/inomads/scanner" tool to read barcodes on mobile devices (iPhone/iPad) and it always generates an 11 error on the line that calls this routine.
on android devices it opens the code reader application but it does not return the read value, has anyone used this tool that can give me some help?

This is a sample of how I am calling the routine:
For Android:
Code: [Select]
CALL "*plus/inomads/scanner",x_dat$,"CODABAR,CODE_39,CODE_93,CODE_128,QR_CODE"
For iPad/iPhone:
Code: [Select]
CALL "*plus/inomads/scanner",x_dat$,"QR_CODE"
89
Off Topic / Re: AWS or other Hosted Server for production environment
« Last post by Patrick Denny on July 14, 2022, 03:22:52 AM »
Mike - Thanks for the feedback!
90
Off Topic / Re: AWS or other Hosted Server for production environment
« Last post by Mike King on July 13, 2022, 03:37:58 PM »
We have a test Amazon server that we have run PxPlus on.  About the only wrinkle was to make sure the firewall allowed the inbound connections.

As for estimating cost, that totally depends on your application.

Now as for my personal opinion, while the whole world seems to want to move the Cloud, personally I warn clients that by moving their application off premise they become reliant on good, reliable, high speed internet access.  When the host server is in-house, their in-building network wiring is generally 100MB to 1000MB.  Once they move to the cloud they most likely will not have the same network speed.

Also, just to reinforce my position, here in Canada last Friday one of the major Internet carriers went down and took out around 25% of the country for 1-2 days (some parts are still having trouble).  Could their business run without access to ANY of their files/applications for 1-2 days?

To me, given a choice, I would always chose to host an application in-house, provide in-bound controlled access, and use the cloud for backup and potentially emergency hosting.

A little up-front planning, good automated backups, and a bit of redundant hardware generally will provide a high degree of system availability.
Pages: 1 ... 7 8 [9] 10