Listbox horizontal jumpiness after editing a cell

2018-04-07 Thread Don Lapin via 4D_Tech
Does anyone have a solution for this? I've put up with it since I started using 
listboxes, but it seems there should be a way around it.

- Selection-based listbox

- Horizontally scroll to and then edit a cell that's off the visible "window" 
to the right.

- Exit cell after update (clicking elsewhere out of cell or hit return) -> 
listbox returns fully to left hand side, and user can no longer see the edited 
cell.

Thanks,
Don

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

JSON Validator in POP component, where is it?

2018-04-07 Thread John Baughman via 4D_Tech
My summit notes for the Dynamic Forms session indicates that there is a JASON 
validator in the POP component. If I heard hat correctly, what version of the 
ocmponent is it in and where can I find it?

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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Equivalent of FORM GOTO SUBFORM PAGE

2018-04-07 Thread Keisuke Miyako via 4D_Tech
you can call FORM GOTO PAGE with an asterisk option
http://doc.4d.com/4Dv15/4D/15.5/FORM-GOTO-PAGE.301-3577151.en.html

2018/04/07 19:09、truegold via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
Seems like we need something like this to work.



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

Equivalent of FORM GOTO SUBFORM PAGE

2018-04-07 Thread truegold via 4D_Tech
Hi All,

Might be a good time to revisit this issue I had some time back. well and 
actually I have a need for it to work once again.

Scenario: I have a parent form which has a single subform container. This 
container is set via code to a subform where I do edits of various kinds. There 
are two pages of this subform (previously had two different subforms but these 
are too similar).

When this parent form is opened I want this subform to change to either page 
one or page two based upon a condition.

My questions are:

1. Can a subform (within a subform container) have multiple pages that can be 
switched to via code?

2. If the answer is yes, then where do I tell this subform to change it’s page.

3. Since FORM GOTO PAGE seems to only work with the parent form do we have the 
equivalent of FORM GOTO SUBFORM PAGE ?

Seems like we need something like this to work.

I’ve tried many different combinations of “CALL SUBFORM CONTAINER” and/or 
“EXECUTE METHOD IN SUBFORM” but the code fires but the parent form always 
changes page.

Anyone know how to deal with this?

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

Re: v13 - Win 7 and LEP [solution/summary]

2018-04-07 Thread Chip Scheide via 4D_Tech
After talking with Keisuke at the summit it was found that:
the code I was using was NOT correctly escaping the file or folder path.
this was due to a failed copy/paste of some of Keisuke's code (LEP_Escape from 
one of his demos).

Replacing the broken code with the correct code resolved the issue.

Thanks for everyone who tried to help 
and special thanks to Keisuke!
Chip
> some testing reveals that...
> 
> XCOPY returns an "invalid path error" if the source path ends with a 
> folder separator
> XCOPY begins an "is this a file or a path" dialog if the destination 
> path does NOT end with a folder separator
> 
> so here is a small example
> 
>> $command:="cmd.exe /C xcopy "
>> 
>> $src:=System folder(Desktop)+"src"+Folder separator
>> CREATE FOLDER($src;*)
>> 
>> C_BLOB($VOID)
>> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
>> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
>> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
>> 
>> $src:=System folder(Desktop)+"src"  //must remove folder separator
>> $dst:=System folder(Desktop)+"dst"+Folder separator  // must add 
>> folder separator
>> 
>> $command:=$command+$src+" "+$dst
>> 
>>   //SET ENVIRONMENT 
>> VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
>>   //SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
>> 
>> C_TEXT($in;$out;$err)
>> LAUNCH EXTERNAL PROCESS($command;$in;$out;$err)
> 
> if you are not sure how paths should be escaped
> take a look at the "PATH_Escape" method in this component:
> 
> https://github.com/miyako/4d-component-sublaunch
> 
> notice the rules to escape string (LEP_Escape) and path (PATH_Escape) 
> are slightly different.
> 
> P.S.
> 
> COPY DOCUMENT was updated in v14 to support the copying of folders.
> http://doc.4d.com/4Dv14/4D/14.4/COPY-DOCUMENT.301-2511853.en.html
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: DENIAL OF SERVICE ALERT―The Mcafee Problem

2018-04-07 Thread Chip Scheide via 4D_Tech
put an empty password on the zip file

> DENIAL OF SERVICE ALERT―The Mcafee Problem
> This Mac-based v13 database sends zipped Excel and PDF reports via 
> email… yesterday, the Excel reports (1.3 MB Zipped) started to fail. 
> The email is sent to the Windows user as expected but the attachment 
> is replaced with a text file (1_Warning.txt), with the following 
> message:
> 
> ===
> DENIAL OF SERVICE ALERT
> 
> A denial of service protection limit was exceeded. The file has been 
> removed.
> Context: ’order summary - march report.zip\order summary - march 
> report.xls'
> Reason: The data size limit was exceeded
> Limit: 20 MB
> Ticket Number : 0XXX-5ac5-3a6a-0001 (Ticket number altered)
> 
> 
> For further information, contact your system administrator. 
> Copyright 1999-2014 McAfee, Inc.
> All Rights Reserved.
> http://www.mcafee.com
> ===
> 
> What do you think is going on here?  
> 
> -The file size of the excel file is very small, about 2MB uncompressed.
> -The Copyright dates are unexpectedly old, the professional 
> client-side IT team is using the latest McAfee software and don’t 
> know where these old dates are coming from.
> -When all filtering and all virus protection is turned off on the 
> client PC, the problem remains.
> -When the report is sent to a gmail account the report is received 
> correctly. I think this proves this is not a 4D issue.
> 
> I appreciate your thoughts.
> 
> Robert
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

The Compiler is better in 16R

2018-04-07 Thread Kirk Brooks via 4D_Tech
So hot from the Summit I'm working with 16R and 17beta. I'm diving into
collections in a big way and have to say this is really, really cool.

But something I just noticed is how much better the compiler is in 16R. I
converted a large project to 16R to see how it works. One of the first
things I noticed were a number of issues flagged by the compiler that
haven't been flagged before. Curious, I thought. Several of the issues
looked like the conversion process may have corrupted the code since they
were obvious and never flagged before. For instance this line:

C_TEXT($procName)Partner_get_formInfo


That's a variable declaration followed by a method. No way that wasn't
caught before I thought.

I periodically dump text versions of methods from this database so I've got
copies to go back to. I found a copy of that method from 2015 with that
exact line of code in it which as been running since at least that time.

It wasn't all compiler declarations either. Some were simple grammatical
errors in a query string:

QUERY([PARTNERS]; & ; [PARTNERS]name_last=;$lastName;*)


Again, it's been there for years but the 16R compiler caught it. ​

I don't know what the overall impact of this means but it's a benefit for
me. ​

-- 
Kirk Brooks
San Francisco, CA
===

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

Re: Bug or feature?

2018-04-07 Thread Bernd Fröhlich via 4D_Tech
David Adams:

> If anyone can suggest why this might be happening, I'd love to hear about it.

If I understood your description correctly, then the code only blows up if you 
process lots of data and not if you test every piece of data individually.

If that is the case then I would guess there might be a memory leak somewhere.

Greetings from Germany,
Bernd Fröhlich
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Are you a subform guru? Test your knowledge with a quiz. Also, a listing of all 4D documents on subforms

2018-04-07 Thread Keisuke Miyako via 4D_Tech
I am not a guru, just a follower :)

> 3) When will the On Bound Variable Change event not happen when the Subform 
> Container variable changes?

When the widget does not exist (i.e. it is not on the current form).

> 4) When will OBJECT GET SUBFORM not return the form name set by OBJECT SET 
> SUBFORM?

In the same code sequence that you called O. SET SUBFORM, because the subform 
is only set at the end of the event cycle.
Events are executed in sequence for the same process, so you can not fire a new 
event before you complete the current event.
Setting a subform triggers a sequence of events, so by definition it is 
deferred until you complete the current event.

> 5) Which form events will be triggered by redisplaying a page with a subform?

On Load.

> 6) What happens when a subform is resized? How to manage it?

The resizing of a container subform "object" is equivalent to the resizing of 
the widget "form". So you need to follow 2 rules:

If you want automatic resize (grow, resize) to work inside your widget, your 
widget form's width/height must be the same as the container object's 
width/height.

If you want automatic resize (grow, resize) to work inside your widget, your 
widget must be on page 0 or 1. This is because the container object is part of 
the parent form and resized on all pages, but your widget can only process 
resize events on the current page because it only exists on the current page.

If you can't do either of the above, you should resize your widget by code.

> 7) Is the timer in SET TIMER associated with the process or the form?

No. Each form (parent, widget) has its own timer. I know a developer who has a 
subform inside a subform inside a subform and each have running timers. When 
the form is running, he can hardly type any text in the method editor. Bad idea.

> 8) When will On Activate not be triggered when a subform becomes active?

when the subform does not have focus on the parent form. On Activate for a 
widget is equivalent to On Getting Focus for its container in the parent form. 
Same relation between On Deactivate and On Losing Focus.

> 9) Besides using process variables (including sets and Named selections), how 
> can the subform interact in the parent form context?

I think a widget should never you process variables or anything with a scope 
wider than the current form.
The bound variable should be the only connection.
If you need to process complex information, consider using an object as the 
bound variable.
Using process variables in a widget is like using process variables in a 
subroutine.
It is bad practice, you should pass parameters.
The parameter of a widget is its bound variable.

> 3) A third issue is clarifying that OBJECT SET SUBFORM does not trigger an On 
> Load event in the subform: a) if you are on another page, or, b) it is 
> already being displayed.
> The Subform will NOT get an On Load if it is already being displayed, even if 
> OBJECT SET SUBFORM is called again.
> The Subform will get an On Bound Variable Change only if the subform 
> container variable changes while the subform is already being displayed.

I prefer to understand it like this: a widget (not the subform container, but 
the child form inside the container) only exists on the current page. and a 
form that does not exist can not run any events or execute any code.

Likewise, if you exit that page, the widget is destroyed, so you it will be 
recreated when you revisit that page and an On Load event would fire again. But 
the subform container is part of the parent form, which means the bound 
variable belongs to the parent form survives the page transition. So your 
widget's On Load code needs to differentiate the 1st On Load and subsequent On 
Loads, because you don't want to reinitialise the bound variable from inside 
every time you switch pages.

I struggle to understand why you would call O. SET SUBFORM when the subform is 
already set and expect an On Load event. On Load is fired when a widget is 
loaded, i.e. created, in other words when it comes into existence. That can be 
when the parent form is loaded and the  widget is on page 0 or 1, or every time 
the parent form switches to the page on which the subform is placed, or when O. 
SET SUBFORM is called for it to replace another widget (or no widget).




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

Re: Bug or feature?

2018-04-07 Thread Jeffrey Kain via 4D_Tech
This is what we do everywhere now. In our case, we're never gonna JSON Parse a 
longint, so we just wrapped it.


--
Jeffrey Kain
jeffrey.k...@gmail.com

> On Apr 5, 2018, at 7:39 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We have a ton of calls to *JSON Parse* that would
> need updates, if this is the case. Is there any  downside to specifying Is
> Object to be aware of?

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

Re: LAUNCH EXTERNAL PROCESS AND _4D_OPTION_STOP_TOKEN

2018-04-07 Thread Keisuke Miyako via 4D_Tech
Hello,

you can pass any number of arbitrary environment variables to your external 
process,
but of course it is the responsibility of the external application to read them 
and to actually use them.

"_4D_OPTION_STOP_TOKEN" is not a built-in reserved by 4D,
he was simply following the naming convention used by 4D for his custom 
parameters.

it will only make sense when used together with his script.

2018/04/07 9:15、David Garrard via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
From what I can tell using the " _4D_OPTION_STOP_TOKEN" as parameter one of
SET ENVIRONMENT VARIABLE is not functioning on Windows.
Does anyone have any proof that a stop token is ever created?  I have not
seen one.



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

LAUNCH EXTERNAL PROCESS AND _4D_OPTION_STOP_TOKEN

2018-04-07 Thread David Garrard via 4D_Tech
I am trying to get code that was posted in 2012 by Peter Lerch here:

 

http://4d.1045681.n5.nabble.com/Playing-nice-with-Launch-External-Process-td
5715184.html

 

to function on Windows 10 running 4D v16.3.

 

From what I can tell using the " _4D_OPTION_STOP_TOKEN" as parameter one of
SET ENVIRONMENT VARIABLE is not functioning on Windows.  

 

Does anyone have any proof that a stop token is ever created?  I have not
seen one.  

 

I wish to use the SET ENVIRONMENT
VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false") option to control
the locking up of 4D, but need a waiting system.  Peter's code looked
perfect the job, but maybe only functions on a Mac?

 

TIA,

 

David 

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