Query from two 4D application

2017-12-01 Thread stardata.info via 4D_Tech

Hi All,

I use 4D V15 on windows, and i need to do a query from one 4D 
application to another 4D application.

How i can do this?

Thanks
/Ferdinando/
**
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
**

Component works with compiled source but not as a component

2017-12-01 Thread Jim Dorrance via 4D_Tech
4D v15.5

EXECUTE METHOD($tCallbackMethod;*;$tSubformName;->$atSelectedRecordKeys)

On a contextual click in a component subform displayed in the host
database, the method $tCallbackMethod is to be executed in the context of
the host database.

When the component source runs interpreted, or the component source is run
compiled, everything runs as expected.

But after building a component using the Build Application menu, the
callback method receives $1 correctly, but $2 contains ->$, a pointer to $.

Anybody have any idea what could be happening?


-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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: New Log Parser says : this doesnt make sense

2017-12-01 Thread Justin Carr via 4D_Tech
On 1 Dec 2017, at 5:44 pm, Piotr Chabot Stadhouders via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Hi,
> 
> I am trying to use the new Log Parser, but without success
> 
> First of all, when I start logging I have 10 files of 10MB each within 1 
> minute, but that's not the problem (or is it)
> 
> After loading the log files, I open the Process with the most (+200.000) 
> debug entries.
> After a while a get into a TRACE at the following code :
> 
> (alOpType{$a}<0) // stack level increase // negative operation means closing 
> a previous call TRACE // this doesnt make sense
> 
> Does anybody know what this means?
> Does it point to a problem in My code, or it it a problem of the Log Parser 
> itself?
> 
> Gr,
> 
> Piotr

At a guess I'd say you the parser is reading a close operation for which it 
didn't find an open previously in the logs. This could easily happen if you 
don't have all of the log files for the whole debug session (and if you run 
logging for any length of time and care about disk space you probably won't), 
or if you started logging during an existing process and then started winding 
out of it. In either case it's not really an issue although I don't know if the 
new log parser will then have problems rendering the hierarchical list. The log 
parser I wrote caters for this situation by creating dummy opening calls at the 
appropriate depth(s). These will be given names like "Unlogged call at depth n".

cheers
J
**
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: CALL FORM and CALL WORKER

2017-12-01 Thread Piotr Chabot Stadhouders via 4D_Tech
In fact, the functionality explained below could be seen as setting an alarm
The alarm fires after a second (period of time)
In the meantime it can be reset to again wait for a period of time before it 
fires

Gr,

Piotr

Van: Piotr Chabot Stadhouders
Verzonden: vrijdag 1 december 2017 17:40
Aan: 4D iNug Technical <4d_tech@lists.4d.com>
Onderwerp: CALL FORM and CALL WORKER

Hi,

This is the first time I am going to use CALL FORM and CALL WORKER

I am going to convert a "Searchbox" mechanism where a user enters some 
characters and after 3 or more characters the search is started
This was done by a custom Timer mechanism implemented via a separate process 
and inter process arrays

I could call CALL FORM from within the "On After Keystroke" event of the search 
field, but there is a catch
The search isn't started right away after typing 3 characters, but waits for 1 
second to see if there are more characters typed

So, in the old way there is a method that adds a search request to the 
interprocess arrays and a process that handles the requests
However, after typing more characters within 1 second the request is reset and 
the 1 second waiting starts over again
If the 1 second passes the process calls the form with CALL PROCESS

It is this waiting part that is a problem for me to implement
I don't know how to do this with CALL FORM / WORKER

Does anybody know how to do this? Thomas Maul perhaps?

Gr,

Piotr

**
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: poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Kirk Brooks via 4D_Tech
Piotr,

On Fri, Dec 1, 2017 at 8:59 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> In fact our customers have big screens an want to see a lot of data at once
> They like how it is displayed right now.
> I have counted the listboxes displayed at once and the number is 10 !!
> So, after a lot of recoding they still have to wait for more than 5 seconds
>

​I may be missing the point but is it the data in the arrays changing? If
so you know you don't need to re-draw the listbox from scratch, just update
the arrays.


-- 
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: Component works with compiled source but not as a component

2017-12-01 Thread Kirk Brooks via 4D_Tech
Jim,
​
First, if $tCallbackMethod is a Host database method it must have the
Shared with host & component property set.

As I understand it EXECUTE METHOD runs in the context of the method called.
So if ​$tCallbackMethod is in the host it will run there. If it's in the
component it will run there.

​Since this is being called in the context of a component ​that means
$atSelectedRecordKeys
is in the component memory space and I don't think can be passed to a host
method as a reference if $tCallBackMethod is a host method. This would
account for it working when you run the component code itself but failing
when called as a component.

​Maybe put the array in a blob or c-obj and pass that?​


On Fri, Dec 1, 2017 at 1:32 AM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 4D v15.5
>
> EXECUTE METHOD($tCallbackMethod;*;$tSubformName;->$atSelectedRecordKeys)
>
> On a contextual click in a component subform displayed in the host
> database, the method $tCallbackMethod is to be executed in the context of
> the host database.
>
> When the component source runs interpreted, or the component source is run
> compiled, everything runs as expected.
>
> But after building a component using the Build Application menu, the
> callback method receives $1 correctly, but $2 contains ->$, a pointer to $.
>
> Anybody have any idea what could be happening?
>
> --
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
**

CALL FORM and CALL WORKER

2017-12-01 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi,

This is the first time I am going to use CALL FORM and CALL WORKER

I am going to convert a "Searchbox" mechanism where a user enters some 
characters and after 3 or more characters the search is started
This was done by a custom Timer mechanism implemented via a separate process 
and inter process arrays

I could call CALL FORM from within the "On After Keystroke" event of the search 
field, but there is a catch
The search isn't started right away after typing 3 characters, but waits for 1 
second to see if there are more characters typed

So, in the old way there is a method that adds a search request to the 
interprocess arrays and a process that handles the requests
However, after typing more characters within 1 second the request is reset and 
the 1 second waiting starts over again
If the 1 second passes the process calls the form with CALL PROCESS

It is this waiting part that is a problem for me to implement
I don't know how to do this with CALL FORM / WORKER

Does anybody know how to do this? Thomas Maul perhaps?

Gr,

Piotr

**
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: Component works with compiled source but not as a component

2017-12-01 Thread Jim Dorrance via 4D_Tech
$tCallbackMethod gets called in the context of the host database and $1 is
correct. It is just that $2 contains ->$

On Fri, Dec 1, 2017 at 9:23 PM, Jim Dorrance  wrote:

> Thanks for your input.
>
> On a contextual click on a svg area in a subform:
>
> $nArraySize:=*Size of array*($atSelectedRecordKeys)
>
> *If *($nArraySize>0)
>
> *EXECUTE METHOD*($tCallbackMethod;*;$tSubformName;->$atSelectedRecordKeys)
>
> *End if *
>
>
> And I works when the component runs interpreted or compiled. If I build a
> component, I get ->$ in the $tCallbackMethod, not a valid pointer.
>
>
> How else could I pass an array of record keys to the host?
>
>
> Jim
>
> On Fri, Dec 1, 2017 at 7:08 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> Jim,
>> ​
>> First, if $tCallbackMethod is a Host database method it must have the
>> Shared with host & component property set.
>>
>> As I understand it EXECUTE METHOD runs in the context of the method
>> called.
>> So if ​$tCallbackMethod is in the host it will run there. If it's in the
>> component it will run there.
>>
>> ​Since this is being called in the context of a component ​that means
>> $atSelectedRecordKeys
>> is in the component memory space and I don't think can be passed to a host
>> method as a reference if $tCallBackMethod is a host method. This would
>> account for it working when you run the component code itself but failing
>> when called as a component.
>>
>> ​Maybe put the array in a blob or c-obj and pass that?​
>>
>>
>> On Fri, Dec 1, 2017 at 1:32 AM, Jim Dorrance via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>
>> > 4D v15.5
>> >
>> > EXECUTE METHOD($tCallbackMethod;*;$tSubformName;->$atSelectedRecordK
>> eys)
>> >
>> > On a contextual click in a component subform displayed in the host
>> > database, the method $tCallbackMethod is to be executed in the context
>> of
>> > the host database.
>> >
>> > When the component source runs interpreted, or the component source is
>> run
>> > compiled, everything runs as expected.
>> >
>> > But after building a component using the Build Application menu, the
>> > callback method receives $1 correctly, but $2 contains ->$, a pointer
>> to $.
>> >
>> > Anybody have any idea what could be happening?
>> >
>> > --
>> 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
>> **
>
>
>
>
> --
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
>
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
>



-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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: Component works with compiled source but not as a component

2017-12-01 Thread Kirk Brooks via 4D_Tech
Jim,
I must be missing something - where is $2 defined?

On Fri, Dec 1, 2017 at 12:28 PM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> $tCallbackMethod gets called in the context of the host database and $1 is
> correct. It is just that $2 contains ->$
>
> On Fri, Dec 1, 2017 at 9:23 PM, Jim Dorrance 
> wrote:
>
> > Thanks for your input.
> >
> > On a contextual click on a svg area in a subform:
> >
> > $nArraySize:=*Size of array*($atSelectedRecordKeys)
> >
> > *If *($nArraySize>0)
> >
> > *EXECUTE METHOD*($tCallbackMethod;*;$tSubformName;->$
> atSelectedRecordKeys)
> >
> > *End if *
> >
> >
> > And I works when the component runs interpreted or compiled. If I build a
> > component, I get ->$ in the $tCallbackMethod, not a valid pointer.
> >
> >
> > How else could I pass an array of record keys to the host?
> >
> >
> > Jim
> >
> > On Fri, Dec 1, 2017 at 7:08 PM, Kirk Brooks via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Jim,
> >> ​
> >> First, if $tCallbackMethod is a Host database method it must have the
> >> Shared with host & component property set.
> >>
> >> As I understand it EXECUTE METHOD runs in the context of the method
> >> called.
> >> So if ​$tCallbackMethod is in the host it will run there. If it's in the
> >> component it will run there.
> >>
> >> ​Since this is being called in the context of a component ​that means
> >> $atSelectedRecordKeys
> >> is in the component memory space and I don't think can be passed to a
> host
> >> method as a reference if $tCallBackMethod is a host method. This would
> >> account for it working when you run the component code itself but
> failing
> >> when called as a component.
> >>
> >> ​Maybe put the array in a blob or c-obj and pass that?​
> >>
> >>
> >> On Fri, Dec 1, 2017 at 1:32 AM, Jim Dorrance via 4D_Tech <
> >> 4d_tech@lists.4d.com> wrote:
> >>
> >> > 4D v15.5
> >> >
> >> > EXECUTE METHOD($tCallbackMethod;*;$tSubformName;->$atSelectedRecordK
> >> eys)
> >> >
> >> > On a contextual click in a component subform displayed in the host
> >> > database, the method $tCallbackMethod is to be executed in the context
> >> of
> >> > the host database.
> >> >
> >> > When the component source runs interpreted, or the component source is
> >> run
> >> > compiled, everything runs as expected.
> >> >
> >> > But after building a component using the Build Application menu, the
> >> > callback method receives $1 correctly, but $2 contains ->$, a pointer
> >> to $.
> >> >
> >> > Anybody have any idea what could be happening?
> >> >
> >> > --
> >> 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
> >> **
> >
> >
> >
> >
> > --
> > Jim Dorrance
> > jim.dorra...@gmail.com
> > 4...@dorrance.eu
> > www.4d.dorrance.eu
> >
> > PS: If you know of anyone that needs an experienced 4D programmer to add
> > energy and experience to their team, please let me know. I have
> > experience in many areas. Reasonable rates. Remote or Paris only.
> >
>
>
>
> --
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
>
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
> **
> 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
> **
>



-- 
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: Quick Report Sort Field Names

2017-12-01 Thread BTB-Gmail via 4D_Tech
Jim,

Use the Set Field Titles command.  That will do what you need.

Thanks!

David Conley
By The Book, Inc.
Office: 815-234-7530
Direct Line: 815-406-5502
Fax: 815-234-7532
http://www.bythebook.com




> On Dec 1, 2017, at 2:27 PM, Jim Medlen via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 
> 
> Is there a way to tell the Quick Report Editor to sort the list of Field
> Names Alphabetically ?
> 








This email was sent to 4d_tech@lists.4d.com (mailto:4d_tech@lists.4d.com)
unsubscribe from this list 
(http://emailclicks.bythebook.com/track/unsub.php?u=30055319=22e9e4c1a4274f48bd7451010e1d2b21.6uKpduIsjJ%2FEqVQ1r%2BdLr66Tu1w%3D=https%3A%2F%2Fmandrillapp.com%2Funsub%3Fmd_email%3D4d_tech%2540lists.4d.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: Quick Report Sort Field Names

2017-12-01 Thread Arnaud de Montard via 4D_Tech

> Le 1 déc. 2017 à 21:27, Jim Medlen via 4D_Tech <4d_tech@lists.4d.com> a écrit 
> :
> 
> 
> Is there a way to tell the Quick Report Editor to sort the list of Field
> Names Alphabetically ?

There is  ;-) 
See here:


-- 
Arnaud de Montard 


**
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: Component works with compiled source but not as a component

2017-12-01 Thread Timothy Penner via 4D_Tech
This thread sounds familiar...  Maybe the answer is already posted:
http://4d.1045681.n5.nabble.com/Passing-var-from-component-to-host-td5737479.html

http://forums.4d.com/Post/FR/16238062/1/16238063#16238063

http://livedoc.4d.com/4Dv16.1/help/Title/en/page1274.html#516584
" The component architecture allows the coexistence, within the same 
interpreted database, of both interpreted and compiled components (conversely, 
only compiled components can be used in a compiled database). In order to use 
pointers in this case, you must respect the following principle: the 
interpreter can unpoint a pointer built in compiled mode; however, in compiled 
mode, you cannot unpoint a pointer built in interpreted mode. "

Hope that helps,

-Tim




**
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: poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Tim Nevels via 4D_Tech
On Dec 1, 2017, at 2:00 PM,Piotr Chabot Stadhouders wrote:

> But, bottom line, we are skipping the fact that still the command LISTBOX 
> INSERT COLUMN is very slow compared to all other commands
> And we wouldn't probably having this discussion if it was executed as fast as 
> the other commands

There is an old saying where a man goes to the doctor and says “when I move my 
arm like this it hurts, can you fix this” and the doctor replies “yes, don’t 
move your arm like that”. :)

Is there a reason you MUST call LISTBOX INSERT COLUMN or is it just the way you 
have designed the form and your coding style. I know a lot of people think it 
is the best way to program to build all your list boxes programmatically. Do it 
all with code and they have a dozen methods that do all the work. It’s a 
programming style.

The other option is to define your list boxes with the form editor defining all 
the columns and properties. Then when the form is loaded all that column 
definition and insertion is eliminated. That is my personal programming 
preference. 

If some of your list boxes are used for several purposes you could also create 
multiple list boxes that are stacked on top of each other, each setup exactly 
how you need it. Then you show/hide the ones you need as appropriate.

I know this is probably not what you want to hear, but if you are determined to 
cut down on load and display time, and you have found LISTBOX INSERT COLUMN is 
causing issues, you only have 2 choices:

1. Wait for 4D to make a change to fix this (who knows if/when that would 
happen)
2. Don’t use LISTBOX INSERT COLUMN

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.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: Change field type programmatically?

2017-12-01 Thread Pat Bensky via 4D_Tech
Hi Olivier,
Good point ... that will ease the pain somewhat!
Pat

On 1 December 2017 at 13:42, Olivier Deschanels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hello,
>
> Just in case …
>
> You can select several fields in the structure window and change their
> type through a right clic. Even if the fields are in different tables.
>
> Regards,
>
> Olivier
>
>
>
>
> > Le 1 déc. 2017 à 14:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a
> écrit :
> >
> > Using v16:
> > I have a large number of fields (hundreds) that I want to change from
> > String to Text. Is there any way to do this programmatically? I thought I
> > might be able to do it via SQL commands, but apparently 4D doesn't
> support
> > the ALTER FIELD function.
> > I'd prefer not to spend the rest of the day changing them al manually :)
> >
> > Pat
> >
> > --
> > *
> > CatBase - Top Dog in Data Publishing
> > tel: +44 (0) 207 118 7889
> > w: http://www.catbase.com
> > skype: pat.bensky
> > *
> > **
> > 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
> > **
>
> **
> 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
> **




-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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
**

bad code does bad things

2017-12-01 Thread Kirk Brooks via 4D_Tech
Miyako wrote that recently in a response to a question about a plugin and
what's expected. This is one of those things that needs to be written on
the wall next to "Think".

I googled the phrase because - well, of course I would.

This article

has a list of 10 things that lead to bad code. Many are applicable in 4D
land but this one really resonated with me:

Legendary programmer Donald Knuth once said, "Programmers waste enormous
amounts of time thinking about, or worrying about, the speed of noncritical
parts of their programs, and these attempts at efficiency actually have a
strong negative impact when debugging and maintenance are considered."

​This article  in
Codeburst says much the same but with more detail. ​It's also got a link to
a nice ReadMe template. Top takeaway -

Good code comments explain why things are done not what is done.


​Teambeacon
 has
a list of 35 habits that ​"make your code smell". #3 is about optimizations
(again) and quotes Knuth (again). Bottom line:

Improving the way you work through habits is a great way to avoid having to
think too much about every single situation. Once you’ve assimilated a good
way of doing something, it becomes effortless.

​Finally I'll cite this one

by Codementor which makes it more personal by looking at good vs bad
developers. I think all of us will recognize some part of ourselves in
there. I like the metric for determining code quality:

 WTFs/minute.


​OK, back to work cowboy. ​

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

Change field type programmatically?

2017-12-01 Thread Pat Bensky via 4D_Tech
Using v16:
I have a large number of fields (hundreds) that I want to change from
String to Text. Is there any way to do this programmatically? I thought I
might be able to do it via SQL commands, but apparently 4D doesn't support
the ALTER FIELD function.
I'd prefer not to spend the rest of the day changing them al manually :)

Pat

-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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: Change field type programmatically?

2017-12-01 Thread Olivier Deschanels via 4D_Tech
Hello,

Just in case …

You can select several fields in the structure window and change their type 
through a right clic. Even if the fields are in different tables.

Regards,

Olivier




> Le 1 déc. 2017 à 14:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a écrit 
> :
>
> Using v16:
> I have a large number of fields (hundreds) that I want to change from
> String to Text. Is there any way to do this programmatically? I thought I
> might be able to do it via SQL commands, but apparently 4D doesn't support
> the ALTER FIELD function.
> I'd prefer not to spend the rest of the day changing them al manually :)
>
> Pat
>
> --
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 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
> **

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

poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi,

In search of a performance problem in 1 of our forms I am asking for some 
advice.

I have succeeded in analyzing 10 4DDebuglog.txt files (using an Oracle DB by 
the way) and have come to following :
The problem is with the execution time of the "LISTBOX INSERT COLUMN"
The performance of this command is very poor compared to other commands.
In fact, it takes about 10 times longer than every other 4D command in the logs

The LISTBOX INSERT COLUMN command takes on average 0.0286 seconds to complete, 
tested on a Intel Core i7-4710MQ 2.50GHz laptop
No big deal you could say, but for a couple of our forms it IS a big deal
We have a form with 27 listboxes on it, all dynamically build, with a total of 
477 columns

So 477 * 0.0286 seconds takes up 13.6422 seconds
This is all done in the On Load event so the user must wait terribly long for 
the form to show up on the screen

My question :
Do you think this performance of LISTBOX INSERT COLUMN is acceptable / normal 
behavior?
Can someone confirm this performance?
Is there something, other than putting listboxes on other pages, I can do about 
this?

Thanks in advance,

Piotr

**
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: poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Chip Scheide via 4D_Tech
Piotr

recode this!
On Fri, 1 Dec 2017 14:49:11 +, Piotr Chabot Stadhouders via 4D_Tech 
wrote:
> 
> No big deal you could say, but for a couple of our forms it IS a big deal
> We have a form with 27 listboxes on it, all dynamically build, with a 
> total of 477 columns
recode this - I can't say this enough!


I do not know what your interface looks like, however, I find it 
difficult to believe that more then 2 or 4 list boxes are on screen at 
one time, maybe not even that.

Load the list boxes as you go. Depending on your usage, you might only 
need 1, or 4 list boxes not 27(!)

Basic concept (assume 1 listbox on screen at a time - modify to meet 
your specific on screen needs, the base form has ONE listbox, with no 
columns)
On load 
 - determine what is being displayed (which table/data set)
 - setup the listbox for this data

during execution of the form.
repeat as needed
 - user changes 'page', using a tab control (or whatever user does to 
change displayed data)
   - determine which data set is needed based on user 'request' (above 
step) 
   - (re)build the listbox for this new data set - using the SAME 
listbox <-- this is the key... the SAME LISTBOX

using this approach you should not need to build/load more list boxes 
then are currently on screen.
In addition to this you can reduce the form's complexity by removing 
20+ list boxes, this in it self will help the form load faster, and use 
a far smaller memory footprint.
Reducing your form complexity may increase code complexity - but the 
increase will be a LOT less then the decrease in your form's complexity.

As example:
- Listing forms : for my systems I use a single form/listbox (selection 
based) for record listings. It is built based on the current table to 
be displayed. The base listbox has NO columns in it. The listing form 
is a project form, and in a few instances is used as a parent form for 
inheritance (when additional functionality is needed in addition to the 
standard functions provided). 

- Entry forms : many of the entry forms in my systems display related 
data (i.e. Invoice [parent], and Invoice items [children in listbox]). 
Some forms have as many as 11 "pages" of related information to be 
displayed, controlled by a Tab Control (not actual form pages). These 
entry forms have 1 listbox on page 0 (zero), so the form has 2 pages, 
page 0 (zero) and page 1.
When the form loads, the Tab control is used to determine what data to 
display, and the listbox is built appropriately. During form execution, 
when the user selects a specific Tab in the control, the SAME listbox 
is re-built to display that specific information.  

In both of the instances (examples) above - interpretedly, in C/S, 
there is no noticeable time required to build the list boxes, 
regardless of how fast the user changes tabs. 

If you want some example code on how to do this, I can provide an 
example database (v11 or v13 I forget which) 
Actually, if anyone wants the demo - feel free to ask off list.
Note: the demo stores data for building the list boxes in 3 tables in 
the database, and note THIS IS NOT a component, nor does it use 
'widgets' (subforms <-- really bad naming convention). The 3 tables 
are: Listbox setup data ([table], dimensions, listing or entry listbox 
etc), Column setup data (field or calculation info, order, formatting, 
enterable, visible etc), and query (specifics {fields, relations, field 
title to show users, etc} for the [table] displayed using an iTunes 
like search object)


---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi Chip,

Thanks for your quick response, it is much appreciated

First of all you are right that I could recode some parts and is also for other 
reasons sometimes no bad idea at all

> Load the list boxes as you go. Depending on your usage, you might only need 1,
> or 4 list boxes not 27(!)

In fact our customers have big screens an want to see a lot of data at once
They like how it is displayed right now.
I have counted the listboxes displayed at once and the number is 10 !!
So, after a lot of recoding they still have to wait for more than 5 seconds 


> When the form loads, the Tab control is used to determine what data to
> display, and the listbox is built appropriately

I know I could do something like this, and maybe there is no escaping of doing 
this
I also read about a way to create subforms and use OBJECT SET SUBFORM to 
dynamically change the subform


But, bottom line, we are skipping the fact that still the command LISTBOX 
INSERT COLUMN is very slow compared to all other commands
And we wouldn't probably having this discussion if it was executed as fast as 
the other commands


Again, thanks for your response,

Piotr


> -Oorspronkelijk bericht-
> Van: Chip Scheide [mailto:4d_o...@pghrepository.org]
> Verzonden: vrijdag 1 december 2017 16:35
> Aan: 4D iNug Technical <4d_tech@lists.4d.com>
> CC: Piotr Chabot Stadhouders 
> Onderwerp: Re: poor performance LISTBOX INSERT COLUMN
> 
> Piotr
> 
> recode this!
> On Fri, 1 Dec 2017 14:49:11 +, Piotr Chabot Stadhouders via 4D_Tech
> wrote:
> >
> > No big deal you could say, but for a couple of our forms it IS a big
> > deal We have a form with 27 listboxes on it, all dynamically build,
> > with a total of 477 columns
> recode this - I can't say this enough!
> 
> 
> I do not know what your interface looks like, however, I find it difficult to
> believe that more then 2 or 4 list boxes are on screen at one time, maybe not
> even that.
> 
> Load the list boxes as you go. Depending on your usage, you might only need 1,
> or 4 list boxes not 27(!)
> 
> Basic concept (assume 1 listbox on screen at a time - modify to meet your
> specific on screen needs, the base form has ONE listbox, with no
> columns)
> On load
>  - determine what is being displayed (which table/data set)
>  - setup the listbox for this data
> 
> during execution of the form.
> repeat as needed
>  - user changes 'page', using a tab control (or whatever user does to change
> displayed data)
>- determine which data set is needed based on user 'request' (above
> step)
>- (re)build the listbox for this new data set - using the SAME listbox <-- 
> this is
> the key... the SAME LISTBOX
> 
> using this approach you should not need to build/load more list boxes then are
> currently on screen.
> In addition to this you can reduce the form's complexity by removing
> 20+ list boxes, this in it self will help the form load faster, and use
> a far smaller memory footprint.
> Reducing your form complexity may increase code complexity - but the
> increase will be a LOT less then the decrease in your form's complexity.
> 
> As example:
> - Listing forms : for my systems I use a single form/listbox (selection
> based) for record listings. It is built based on the current table to be 
> displayed.
> The base listbox has NO columns in it. The listing form is a project form, 
> and in
> a few instances is used as a parent form for inheritance (when additional
> functionality is needed in addition to the standard functions provided).
> 
> - Entry forms : many of the entry forms in my systems display related data 
> (i.e.
> Invoice [parent], and Invoice items [children in listbox]).
> Some forms have as many as 11 "pages" of related information to be displayed,
> controlled by a Tab Control (not actual form pages). These entry forms have 1
> listbox on page 0 (zero), so the form has 2 pages, page 0 (zero) and page 1.
> When the form loads, the Tab control is used to determine what data to
> display, and the listbox is built appropriately. During form execution, when 
> the
> user selects a specific Tab in the control, the SAME listbox is re-built to 
> display
> that specific information.
> 
> In both of the instances (examples) above - interpretedly, in C/S, there is no
> noticeable time required to build the list boxes, regardless of how fast the 
> user
> changes tabs.
> 
> If you want some example code on how to do this, I can provide an example
> database (v11 or v13 I forget which) Actually, if anyone wants the demo - feel
> free to ask off list.
> Note: the demo stores data for building the list boxes in 3 tables in the
> database, and note THIS IS NOT a component, nor does it use 'widgets'
> (subforms <-- really bad naming convention). The 3 tables
> are: Listbox setup data ([table], dimensions, listing or entry listbox etc), 
> Column
> setup data (field or calculation info, order, formatting, enterable, visible 
> etc),
> and query (specifics {fields, 

RE: New Log Parser says : this doesnt make sense

2017-12-01 Thread Timothy Penner via 4D_Tech
Hi Piotr,

Justin is correct on the reason behind the error. I meant to remove the TRACE 
commands before releasing it, I must have missed that, sorry. The log parser 
should still build the hierarchy. I will see about releasing an update with the 
TRACE removed... For now just comment out the trace command.

Kind Regards,

Tim PENNER



**
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: poor performance LISTBOX INSERT COLUMN

2017-12-01 Thread Arnaud de Montard via 4D_Tech

> Le 1 déc. 2017 à 15:49, Piotr Chabot Stadhouders via 4D_Tech 
> <4d_tech@lists.4d.com> a écrit :
> 
> Hi,
> 
> In search of a performance problem in 1 of our forms I am asking for some 
> advice.
> 
> I have succeeded in analyzing 10 4DDebuglog.txt files (using an Oracle DB by 
> the way) and have come to following :
> The problem is with the execution time of the "LISTBOX INSERT COLUMN"

array or selection listbox?

-- 
Arnaud 



**
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: Component works with compiled source but not as a component

2017-12-01 Thread Jim Dorrance via 4D_Tech
Thanks, I'll try stuffing the array into a blob, and passing the blob.

On Fri, Dec 1, 2017 at 9:44 PM, Timothy Penner via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> This thread sounds familiar...  Maybe the answer is already posted:
> http://4d.1045681.n5.nabble.com/Passing-var-from-
> component-to-host-td5737479.html
>
> http://forums.4d.com/Post/FR/16238062/1/16238063#16238063
>
> http://livedoc.4d.com/4Dv16.1/help/Title/en/page1274.html#516584
> " The component architecture allows the coexistence, within the same
> interpreted database, of both interpreted and compiled components
> (conversely, only compiled components can be used in a compiled database).
> In order to use pointers in this case, you must respect the following
> principle: the interpreter can unpoint a pointer built in compiled mode;
> however, in compiled mode, you cannot unpoint a pointer built in
> interpreted mode. "
>
> Hope that helps,
>
> -Tim
>
>
>
>
> **
> 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
> **
>



-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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
**