(RPG and RDMLX) Is there a way to clear the form buffer?

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
JohnJoiner
Posts: 37
Joined: Fri Oct 19, 2012 8:48 am

(RPG and RDMLX) Is there a way to clear the form buffer?

Post by JohnJoiner »

Let's say that I've created a couple of U/I elements dynamically by referencing the elements within the context of a form, but then prior to sending the form to the device (prior to issuing LRNG_SendReceive in my case, since I have chosen to not use display files), I want to clear the "form buffer" and start over building the form with different UI elements. Is there a way to clear the "form buffer" prior to "displaying" the form? I'm envisioning something on the lines of 'LRNG_AssignNullToProp('/form')' (btw I've tried this and it does not work).

I understand that if I set 'sendChangesOnly' to FALSE, this will clear whatever is currently on the form and rebuild it when the form is displayed, but I'm looking for a way to clear the "buffer" before the form is displayed.

Thanks in advance.

JJ
Paul

Re: (RPG) Is there a way to clear the form buffer?

Post by Paul »

Hi John,

How about 'LRNG_AssignNullToProp('/form.Fields')' ?
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: (RPG) Is there a way to clear the form buffer?

Post by MarkDuignan »

http://www.longrangemobile.com/docs/LRP ... pertyc.htm

LRNG_DiscardPropertyChanges
Discards all property changes made since the last execution of LRNG_Receive or LRNG_DiscardPropertyChanges.
This is a rarely used procedure. It is typically used to rollback changes before switching to control to another program.
This procedure does not have any parameters.
Note: Your LongRange RPG server version must be dated after April 2nd 2013 for this procedure to be available.

If required download the latest RPG server version from http://www.longrangemobile.com/upgrade.htm
JohnJoiner
Posts: 37
Joined: Fri Oct 19, 2012 8:48 am

Re: (RPG) Is there a way to clear the form buffer?

Post by JohnJoiner »

Paul,

Thanks, but I had already tried all variations I could think of on the LRNG_AssignNullToProp() thing ('/form', '/form.fields', even '/form.fields.lblDriver' (the fields I had created)). I've found that with LongRange, sometimes there are "undocumented" features hidden away, if only I take a little time to try different things, as it sounds like you've discovered as well. Sadly, in this case, no luck.

JJ
JohnJoiner
Posts: 37
Joined: Fri Oct 19, 2012 8:48 am

Re: (RPG) Is there a way to clear the form buffer?

Post by JohnJoiner »

Mark,

YES!!! That is EXACTLY what I was looking for, 'LRNG_DiscardPropertyChanges', and your description of its use is exactly what my problem was.

I have 'formView A' which, under some situations, will "switch control" to 'formView B', but each of my formView programs, upon starting, will invoke an initialization process to dynamically "build" some or all of the form fields it needs. If 'formView A' "transfers control" to 'formView B' without issuing 'LRNG_SendReceive' first, 'formView B' will be garbled up with stuff for both 'formView A' and 'formView B'.

'LRNG_DiscardPropertyChanges' solves that problem. I guess I missed this new procedure when reviewing the documentation for the last upgrade.

Thanks.

JJ
Paul

Re: (RDMLX) Is there a way to clear the form buffer?

Post by Paul »

The equivalent in LongRange LANSA is the ClearPropertyChanges method.

http://www.longrangemobile.com/docs/lan ... hanges.htm
Post Reply