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 - bteixeira

Pages: [1] 2
Language / Re: Force screen refresh in iNomads
« on: November 18, 2020, 04:41:06 PM »
Inspecting %inomads'* shows a 'redraw() method that seems to do what I need but isn't documented anywhere.  Anyone know if this is safe to use / which version it was added in?

Language / Force screen refresh in iNomads
« on: November 18, 2020, 02:05:08 PM »
Is there a way to force a screen refresh in iNomads?  refresh_flg=1 does not seem to do it.  I'm particularly interested in changing the template in code %inomads'template$="newtemplate" and then redrawing the current screen with the new template.

Language / *browser and reCAPTCHA
« on: October 21, 2020, 02:22:57 PM »
I'm getting mixed results trying to navigate to sites with a reCAPTCHA using *browser.  I think it might be version based.  I have a client running v14 and the reCAPTCHA won't load but in my office on v16 it does.  Captchas have been around for ages so I'm a little surprised that an older version of *browser wouldn't be able to handle it.  Are you aware of anything that may have changed between versions that would allow reCAPTCHA to start working?  Is there a minimum version for this or a setting to turn on so the old version will display properly?

Language / finditemtext$ and load on demand
« on: September 10, 2020, 06:07:49 PM »
Is there a way to get finditemtext$ and load on demand to work at the same time.  Right now it looks like finditemtext will only search loaded rows.

Programming / [odb] / [mysql] escape characters
« on: August 13, 2020, 04:21:49 PM »
We have code writing to a database using the [odb] tag.  It works well generally, however at one client, they are using a MySQL server.  MySQL needs backslashes to be escaped (especially at the end of a field where it would end up escaping the quote delimiters).  If using the [odb] tag, a backslash in data is not getting escaped.  Would using the [mysql] tag instead resolve this?  Is there an option or setting that would let us use the [odb] tag still but correctly escape the backslashes?

iNomads / iNomads Class for Queries
« on: August 04, 2020, 11:30:28 AM »
I don't see a place to put an iNomads class on query panels.  I at least need a way to distinguish that the panel is a query.
Additionally, is there a way to have query columns auto-size?  The query screen is maximizing to the browser, which is good but the columns stay small and it looks really bad.

Language / Re: TCP channel, is it alive?
« on: February 13, 2020, 10:00:39 AM »
We'll try the keep alive option.  A one minute response is better than what we're currently seeing without a tim= branch of 10+ minutes (possible indefinite) while waiting on a read

Language / Re: TCP channel, is it alive?
« on: February 11, 2020, 04:20:02 PM »
     I tried opening the channel and then forcing a disconnect and doing a write record.  PxPlus neither threw an error nor waited, I think it just went into some sort of system buffer.  I re-established the connection and the device picked up the command.  Is there anything on the write I could do to not buffer but instead throw an error if the connection is down?  That could work for us in this scenario.

The only way you can know if a TCP connection has dropped is basically by sending something to it and waiting for the packet acknowledgement.  This is effectively what KEEP-ALIVE does however the KEEP-ALIVE timeout is generally over 1 minute, so likely not suitable for this situation.

Using a TIM= is about the best I can suggest.  Perhaps with a longer timeout on the first character.

Language / TCP channel, is it alive?
« on: February 11, 2020, 02:53:25 PM »
At one of our clients, we're trying to communicate with a device via TCP but the connection isn't great.  We're having difficulty telling if the device is still working on the command and hasn't replied yet or if the connection has dropped.  The basic code looks like:

write record(tcp_chan)"command goes here"
while 1
read record(tcp_chan,tim=5)resp_segment$
let response$+=resp_segment$
if pos(end_of_message$=response$) then goto *break

If the connection has dropped we want to know as soon as possible and then we can try re-opening the channel, request the last command, prompt the user to reset the device etc.  Without a tim= branch we can sit there way too long.  However the device may legitimately take a long time to process the command, especially if human interaction is involved it could take well over a minute.

Is there a way to determine if the connection has dropped or if the device is just taking a long time to process?

Language / Re: DIM (FIND ) and LIKE
« on: October 04, 2019, 10:32:58 AM »
So to the original question, is there a way to find the first element of an array that contains a substring without using a for loop?

Language / DIM (FIND ) and LIKE
« on: October 04, 2019, 09:12:51 AM »
I'm trying to get the first element in an array that contains a substring.  (Preferably without having to do a for loop)
DIM (FIND ) looked promising but it doesn't seem to work with the LIKE comparison.
Is there another way to do this?

Language / DUMP GOTO / 'TJ' Parameter
« on: July 31, 2019, 10:42:45 AM »
DUMP GOTO looks like it would be really useful for debugging... but the results I'm getting are basically pages and pages of *winproc... is there another parameter that says don't track jump history in system programs?

Programming / Re: Apache HTTP Interface
« on: February 21, 2019, 04:19:53 PM »
     I did some digging into in_proc, in_send and in_recv and came up with the following code that looks like it does what I want:

00020  let TO_OUTPUT$="<?xml version="+quo+"1.0"+quo+"?><outside><first>Ben</first><last>Teixeira</last></outside>"
00030  let TO_OUTPUT$+=$0D0A$
00040  if len(TO_OUTPUT$)>9000 \
        then write record (OUTFILE,err=*next)ior($8000$,bin(8000,2))+mid(TO_OUTPUT$,1,8000);
             let TO_OUTPUT$=mid(TO_OUTPUT$,8001);
             goto *same
00050  if not(nul(TO_OUTPUT$)) \
        then write record (OUTFILE,err=*next)bin(len(TO_OUTPUT$),2)+TO_OUTPUT$
00060  remove (OUTFILE,err=*next)
00070  end

I just set up a transaction with this program and no exit url.  Using *plus\web\request the response is exactly right.
This works, but I'm hesitant to use something like this, sort of going around the back of iNomads.  Who knows what might change in future versions of PxPlus?

As a wishlist item, could we get something in iNomads where you could specify that a transaction is a REST request and we could write a program similar to the above (or better just set something like %inomads'rest_response$) that would handle the response?

Programming / Re: Apache HTTP Interface
« on: February 21, 2019, 09:30:51 AM »
I'm more asking, since I know iNomads lets you keep the application server separate from the web server, can I use iNomads to generate the XML/JSON response rather than doing the Apache reverse proxy you mentioned before.

Programming / Re: Apache HTTP Interface
« on: February 21, 2019, 08:25:58 AM »
Can you use iNomads to generate an xml or json file instead of displaying a panel?  I know you can specify a program to run instead of a panel but I don't see anything equivalent to the %print_fn channel.

Pages: [1] 2