Re: Defining variables in R5

2017-11-24 Thread John Baughman via 4D_Tech
With regard to the issue I mentioned about defining object fields, I just did 
another field and it worked fine. Must have been something else going on with 
the empty data file.

John

> On Nov 24, 2017, at 8:39 PM, John Baughman  wrote:
> 
> Yesterday I found myself in need o dynamic Help Tips in list box cell cells, 
> so I downloaded and started working with v16R5 beta. The first thing that 
> happened is I started getting undefined errors. I think that unlike forever 
> in 4D, variables not defined either explicitly or implicitly, must be 
> declared in interpreted mode. Not sure but it looks like whatever the 
> compiler would complain about in this regardd, now throws an error when 
> running interpreted. For example…
> 
>SET QUERY DESTINATION(Into variable;$zeroEntryFound)
> 
> If $zeroEntryFound is not typed with c_longint or zeroEntryFound:=aNumber you 
> will get a runtime error in interpreted mode.
> 
> I don’t have a problem with this as even though I do not deploy compiled, I 
> make it a habit to always make sure that the structure will compile before 
> deploying. I am wondering, however, if this is a step forward or backward. It 
> has made it difficult moving from R4 to R5.
> 
> I also ran into a typing error with the following when I opened a data file 
> where much of the data had not been entered yet…
> 
>  If (Not(OB Is defined([_Constants]ProjectTaskDescriptions)))
>[_Constants]ProjectTaskDescriptions:=New object
> 
>  End if 
> 
>[_Constants]ProjectTaskDescriptions.taskdescriptions:=$colTaskDiscriptions
> 
> The last line above throws an error saying that 
> [_Constants]ProjectTaskDescriptions is undefined. It worked in R4 where I 
> first populated the field, but after switching to R5 and opening a fresh 
> datafile where the field was not already populated, it threw the undefined 
> error. I did not pursue the issue as I reverted back to my populated data 
> file, but this looks like a bug to me. How then does one define an object 
> field?
> 
> By the way. Dynamic Help Tips in List Boxes is really great! Very easy to 
> implement and is really slick in use.
> 
> John
> 
> 
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> 
> 
> 
> 

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Defining variables in R5

2017-11-24 Thread John Baughman via 4D_Tech
Yesterday I found myself in need o dynamic Help Tips in list box cell cells, so 
I downloaded and started working with v16R5 beta. The first thing that happened 
is I started getting undefined errors. I think that unlike forever in 4D, 
variables not defined either explicitly or implicitly, must be declared in 
interpreted mode. Not sure but it looks like whatever the compiler would 
complain about in this regardd, now throws an error when running interpreted. 
For example…

SET QUERY DESTINATION(Into variable;$zeroEntryFound)

If $zeroEntryFound is not typed with c_longint or zeroEntryFound:=aNumber you 
will get a runtime error in interpreted mode.

I don’t have a problem with this as even though I do not deploy compiled, I 
make it a habit to always make sure that the structure will compile before 
deploying. I am wondering, however, if this is a step forward or backward. It 
has made it difficult moving from R4 to R5.

I also ran into a typing error with the following when I opened a data file 
where much of the data had not been entered yet…

  If (Not(OB Is defined([_Constants]ProjectTaskDescriptions)))
 [_Constants]ProjectTaskDescriptions:=New object

  End if 

[_Constants]ProjectTaskDescriptions.taskdescriptions:=$colTaskDiscriptions

The last line above throws an error saying that 
[_Constants]ProjectTaskDescriptions is undefined. It worked in R4 where I first 
populated the field, but after switching to R5 and opening a fresh datafile 
where the field was not already populated, it threw the undefined error. I did 
not pursue the issue as I reverted back to my populated data file, but this 
looks like a bug to me. How then does one define an object field?

By the way. Dynamic Help Tips in List Boxes is really great! Very easy to 
implement and is really slick in use.

John




John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Subform initialize logic

2017-11-24 Thread Kirk Brooks via 4D_Tech
Piotr,

On Fri, Nov 24, 2017 at 2:59 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> As an example I have the following scenario:
> An employee form with a lot of fields and a checkbox “manager” on page 1
> Other fields on page 2
> The items of some “dropdown lists” (custom widget) on page 2 depend on the
> manager status (checkbox) on page 1
>
> So when going through the records with next/previous buttons and being on
> page 2 I have to re-populate the dropdown widgets when the manager status
> changes
> But now, when being on page 1 and going to page 2 for the first time I
> also have to populate the dropdown widget.
>

Good example. The way I'd approach this is in the On load event of the
parent form:

EXECUTE METHOD IN
SUBFORM("dropdown_widget";"config_employee_widget";*;$isManager)​

'config_employee_widget' would also set the display value. The only action
the subform needs to deal with is the On data change event. You know you
could just set the drop down display value at this point and populate the
actual list when/if the user clicks on it.

I'd run that same code ​in response to the checkbox changing as well.

So now I have 2 places where I have to populate (by method or not) the
> dropdown widget
>
​Personally I don't use drop downs for this sort of selection very often.
Totally an aesthetic thing for me but I prefer to either use a button or a
form var and a button.

For the button alone I set the button title to the selected value when the
parent form loads. On Click I build and display a menu of options, store
the user choice and update the button title.

The other interface is a non-enterable var to display the value and some
small graphic, like a hamburger button
,
to manage the popup menu.

These approaches don't require any list building unless something actually
changes. ​I used to be concerned about the processing required for doing
this this sort of stuff on-the-fly but the truth is both 4D and hardware
are powerful enough it's rare it makes any difference on user forms.

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Subform initialize logic

2017-11-24 Thread Piotr Chabot Stadhouders via 4D_Tech
Kirk,

As an example I have the following scenario:
An employee form with a lot of fields and a checkbox “manager” on page 1
Other fields on page 2
The items of some “dropdown lists” (custom widget) on page 2 depend on the 
manager status (checkbox) on page 1

So when going through the records with next/previous buttons and being on page 
2 I have to re-populate the dropdown widgets when the manager status changes
But now, when being on page 1 and going to page 2 for the first time I also 
have to populate the dropdown widget.
So now I have 2 places where I have to populate (by method or not) the dropdown 
widget

I hope you understand what I am saying
Needing 2 calls instead of 1 is what I  don’t like

Gr,

Piotr

Piotr,

On Thu, Nov 23, 2017 at 11:01 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_t...@xxx.xxx> wrote:

> I have to do this “On Page Change”
>
​Yep, this is exactly the sort of situation that makes having the subform
config code in a process method useful - the subform doesn't need to even
know what page it's on because the parent form is controlling when it
configures itself. ​

​Is it the case your subform on page 2 changes configuration while the
parent form is displayed?​


--
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4d_tech-unsubscr...@xxx.xxx
**
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Request PATCH

2017-11-24 Thread Douglas Cryer via 4D_Tech
Koen,

Re:
>  There is no PATCH constant defined in 4D, but you can use “PATCH” as string 
> for http method as the first parameter:
>  HTTP Request(“PATCH”;$url;…)

Many thanks.  I had that thought in the waking hours and was going to try it.  
I had not spotted it was a string constant.

The call works fine now :-)

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.com 

 

> On 22 Nov 2017, at 20:00, 4d_tech-requ...@lists.4d.com wrote:
> 
> HTTP Request PATCH

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**