Page 1 of 1

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

Posted: Tue Jun 04, 2013 8:40 am
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

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

Posted: Tue Jun 04, 2013 9:39 am
by Paul
Hi John,

How about 'LRNG_AssignNullToProp('/form.Fields')' ?

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

Posted: Tue Jun 04, 2013 2:02 pm
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

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

Posted: Tue Jun 04, 2013 11:24 pm
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

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

Posted: Tue Jun 04, 2013 11:51 pm
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

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

Posted: Wed Jun 05, 2013 1:31 pm
by Paul
The equivalent in LongRange LANSA is the ClearPropertyChanges method.

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