Re: How to show / hide all on Property List in v16?

2017-08-14 Thread Kirk Brooks via 4D_Tech
Um - does this mean no one else is seeing this behavior?

Any thoughts about why it is happening on my machines?

On Thu, Aug 10, 2017 at 3:34 PM, Kirk Brooks  wrote:

> In prior versions when working with a form and the Property List is
> displayed I could show/hide all panes on the list by holding the Control
> (not the Command) key and clicking on one of the pane triangles. This
> doesn't work for me in v16.
>
> I've tried on two different Macs, one running Sierra and the other
> Yosemite. And I've tried every combination of modifiers I can think of.
>
> I believe I asked about this before. Is there some option I may have
> either set or unset to cause this? Really annoying.
>
> Thanks
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
>
> *- Edmund Burke*
>
>


-- 
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: Get Info from a 4D Client - aka Interclient communication

2017-08-14 Thread Kirk Brooks via 4D_Tech
Randy,
You could have a background process on 4D server that periodically pings
the web server. Or makes an http call to it. I use a service to monitor
server status that relies on this approach. This will also raise a flag if
the server is un-available for some reason even if it is running.

​But if 4D server is walled off from the internet I'd use Execute on client
and Web is server running
.
But that requires you to know which client is running it. Maybe there are
more than one? Using a table, like you're doing already, isn't such a
terrible idea. But you could also do the same thing with variables and
avoid the SET VARIABLE issues by using execute on server.

Let's say this loop is running in a background process on a client:

$webInfo:=JSON Parse("{}")
OB SET($webInfo;"machine";Current machine)

While(not($done))

OB SET($webInfo;"timestamp";Timestamp)
OB SET($webInfo;"running";WEB Is server running)

 If(WEB Is server running)// optional info

... // IP, # processes, ...

 End if


WEB_update_monitor($webInfo)

DELAY PROCESS(Current process;300)

End while


WEB_update_monitor executes on server :

// WEB_update_monitor
<>webInfo_obj:=$1


And on the server you have some monitor process running that looks at
<>webInfo_obj and acts accordingly.

If more than one client might be involved I'd use an object array but the
mechanics are the same.


On Sun, Aug 13, 2017 at 6:18 PM, Randy Engle via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> In this particular case, I've got the web server running on the client,
> and I want to know if the web server is in fact running.
>
> --
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
**

How to show / hide all on Property List in v16?

2017-08-10 Thread Kirk Brooks via 4D_Tech
In prior versions when working with a form and the Property List is
displayed I could show/hide all panes on the list by holding the Control
(not the Command) key and clicking on one of the pane triangles. This
doesn't work for me in v16.

I've tried on two different Macs, one running Sierra and the other
Yosemite. And I've tried every combination of modifiers I can think of.

I believe I asked about this before. Is there some option I may have either
set or unset to cause this? Really annoying.

Thanks

-- 
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: SEND / RECEIVE RECORD questions

2017-08-10 Thread Kirk Brooks via 4D_Tech
Miyako,
Thanks for the reassurance. Does the matching work based on the table/field
names or numbers?

On Thu, Aug 10, 2017 at 2:05 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> RECEIVE R. command is capable of processing records sent from pre-v11
> versions,
> it looks at the header and converts ANSI to Unicode text as necessary.
>
> > 2017/08/11 5:51、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> > And what about changes across 4D versions? Like attempting to RECEIVE
> > RECORD in v13+ from a file created by v11 or v2004?
>
>
>
>
> **
> 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
**

SEND / RECEIVE RECORD questions

2017-08-10 Thread Kirk Brooks via 4D_Tech
Hi folks,
I have never really used SEND RECORD and RECEIVE RECORD. I get the theory
of it and the docs explain the mechanism. I'm wondering what happens when
you attempt to use them and the structures have changed? Or tables or
fields were re-named?

And what about changes across 4D versions? Like attempting to RECEIVE
RECORD in v13+ from a file created by v11 or v2004?

I'm also assuming the tables are matched by the "new" UUID instead of table
name - yes? Or is it table number since I'm not sure there was a UUID when
SEND RECORD was created.

And maybe I'm overthinking the whole issue. Anyway, I would appreciate some
insight from those of you who have used these commands a lot over the
years.


-- 
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: Method Header Strategies

2017-08-09 Thread Kirk Brooks via 4D_Tech
I tried using that SQL trick for a while and ultimately abandoned it. I
really rely on the headers I create to remind me of what the method does
and what the params are at the top. All the long discussion, if any, comes
after that. I've always heard it is all stripped out when compiled so I
just don't worry about it.

Sometimes I use If(True) statements just to make the code easier to manage.
And I like break up long Case of statements with :(false) // ** some
comment or header here **

It's purely cosmetic but I like it.

On Wed, Aug 9, 2017 at 3:11 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> From the conversation about converting images we saw this method header:
>
>
> If (True)
> If (False)
> Begin SQL
> /*
> Name: UTIL_ConvertPICTs
> Path: UTIL_ConvertPICTs
>
> Purpose: Convert all PICT formatted images in the
> Picture Libraray to .PNG images
>
> The v13.2 or later 4D Pack Plugin must be installed to use this
> method
>
> */
> End SQL
> End if
> C_TEXT($MethodName_T)
> $MethodName_T:=Current method name
>  //= Declare Variables
> ==
>  //method_parameters_declarations
>  //--
> --
>  //method_wide_constants_declarations
>  //--
> --
>  //local_variable_declarations
> C_LONGINT($Ndx;$SOA;$RIS;$PictRef_L)
> C_TEXT($PictName_T)
> C_PICTURE($Pict_G)
> C_POINTER($Pict_P)
> End if
>
> I can suss two things out of this. One is the  "If (false)" bit at the top
> so you can do all kinds of things that break cross-referencing in the name
> of not running code.
>
> In this case it’s ‘protecting’ a Begin/End SQL which is being used because
> the construct allows you just type things with out having to comment your
> comments out.
>
> But, why wrap the whole thing in if (True)?
>
>
> **
> 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: JSON Tools Was: Re: C-objects and memory use

2017-08-08 Thread Kirk Brooks via 4D_Tech
Rick,
You have to use the JSON PARSE ARRAY command.

http://doc.4d.com/4Dv15/4D/15.4/JSON-PARSE-ARRAY.301-3274446.en.html

I wrote a wrapper for JSON strings to look at the first char and then use
the appropriate method.

This is one place where NTK is more convenient since it makes that
adjustment automatically. Which it can do since it simply returns a handle
to the newly created JSON object. 4D can't because it goes ahead and parses
the string into a 4D typed var.

On Tue, Aug 8, 2017 at 1:42 PM, Rick Hazey via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> It’s been a long time since I’ve used 4D and JSON but as I recall one
> problem was the inability to parse JSON where the top level is an array
> instead of an object. IOW, if your JSON looked like this:
> [ 1, 2, 3 ]
>
> 4D couldn’t parse it.
>
-- 
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: External data storage question

2017-08-04 Thread Kirk Brooks via 4D_Tech
John,

On Fri, Aug 4, 2017 at 1:36 AM, John Baughman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 3. Click the save button. The table trigger’s on saving new record event
> does the following...
> a. Saves the picture to my documents folder with WRITE PICTURE FILE
> b. Sets the external data path with SET EXTERNAL DATA PATH


​I use triggers ​a lot and I avoid actions this involved in them. I view
triggers as a way to check the internal consistency of the record and
enforce data rules. At most I'll do things like apply timestamps and
similar. Triggers need to be very quick. Remember that a trigger is a
function and returning anything other than zero causes the record not to
save or delete.

​Also keep in mind triggers always run on the server. So doing something
like file manipulation is problematic and you can't rely on IP vars.

​I'd move the file manipulation back to the form context. No idea if it
will matter in this specific instance​ but it will be easier to get the
user involved if something isn't working as expected.


-- 
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: UUID vs Longint primary key

2017-08-04 Thread Kirk Brooks via 4D_Tech
I'll add my vote to Jody's approach.

I prefer UUIDs for primary keys for all the reasons mentioned.
Having a longint index field is useful as well but for different reasons as
Jody explains. My most common use is to be able to quickly sort a table in
the order records were created. And it is superior for referencing records
- attempting to type a UUID is not something one wants to do.

On Fri, Aug 4, 2017 at 6:51 AM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On another note, we assign a counter ourselves (not auto generated). There
> are times where we reset counters and being able to do that is great.
>

Resetting the counter can be done with ​SET DATABASE PARAMETER ( [Table] ;
Table sequence number ; value ). I haven't had any issues with bad sequence
numbers since about vers 6.

-- 
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: Is there a way to put a separator line in a macro list?

2017-08-02 Thread Kirk Brooks via 4D_Tech
I've never tested it but has never failed to reload for me - or throw an
error.

On Wed, Aug 2, 2017 at 3:04 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On more macro question, it seems that the file reloads after editing as
> soon as you switch back to 4D. Is this a reliable feature, or am I just
> getting lucky? Images in the Resources folder work this way, custom
> constants do not...so I ask.
> **
> 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: Is there a way to put a separator line in a macro list?

2017-08-02 Thread Kirk Brooks via 4D_Tech
  

On Wed, Aug 2, 2017 at 3:02 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Just learned by example about how cool it is to call a custom method from a
> macro. So cool.
>
> Anyway, now that I've got religion about macros, I'd also like to get
> organized. With that in mind, I'd like to group them visually. Is there a
> way to put an inactive line-break in the list of macros? I didn't see a
> mention of such a thing in the manual:
>
> http://doc.4d.com/4Dv16/4D/16.1/Creating-and-using-macros.
> 300-3373341.en.html
>
> Also, the little gear thingy in the method toolbar - if seems like it
> remembers the last selected macro and runs it when you click. Is that a
> reliable feature? I like it, so I hope so.
>
> Thanks
> **
> 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: Restricting a query

2017-07-31 Thread Kirk Brooks via 4D_Tech
Jarosz,
For that you'll want to build your own query editor. To achieve that sort
of separation of data you'll need to be careful that all queries and
selections created by relations are segregated by client.

On Mon, Jul 31, 2017 at 11:34 AM, jarosz via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have a table which contains records for 10 different clients.
> I'd like to give a client the ability to search the table for only his
> records and not be able to see any of the other clients' records.
>
> Is it possible to do this using the standard 4D Query editor by always
> applying an additional search criteria eg clientID=xxx?
>
> Or do I need to build my own custom query editor?
> I'm using 4D 15.4.
>
> I'd be interested to hear how others have approached this...
>
> Many thanks
>
> Michael Jarosz
>
>
>
>
> --
> View this message in context: http://4d.1045681.n5.nabble.
> com/Restricting-a-query-tp5753437.html
> Sent from the 4D Tech mailing list archive at Nabble.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
> **




-- 
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: Recommendations?

2017-07-30 Thread Kirk Brooks via 4D_Tech
Ken,
Post about what you decide to do.

BTW - I looked at a couple of the vendors I mentioned not sending PDFs -
they were generated by NetSuite. Just saying.

On Sun, Jul 30, 2017 at 4:10 PM, Kenneth Geiger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> Yes, this helps immensely! Time to start prototyping.
>
> Thanks,
>
> Ken
>
> On Sun, Jul 30, 2017 at 4:41 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Hi Ken,
> > I've got some experience with this sort of thing and have a number of
> > thoughts and suggestions - in no particular order.
> >
> > Before starting I'm assuming we can be certain all invoices to be
> processed
> > are already reviewed and OKed by a human somewhere.
> >
> > #1) the PDFs. Potential for huge headaches. We get invoices from several
> > vendors by email which are simply emails with the invoice data. There's
> no
> > rule that says "invoice" = PDF. You could render a very nice html
> document
> > for the invoice along with a perfectly serviceable text representation
> and
> > be done with it. The crucial parts are the customer/vendor, date, invoice
> > number, terms, and amount. Maybe the PO. If that's on a piece of paper
> it's
> > an invoice. The rest makes it look nice.
> >
> > If you don't do that use a scheme for producing PDFs that doesn't depend
> on
> > a print driver. Rule out MS PDF printer, PDFCreator et al. Spend the $$
> and
> > get Rob Laveaux's plugin or download the presentation from a couple of
> > years ago on making your own in native 4D (I did this) but you must have
> > something that runs in code without OS print resources.
> >
> > #2) dedicated email account. I really recommend your client have an
> account
> > only the database will use. Humans can check it but create a special one
> > for 4D.
> >
> > #3) I like having two tables for these operations: [Email_que] and
> > [Email_log]. You could use one table with a status flag too, this is my
> > personal pref. I build the emails into a record in the que. Once they are
> > all ready I loop through those records and send them. You can link these
> > back to the specific invoice to provide a good audit trail.
> >
> > If they send successfully I move that info to the log (I don't bother
> > saving things like the attachments but you may want to) and delete the
> > record. If it doesn't go I log the error in the Email_que and after some
> > number of attempts it falls out of the loop. Most common is a bad email
> > address but it can be other things.
> >
> > A real key I found is to really break the operation in its discrete
> parts.
> > So building the email record is totally complete before dealing with
> > sending. Building the invoice document is totally separate from anything
> > else. The email loop is only dealing with sending (or not) an email.
> Makes
> > life much easier.
> >
> > You mention doing batches and this fits right into that. You after the
> > sending loop you can report the errors or simply add them to the print
> que.
> >
> > You can get more sophisticated by having your app check the mail box. I
> > wouldn't worry with that right away but pretty soon it may be worthwhile.
> >
> > The other thing this will bring up is customers being able to pay on
> line.
> > If you all haven't looked at that yet this may start the conversation.
> >
> > Does this help?
> >
> > On Sun, Jul 30, 2017 at 1:07 PM, Kenneth Geiger via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> > > A typical batch of invoices (run monthly) is between 100 and 200
> > individual
> > > invoices. Any recommended plugins and/or suggestions, recommendations,
> > or a
> > > direction in which to head would be most appreciated!
> > >
> > >
> >
> >
> > --
> > 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
> > **
> >
> **
> 4D 

Re: Recommendations?

2017-07-30 Thread Kirk Brooks via 4D_Tech
Hi Ken,
I've got some experience with this sort of thing and have a number of
thoughts and suggestions - in no particular order.

Before starting I'm assuming we can be certain all invoices to be processed
are already reviewed and OKed by a human somewhere.

#1) the PDFs. Potential for huge headaches. We get invoices from several
vendors by email which are simply emails with the invoice data. There's no
rule that says "invoice" = PDF. You could render a very nice html document
for the invoice along with a perfectly serviceable text representation and
be done with it. The crucial parts are the customer/vendor, date, invoice
number, terms, and amount. Maybe the PO. If that's on a piece of paper it's
an invoice. The rest makes it look nice.

If you don't do that use a scheme for producing PDFs that doesn't depend on
a print driver. Rule out MS PDF printer, PDFCreator et al. Spend the $$ and
get Rob Laveaux's plugin or download the presentation from a couple of
years ago on making your own in native 4D (I did this) but you must have
something that runs in code without OS print resources.

#2) dedicated email account. I really recommend your client have an account
only the database will use. Humans can check it but create a special one
for 4D.

#3) I like having two tables for these operations: [Email_que] and
[Email_log]. You could use one table with a status flag too, this is my
personal pref. I build the emails into a record in the que. Once they are
all ready I loop through those records and send them. You can link these
back to the specific invoice to provide a good audit trail.

If they send successfully I move that info to the log (I don't bother
saving things like the attachments but you may want to) and delete the
record. If it doesn't go I log the error in the Email_que and after some
number of attempts it falls out of the loop. Most common is a bad email
address but it can be other things.

A real key I found is to really break the operation in its discrete parts.
So building the email record is totally complete before dealing with
sending. Building the invoice document is totally separate from anything
else. The email loop is only dealing with sending (or not) an email. Makes
life much easier.

You mention doing batches and this fits right into that. You after the
sending loop you can report the errors or simply add them to the print que.

You can get more sophisticated by having your app check the mail box. I
wouldn't worry with that right away but pretty soon it may be worthwhile.

The other thing this will bring up is customers being able to pay on line.
If you all haven't looked at that yet this may start the conversation.

Does this help?

On Sun, Jul 30, 2017 at 1:07 PM, Kenneth Geiger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> A typical batch of invoices (run monthly) is between 100 and 200 individual
> invoices. Any recommended plugins and/or suggestions, recommendations, or a
> direction in which to head would be most appreciated!
>
>


-- 
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: "Inspect Element" in 4D web area

2017-07-28 Thread Kirk Brooks via 4D_Tech
Jeff,
Web area set preference is what you want -
http://doc.4d.com/4Dv16R4/4D/16-R4/WA-SET-PREFERENCE.301-3317027.en.html



On Fri, Jul 28, 2017 at 8:12 AM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Is there a way to turn off the "Inspect Element" contextual menu item in a
> 4D v15 web area (Mac)? The "Context Menu" property doesn't seem to do
> anything.
>
> Thanks...
> **
> 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: 4D Forums no longer accessible -- too many redirects

2017-07-27 Thread Kirk Brooks via 4D_Tech
I was just able to get in and 'migrate' my account by following a link to
an old post which took me in without trying to login. Then I read the
banner and took the suggestion to click the LogIn link which redirected me
to the Partner Login screen. After that I was redirected to a simple little
form that let me enter my old user name and password.

You might try with a browser you don't use often to avoid any auto-sign on
stuff that might be getting in the way.

On Thu, Jul 27, 2017 at 8:30 AM, Stephen J. Orth via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> This appears to have broken today, as all I get is a 500 Internal error.
>
>
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Spencer
> Hinsdale via 4D_Tech
> Sent: Thursday, July 27, 2017 10:19 AM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Spencer Hinsdale 
> Subject: Re: 4D Forums no longer accessible -- too many redirects
>
>
> they have implemented Single Sign On.  there was a banner that took me to
> partners sign-on, then a button to "migrate forums logon" or some such.
> sorry to be vague. :)
>
>
> > On Jul 27, 2017, at 8:17 AM, Jeffrey Kain via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Is there a new way to access forums.4d.fr? For the past few days I
> haven't been able to reach this site -- Safari displays an error saying too
> many redirects.
> >
>
> **
> 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: C-objects and memory use

2017-07-26 Thread Kirk Brooks via 4D_Tech
David,
First off I hadn't seen this when I posted on the other thread so thanks
for giving me something specific.

On Wed, Jul 26, 2017 at 10:24 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Anyway, to your question. Check out JSON libraries in any other language
> you like, you'll see what I'm saying. You can
>
> * Freely inject any valid JSON element at any point, so arrays within
> objects, objects within arrays, whatever you need.
> * Read the same.
>
​I banged this out pretty quickly:
​

$obj:=JSON Parse("{}")

OB SET($obj;"name";"kirk")

ARRAY OBJECT($aObjs;5)

​ // would be nice to be able to specify a default value...​

$aObjs{1}:=JSON Parse("{}")
$aObjs{2}:=JSON Parse("{}")
$aObjs{3}:=JSON Parse("{}")
$aObjs{4}:=JSON Parse("{}")
$aObjs{5}:=JSON Parse("{}")

OB SET ARRAY($obj;"array1";$aObjs)

ARRAY LONGINT($aLong;3)
$aLong{1}:=1000
$aLong{2}:=2000
$aLong{3}:=3000

OB SET ARRAY($aObjs{1};"longs";$aLong)
OB SET($aObjs{1};"timeStamp";String(Current date;ISO date;Current time))

OB SET($aObjs{2};"key1";"a")

$obj2:=JSON Parse("{}")
OB SET($obj2;\
"key1";"asdfas";\
"key2";"asdfas";\
"key3";"asdfas")

OB SET($obj;"obj2-1";OB Copy($obj2))

OB SET($obj2;"key2";"I changed this one")

OB SET($aObjs{5};"obj2-2";$obj2)

4D_ALERT (JSON Stringify($obj;*))


​and the object it creates is:

​{
"name": "kirk",
"array1": [
{
"longs": [
1000,
2000,
3000
],
"timeStamp": "2017-07-26T12:29:01"
},
{
"key1": "a"
},
{},
{},
{
"obj2-2": {
"key1": "asdfas",
"key2": "I changed this one",
"key3": "asdfas"
}
}
],
"obj2-1": {
"key1": "asdfas",
"key2": "asdfas",
"key3": "asdfas"
}
}


You've got a point about mixed arrays. 4D doesn't deal with them well. I
couldn't get 4D to let me change longs[2] to an object, for instance,
without loosing the longint values.

Though it will read such a JSON - I made the change in a text editor, saved
the file and 4D parses it, correctly, to a c-obj. This is with 15.4HF3. But
it won't let me manipulate it fully. Suggests that JSON is mapped fully
internally but the tools aren't fully written.

I tried the same thing with NTK and I can, indeed, drill down into the
array and manipulate the elements independently of each other.

And I mis-spoke about not being able to change a specific key and have it
propagate up to the parent object. I'm not sure what mistake I made before
that lead me to that conclusion but I see I was wrong. Or maybe it's
because I was working in v13? Anyway, I stand corrected about NTK in v15+.

* Scan items and figure out a bit about their type. (This is a real pain in
> 4D when you use their array embedding tools.)
>
​This really gets to be program specific. If you go back to the json.org
it's defined an a text based data exchange format. So there's nothing in
the json spec about data type - it's all text. All the 'type' stuff has to
be added on to whatever the program wants to do. With the exception of
mixed arrays 4D is pretty good about managing the it's data types within a
c-obj. If I put a date value into a key I can get a date back out and I can
find out it's a data value. ​

Here's an exercise: Define a C_OBJECT that has 'rules'. These rules can
> just be in your head, but they should be something like "This element which
> is required must have a value in the range such and so. This element which
> is an array must have elements with contents in this range", etc. Figure
> out how to do it in 4D. Mostly, you can, some bits, you just can't. I
> tried. Hard. Failed.
>

​It sounds like you are working on a project where you want to be able to
import a data object from a json and be able to completely organize the
database based on the data found. That would be cool. But there's going to
have to be some negotiation beforehand about what's what I think, and the
lack of that isn't a fault on 4D's part. In the javaScript world there's
something called Simple Schema that lets you create and impose rules on
json data for things like Mongo. ​This lets you create the rules like you
mention. I can do the same thing in 4D and then have a criteria to validate
a data object against to see if I know what to do with all.


-- 
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: JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread Kirk Brooks via 4D_Tech
David,
On Wed, Jul 26, 2017 at 10:14 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hey, I'm fine that 4D does whatever it wants in C_OBJECTs however they want
> to. Their program, their rules. What I was responding to was Kirk's point
> about JSON per se. If you want to use JSON as an interchange format, we
> don't have a complete set of tools natively in the 4D language. JSON is
> normally treated as a tree (well, it is a tree) that you can parse and
> navigate. In 4D, you can do this using NTK.
>
​At the risk of appearing really dense what are the specific things you can
do with NTK that you can't do with native 4D? I use them both and I just
don't get what you are referring to. There are differences in the way they
provide access but I don't see how that results in a limit to what you can
do.

And like I said currently you can use native 4D tools to parse a c-obj and
make a change to a single key of a nested obj and the parent object is
updated (anyone joining in here should probably read the other thread for
the details). This is because of the object referencing we talked about in
the other thread. NTK doesn't support that right now so you can't do it.
Personally I find that really useful.

Can you give me an example of the kind of situation you're talking about?​

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

Question about building an installer

2017-07-25 Thread Kirk Brooks via 4D_Tech
So I'm getting around to building an installer for 4D on client machines.
we're talking windows here.  I just want to verify that there's not fancy
registry magic that's required if I unzip the 4D app into the programs
file. I know 4D has always just configured itself in the past - is that
still true?

-- 
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: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
On Tue, Jul 25, 2017 at 4:54 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hmmm. Well, 4D's tools for manipulating JSON are sub-standard, if your goal
> is to parse/produce JSON freely. In this respect, the XML tools (external
> libraries built into 4D) are far more standard and comprehensive.
>
​I hear you say that a lot but I don't agree. For me they have been quite
adequate. I haven't had any issue parsing or producing JSON from c-objects
or back again. Having said that it seems I'm not using c-objects is some of
the esoteric ways others appear to be. For me they have opened up great
ranges of possibilities and made interacting with web apps much easier and
faster.

And now that I have a fuller grasp of exactly how they are referenced I see
even more potential.

So, a tick on the interesting new features but no tick on basic JSON
> support. For that, you need NTK.
>
​Well one thing you can't currently do with NTK is update a single key in a
nested object. I discovered this while trying to replicate the commands
from Cannon's component in a v13 db using NTK. I'm using NTK for json quite
a lot in that database. I do like the way I can access array objects using
NTK. And being able to add items directly to an array without having to
un-pack it from the object is nice. But on the whole I find 4D's c-objects
easier to deal with on the fly, as it were. In another project where I'm
using NTK for HTTP comms for example.

What can you only do with NTK you can not do with 4D c-objects?

-- 
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: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
On Tue, Jul 25, 2017 at 4:02 PM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT
> flaunt the limited scoping abilities we have in 4D?

​
I think it has to do with the c-object being brought about ​from figuring
out how to handle JSON. Blobs and pictures and text vars all conform more
or less to the way 4D has conceptualized data objects pretty much forever
from my perspective. And 4D-land pretty much eschewed really embracing any
alternatives (which is why it's so much fun to use XML in 4D). Not to get
all shrinky about this but I feel that had Laurent not made the detour into
Wakanda and immersed himself in javaScript for a while our tools for JSON
would be on par with the ones for XML. The c-object is stretching 4D
conceptually and technically. From what I've heard at the Summits and such
it's changing the way 4D is built internally. So it seems likely to me this
is the future of 4D being worked out. I don't think it's a bad thing.
Frankly I think being able to manipulate JSON pretty much directly in 4D is
fabulous. Of course I've demonstrated I'm not big on the internal
architecture involved but as a user and developer I think it's pretty cool.
I'm just trying to really ground my understanding of the fundamentals so I
don't start engineering in ideas that will blow up on me in a year or two.

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

Listbox entry gotcha

2017-07-25 Thread Kirk Brooks via 4D_Tech
Open a form with a listbox. I am looking at an array based listbox, don't
know if this is true for selection based but I suspect so.

Make an edit in a cell but DO NOT press tab, or enter or click anywhere
else in the form. Now add something to the listbox via drag and drop (or
perhaps some other programatic event).

Because you did not trigger the focus to change the on data change event
doesn't fire either and the contents of the cell revert to whatever they
were before the entry. Tech Support has confirmed this as the expected
behavior and suggested I might use On after keystroke. Not really an easy
option given the calculations that run as the result of data change. Not to
mention the opportunity for erroneous calcs based on incomplete data. And
in the context of one keystroke to another there's no way to tell which one
was the last one.

That last point is important because the next event is going to take place
in the context of itself. Meaning if I use some other event, On drag over
looked promising, with POST KEY to hit the tab -- it still doesn't trigger
a data change event on the cell that was edited. Other things like on
deactivate do not fire for an object or subform.

It appears the only solution is to set a 'shadow' object for the listbox
and at each keystroke update it with the row, column and new data.
C-objects will let me store any data type so at least there's that. Then On
data change and On drop use that object for updating and saving if it's not
empty. Seems like a lot of workaround to accommodate data entry with drag
and drop.

​This only comes up rarely but it's a problem when it does.

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

v13 Execute Immediate causing 'Remote SQL server' error

2017-07-25 Thread Kirk Brooks via 4D_Tech
Hi folks,
A v13 server db is throwing a "Remote SQL Server not available" error when
running this code:

__statement:="SELECT _SuperUser, "+$field+" FROM Agents WHERE _Agent_ID =
"+String($agent_id)+" INTO :__superUser, :__Access"

Begin SQL

EXECUTE IMMEDIATE :__statement;

End SQL

$0:=(__superUser | __Access)


$field is the name of a field in the [Agents] table. There's a different
error if the field name is wrong. This is only happening on the 4D Server
installation.

Any ideas what's going on? I'm thinking the client is running an old
version of v13 server.

-- 
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: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
Jeff,
On Tue, Jul 25, 2017 at 8:53 AM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> You can start in, say, method A with a line like
>
>   $obj:=[Table]objectField
>
> ... and pass $obj through any number of methods as a local variable, or a
> pointer, or a process object variable. Any changes anywhere down the line
> will be made in [Table]objectField, since that's the only "real" object --
> everything else is just a reference.
>
​It would never occur to me to do that but it's an interesting case to
think about. ​But by involving an object field I would think you'd be
ultimately limited by where the record was loaded. If we make the
assignment in Process A, and then pass the object to Process B I would
expect Process B to begin working with a copy of $obj, not the actual
object. Have you tested that changes made in Process B are reflected in
[Table]objectField?

And let's say we close process A but not B. I don't think the object just
goes away.

I may have to make a db and try these things out tonight. This is pretty
interesting the more I think about it.

Regarding not being a fan of the memory heap, and recalling I'm not the
most informed computer architecture guy, what are other approaches to
managing objects in memory?

Since I do a lot of work with parsing chunks of text into arrays, for
instance, it seems like a benefit to be passing references to an object
rather than the object. I have had the impression that given:

$chunk1:=Parse_some_text

Parse_text_toArrays($chunk1;->array)

Parse_text_toArrays
​ creates a separate copy of $chunk1 whereas​

$chunk1:=Parse_some_text

Parse_text_toArrays(->$chunk1;->array)

Parse_text_toArray works with the original $chunk1 directly via
dereferencing the pointer. If I understand your point in both cases I'm
passing a reference to the object. Presumably in the first case I would
make a copy of the object as soon as I do anything to alter it. Do I have
this right?

-- 
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: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
Hi Peter,
Great reply. You helped my understanding of the way ref-counting functions
with respect to c-objects a lot. The concept of the memory heap has only
mattered to me peripherally and so ref-counting was a similarly hazy idea.
The result of mainly dealing in 4GL languages. Anyway now I get that the
objects all exist physically in the same memory heap with the references to
them being dependent on the scope the reference is created in. Nice.

On Mon, Jul 24, 2017 at 11:29 PM, Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> >  ​
> > SET($1->;"name";"Kirk")
> >
> > ​then myMethod will work the same way on the client or EOS. However I
> > suspect the time to dereference a pointer adds some time on the client
> side
> > that wouldn't be required by simply accessing the object directly. ​
> >
>
> This is something I would like to test. In fact, I never tried to pass
> pointer to EOS method and do not have clue if it will be working (or is
> allowed.)
>
​ This is something I can speak to. Josh pointed me (couldn't resist) to
using pointers with EOS methods as a way to pass a pointer to the server.
Great way to populate arrays instead of packing them in to blobs, for
instance.

​An even better tip​ is this:

On the server create a stored method that performs onerous lookups and
stores the results in IP vars - like objects or arrays. It can run as often
as necessary. The IP vars persist as long as the server is running.

Make an accessor method with the EOS property like so:

GetVar(text; pointer)

where $1 is just a label and $2 is ptr to the client var to populate. It
could look like this:

Case of

:($1="salesSummary")

$2->:=<>salesSummary

End case


You can call it using local vars on the client:
GetVar("salesSummary";->$obj). ​That's fast. And since you are accessing IP
vars on the server you don't need to worry about accessing a particular
server process - server side IP vars are available to any instance of the
'twin' process. And since you are only reading the vars you don't need to
worry about locking them on the server. Unless you are using them in some
dynamic way which isn't what I'm describing here. Works v13+.​

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

C-objects and memory use

2017-07-24 Thread Kirk Brooks via 4D_Tech
I want to make sure my understanding about how c-objects are handled in 4D
memory. Mainly because it seems this understanding is cobbled together from
a number of different sources few of which I can easily find again. So...

1) c-objects are created within the 3 4D scopes: IP, process or local.

2) but they share some characteristics with hLists and menuRefs in that
once created they can be referred to by different instances. For example,
if I create an process object called "prosObj" as:

{ obj1: {name: Kirk, ID: 1234},

   obj2: {name: Joe, ID: 5678}}


I can create a local obj as:

$obj:=OB GET(prosObj;"obj1")

In this case $obj can be thought of as a pointer to prosObj.obj1 because if
I change the values in $obj these changes will also be made in ProsObj. So

OB SET($obj;"name";"Xavier")

​and then look at prosObj I'll see:

{ obj1: {name: Xavier, ID: 1234},

   obj2: {name: Joe, ID: 5678}}

​

3) My first point of clarification is that $obj is simply referencing
prosObj so it's not significantly increasing the amount of memory used.

4) Conversely if I created $obj using the copy command it would. So

$obj:=OB COPY(OB GET(prosObj;obj1))

would create a full copy of obj1 and take up more memory.

5) This referencing feature also applies to objects in arrays. It's easy to
discover this inadvertently:

ARRAY OBJECT($aObjs;0)

OB SET($obj;key;"new value")

APPEND TO ARRAY($aObjs;$obj)
APPEND TO ARRAY($aObjs;$obj)
APPEND TO ARRAY($aObjs;$obj)

$aObjs has 3 element each containing: {key;"new Value"}.

If I modify $obj:

OB SET($obj;key;"defined value")

​each element of $aObjs is now ​
 {key;"new Value"}
​:​


​Again, I'm assuming $obj only exists in memory one time with each element
of $aObjs referring to it.

6) I can clear $obj without erasing the referenced values by calling:

$obj:=JSON PARSE("{}")

7) ​And unlike menus and hLists ​the memory occupied by $obj is released
when the process end.
​

8) Passing objects as parameters is essentially equivalent to passing
pointers to c-obj vars EXCEPT when working with a method called with
Execute on server - object references don't propagate when moving between
the twin and local process. So let's say myMethod
does this:

 OB
​ ​
SET($1;"name";"Kirk")


I can execute this method locally myMethod($obj) and $obj = {"name";"Kirk"}

If I set the EOS parameter (and run it on the server) no errors are thrown
but the client side version of $obj doesn't change.

​If I change myMethod to take a pointer;

​OB
 ​
SET($1->;"name";"Kirk")

​then myMethod will work the same way on the client or EOS. However I
suspect the time to dereference a pointer adds some time on the client side
that wouldn't be required by simply accessing the object directly. ​


For these examples the memory use is trivial, of course. But as I coming to
appreciate how great c-objects are for managing a lot of data in memory I
can see a time when I might be working with significant memory allocations
where these things can really matter.


-- 
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: Need help identifying a crash source

2017-07-22 Thread Kirk Brooks via 4D_Tech
Sannyasin,
I took Bruno's suggestion and deleted the composite index for these two
fields. After that I was still getting a crash but it had moved further
down the execution chain. So I just deleted all the composite indexes.

That seemed to fix the problem.

On Sat, Jul 22, 2017 at 2:20 PM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Code looks fine to me. Is it possible $1 or $2 is accidentally the wrong
> type (aka, not text). I’ve had fun crashes by accidentally passing an array
> that should have been just text…
>

-- 
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: Need help identifying a crash source

2017-07-22 Thread Kirk Brooks via 4D_Tech
Bruno,
That seems to be the issue. I say 'seems' because I could run the same
method with the same parameters in a different context and not have a
problem. And like I said this method is called very frequently. None the
less when I took out the composite index the problem shifted further down
the execution chain - to another similar situation with different methods
but a composite index in the mix anyway.

I knew there was a problem with the composites with 4D server but this is
the first time I've had a problem otherwise.

Thanks again for the lead.

On Sat, Jul 22, 2017 at 1:23 AM, Bruno LEGAY via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> We recently encountered a crash on a QUERY after adding a composite
> index...
> We removed composite index, no more crash...
> Do you have composite indexes ?
>
-- 
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: Need help identifying a crash source

2017-07-22 Thread Kirk Brooks via 4D_Tech
Oh yeah, the composite index thing. I'd forgotten that one and this is
15.4. Good suggestion, I'll have to look at that.

On Sat, Jul 22, 2017 at 1:23 AM, Bruno LEGAY via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> We recently encountered a crash on a QUERY after adding a composite
> index...
> We removed composite index, no more crash...
> Do you have composite indexes ?
>
> HTH
> Bruno
>
>
>
> **
> 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
**

Need help identifying a crash source

2017-07-21 Thread Kirk Brooks via 4D_Tech
I need some ideas on a problem.

I'm getting a crash when a method runs. The method itself isn't the issue,
I think, because it gets called literally hundreds of times in a given
session. Here it is:

C_TEXT($1;$2;$dir;$key)

$key:=$1

$dir:=""

If (Count parameters=2)

$dir:=$2

End if

ASSERT($key#"";"No key for a KVP find.")

If ($key#"")

QUERY([KVP];[KVP]key=$key;*)

QUERY([KVP]; & ;[KVP]dir=$dir;*)

QUERY([KVP])

End if


The crash is happening as soon as the query runs when it's called in the
context of a process that I spin up for a specific task. Now as I say this
method is called frequently. I tried running it with the same parameters it
gets in the crash scenario with no problem. This surprised me. So just for
fun I ran the datafile through MSC and it comes back some errors in an
index not related to this table at all. I repair it all anyway and still
get the crash.

I try some different source records for the process even though the lookup
that's being performed is the same for all of them. I still get the crash.

So, I'm looking for other avenues to explain what might be going on here.

-- 
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: Use of Objects vs Global Variables (Was 'Arrays vs Objects...)

2017-07-21 Thread Kirk Brooks via 4D_Tech
Nigel,
Nice post. I very much agree with pretty much all your points. A few things
I'll add:

Functions: yes! A lot of IP vars I see in old code are used to make values
available that used to take measurable time to derive. Lots of them can be
replaced with a short function to just go get the current value of
whatever. This is a fine solution for user entry situations. In a tight
loop I'd collect all that data first into local vars prior to starting the
loop.



On Fri, Jul 21, 2017 at 1:22 AM, Nigel Greenlee via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I suspect the original programmer never intended the functionality to be
> running in multiple processes at the same time and used interprocess arrays
> to (I think) make it easier to display the data on a form that is in a
> different process.

​Triggers also. I find IP vars in triggers which are generally useless, or
worse, on 4D server because the trigger code always runs on the server
which has no knowledge of the client IP vars.

Same problem with using IP vars as semaphores. It worked way back in the
day and doesn't break noticeably when running. ​



> Most code i write now is ‘self contained’ -I attempt to set all values
> used in the method is passed in to the code -either as parameters or an
> object or a pointer to something so that i end up with something more like
> a javascript function. Myreturn:=MyMethod(something;something;something).
> Using this style of coding means i am far more likely to get an error if
> there is one EVERY TIME rather than a head scratching randomly appearing
> one and my code does not rely on the perceived value of a variable.
>
​I find this very true. The time spent writing the method to manage its own
variables may be a little more up front but you never have to come back to
it unless you are actually changing the method. It also makes it easier to
test code. ​

-- 
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: [off] Age bracket of this group (USA) :)

2017-07-21 Thread Kirk Brooks via 4D_Tech
Some friends saw them here recently and said the show was very good. The
album they are supporting is on iTunes - you can stream it with a
subscription. Esp. interesting as I'm reading Weigel's book, "the Show That
Never Ends." Cranky, perfectionistic old bastard Fripp - would fit right in
here.

On Fri, Jul 21, 2017 at 6:59 AM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> To all,
> Since the age bracket of this group falls into the correct range...
> Those of you in the US might want to know, and check your local listings
>
> Robert Fripp, and King Crismon are touring!
> (and apparently have been touring for most of this year.
>
> Band line up:
> Robert Fripp (well... everything  :)
> Tony Levin (bass)
> Bill Rieflin (many instruments)
> Jakko Jakszyk (guitar)
> Mel Collins (Sax)
> Jeremy Jezza (many instruments)
> Droms:
> Gavin Harrison, Pat Mastelotto
>
> One (of many) site to see if they will be in your area:
> https://www.songkick.com/artists/315745-king-crimson
> ---
> 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
> **




-- 
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: Collections in v16R4

2017-07-19 Thread Kirk Brooks via 4D_Tech
Yea!

Does SDI provide the same flexibility we have on Macs when working with
multiple monitors? It's a real pain getting multiple monitors configured to
"see" the MDI on more than one at a time.

On Wed, Jul 19, 2017 at 2:03 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> you can open multiple windows using SDI, each with its own menu bar.
> but many developers who requested SDI support seem to have a single window
> app in mind.
>
> SDI is only available for engined applications.
> since SDI is not (yet) available in the design environment.
> for now, you can't quickly "switch to application mode" to actually see
> the difference.
>
> there is not doubt SDI is going to offer many new possibilities.
> but of course if you like, you can leave the new checkbox deactivated.
>
> it is possible to launch multiple instances of 4D (except built
> applications, there is a blocking mechanism to prevent the same
> structure/data being opened multiple times) by just double-clicking the
> icon over and over again.
>
> where SDI or not, all instances of 4D will be grouped and minimised just
> like any Windows application.
>
> 2017/07/19 16:37、Paul Dennis via 4D_Tech <4d_tech@lists.4d.com d_t...@lists.4d.com>> のメール:
> I may sound like a Luddite but I like MDI much neater to be able to
> minimise
> a whole app in one click or is that possible with SDI ?
>
>
>
> **
> 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: Thinking through object/text fields: Findings summarized, advice solicited

2017-07-14 Thread Kirk Brooks via 4D_Tech
Julio,
I don't think 'variable structure' is necessarily the defining element.
It's certainly good for that but now that we can search on these fields
they're also good for situations where you want to allow each record to
have some large number of fields most of which won't ever be used but need
to be there. It's just sad to see a table in an old db with a hundred
fields, 20 or so marked "unused" and only 5 or 6 of which are actually
populated.

Perhaps this is what you are saying and I'm just reading too narrowly (it's
been that sort of week).

On Fri, Jul 14, 2017 at 1:49 AM, Julio Carneiro via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Jul 14, 2017, at 4:21 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Does that all sound about right? Am I missing reasons why I would want to
> > use object fields. vs. text fields? Any other technical details that
> people
> > have learned or figured out?
>
> I’d add that using an object field is only meaningful if your objects have
> a variable structure, that is, objects differ among records not just by
> contents but have a variable internal structure.
> If all objects in all records share a common structure, that is, they all
> have the same attributes (even if some are optional and may be empty/null),
> then go with standard 4D fields. As you pointed out, they take a lot less
> space, can be individually indexed/keyworded, are easier to deal with,
> their usage is syntax checked by compiler, etc..
>

-- 
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: ​Someone help me out, how do you get good information out of 4D

2017-07-11 Thread Kirk Brooks via 4D_Tech
David,
Interesting initial post - like marmalade on a flakey croissant, a little
sweet and a little bitter. I've hammered a similar nail before: what is
4D's vision of itself? What is the target market? Why does such a fabulous
product remain so unknown? Why isn't there better documentation? Let's
build the user base... There seems to be a resolute determination not to
pursue any of that sort of thing. To my American brain that seems just
weird. My wife has been very helpful in getting me to accept just how
"French" 4D is. These aren't prime motivators. I think Americans really get
jazzed about getting bigger, richer, and just having 'more'. 4D seems to be
about control and being happy. I don't know of many other software
companies that have been active for 30+ years and remained as closely held
as 4D has. OK, maybe some of us would fit that profile but we're pretty
small. Heck 4D itself isn't that big at ~$20million US. A number of their
customers are larger. I don't know if you've had a chance to see Laurent in
the past few years but every time I do I see a really happy guy. JPR is the
most affable curmudgeon I've ever met. I've never seen Thomas Maul not
smiling. And so on. Perhaps Atavan is part of the compensation package. But
the folks who matter in the company all seem pretty content with the way
things are and so I think that's the way things will be. Is it so bad being
happy in a world on the edge of oblivion at the hands of morons?

Personally I think 4D's weaknesses and strengths are side by side with each
other. Or it's like a uroboros for a darker metaphor of the R release
cycle. The thing now is what made 4D cool 30 years ago - it's a single
package that allows you to do some of almost everything. You got your
relational database engine, you got your PHP, you got your Web thingy, you
got your JSON stuff, you got your graphical interface designer whizy, we
got plugins, we got components. Many of these are quite well developed and
some are just bolted on. You don't like the way we do databases then go
ahead and write your own database inside of ours. Heck now that we can
query a JSON field it's almost like noSQL, ar you can mimic noSQL. 4D
doesn't try to lead anything because there's no payoff with a small user
base and in some areas always lags (I'm looking at you security guys). This
makes it attractive to folks looking for a well equipped playground. Again,
it's always been that way.

The most common 4D origin story I hear is similar to my own: it was 1987
and I was doing some work for a company that needed a database to do a
specific thing, just like Steve said, and they were using Macs and I said
"I can do that" because I'd read an article in MacWorld or something
talking about the cool things you could do with this new program called 4D
and this was a great excuse to go spend the $500 or so to buy it. The thing
is that's about the only origin story I really hear. I know there are
others that's just the one I've heard most. In a very roundabout way this
brings me back to the frustrations I hear in your posts from time to time.
And you're not alone, just perhaps more willing to go on record with them.
You're like a real CS guy and while I can muddle around in the 4D middle
ground for the rest of my life you drill down into stuff, 'cause you know
about it, (and here's another metaphor) it's like hopping the fence at
Disneyland and finding there aren't real buildings on Main Street. So
that's why there's no actual records in City Hall, for example. (Stretching
it even further.)

Reading back over this I see I sort of hijacked your post a little. Sorry
about that. For me I decided to stop trying to get 4D to do anything and
just decide for myself whether it was worth my effort to use it. As is.
Like any other relationship - accept the other as they are or leave. I
never successfully changed anyone but myself. And funny enough the more I
focused on that the happier I became with 4D. And you are totally right
about the JSON parser. I mean really.

I will echo Steve's comment about how valuable I find your contributions
here and the times we've exchanged emails off line. The iNug is better with
folks like you.

On Tue, Jul 11, 2017 at 6:19 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> You're right, I need more tools - and I'm find with that. 4D isn't a data
> analysis tool and I actually accept that part. But, yeah, I do get
> frustrated by some things, like, an incomplete JSON parser? Makes no sense
> to me.
>
> Anyway, 4D has a ton of features I love and I'm fluent in it enough to get
> things done quickly. It's absolutely my go-to tool for grinding and
> reprocessing data. It's great for that. And I don't think that's just
> because I know it already, I think it's actually pretty great at connecting
> to a huge range of systems and tweaking stuff.
>

-- 
Kirk Brooks
San Francisco, CA
===

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

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
Hi Ben,


On Fri, Jul 7, 2017 at 5:15 PM, Ben Kershaw via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> When a method with this property checked is executed, it runs in the
> context of the servers “twin” process (which isn’t really a twin, since it
> doesn’t really share anything with the client process). If you want your
> OEC method called for an error in that method, you have to set that in the
> server processes context.
>
> Do you have some sort of generic “init process” method that you call
> whenever you start a new process? If so, create a new method with the
> “Execute on Server” attribute checked, and then call THAT method from your
> “init process” method; this will initialize the server processes context.
>
​Well I do now...
​


> I have a method called “InitServerProcess_sv” with the EoS property
> checked, and I call it from my InitProcess method. It sets up the OEC
> method and does a few other things. Has worked like a charm for years.
>

​That is a great idea. I just recently wrote a method to run like that when
I start processes to capture the process startup data Joaquin clued me into
last week. That is a good place to put such a call.

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

Any issues with running v13.6 server and 13.5 clients?

2017-07-07 Thread Kirk Brooks via 4D_Tech
Just wondering.

Thanks

-- 
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: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
David,
I was hoping you might weigh in here.

Yeah, so I'm talking about a method with the Execute on server attribute
(or property - whatever) checked.

So the situation is a client process is churning away and passes some
arrays off to the EOS method for processing on the server (looking things
up, grinding away).

It's not running on the client (that's the point) but it's not entirely
native to the server either. I'm hearing the guy from the Princess Bride
here... "If he's not completely dead that means he's a little bit alive."

And this is really my question - is this a bug or am I missing something?

On Fri, Jul 7, 2017 at 3:43 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm not sure I'm following the basic setup because 'execute on server' can
> mean two things in 4D, can you clarify?
>
> If you're running a method with the 'execute on server' flag set then, huh.
> What a great question! I hope this is what you mean because, yeah, that's a
> nice detail. I don't know the answer and I won't be shocked to learn that
> this is a gap in the ON ERR CALL coverage in 4D. (4D seems to approach
> error handling as something tacked on top of things - there isn't a
> predictable or systemic scheme for it. At least it doesn't look like there
> is.) Does anyone know? I've got it on my list to do a deep dive on the
> Execute on server flag, but, well, I've got a long list.
> 
>

-- 
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: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
Jody,

Right, but what I'm seeing is a client side process which has an error
handler installed. Running a method with EOS an error is blocking the
server with the 4D native error handler. Even though the server has an
error handler installed. This is following the what's in the docs:

 "ON ERR CALL is usually placed in the startup database method of an
application, in order to handle errors for this application."

​Seems to suggest that would be the method called absent some specific
method and instead of the native 4D error handler. So that's why I expect
the server to use the handler I install there.

It seems like this is something specific to methods running EOS because
I've installed an error handler on both the server and the client process
but the 4D error handler is winding up with the call.


On Fri, Jul 7, 2017 at 2:52 PM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On Error Call is process based. Therefore each process needs to call it.
>
>
-- 
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
**

What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
I think I know the answer to this but think I'll ask anyway.

When my server starts up in installs an error handler, ON ERR
CALL("err_log_only"). As the name implies it simply logs errors and keeps
churning.

It doesn't seem to be called when a method called by Execute on server is
running. At least I'm occasionally seeing errors on the server from a
couple of methods. The thing about this is the process calling these
methods has its own error handler installed as well which is not being
called.

So, is this a bug or is it the case that methods running as EOS have to
explicitly call their own error handler? And if that's the case, as I think
about it, is this a situation like the rest of process vars and the 'twin'
process where it's the same but different. Ie, I can have process vars with
the same names on both the client and server side but these vars can have
totally different contents. Is it therefore the case with the Error
handler? Installing a given handler on the client process doesn't affect
the server side. If that's the case it sounds like I should be adding an
EOS method to my process init to install a handler on the server twin.

Anyone else encountered this? What did you do?

-- 
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: Triggers and modified by fields in roll-your-own user

2017-07-05 Thread Kirk Brooks via 4D_Tech
Chuck,
Always an option. But managing IP arrays require local semaphores to manage
read/write. On a local machine that's not too bad but on a busy server it
could get to be a noticeable issue where you could conceivably have dozens
if not hundreds of records being affected in a very close period of time.
I'm thinking about several users importing records or executing some method
that loops through a bunch of records.

Plus I'm really trying to get away from IP vars as much as possible.

In the original db the best solution has worked out to be my initial idea:
I split out the updating of the date & user fields and run that within the
Save Record wrapper. I tend to prefer triggers for this sort of thing
because it catches changes due to stuff like importing, apply to selection,
etc. Save Record is great for While Loops and user inputs but not so much
those other cases.

It's actually this sort of stuff, custom user info not being readily
available, that lead me to work out syncing my user accounts with 4D users.
It's a whole 'nuther level of complexity but lets me get out of the
password and logon management business along with solid user identification
in any native 4D situation. I'm not necessarily promoting that as a
solution - just saying it's working for me in one installation.

On Wed, Jul 5, 2017 at 8:36 AM, Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Why not an interprocess array on server open connection add and then
> remove at end
>
> Regards
>
> Chuck
> 
> 
>  Chuck Miller Voice: (617) 739-0306
>  Informed Solutions, Inc. Fax: (617) 232-1064
> mailto:miller.cjaygmail.com 
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D and Sybase connectivity
>   http://www.informed-solutions.com
> 
> 
>
>
> > On Jul 3, 2017, at 6:19 PM, Joaquin Mendes Castro via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > As far as i have been able to learn by trial and error, the first time a
> > client connects to the server, it is asigned a User connection ID. This
> ID
> > is not related to the 4D user, and will not be the same if you quit and
> > connect again. As you said, it is more a node connecting to the server.
> The
> > good thing is that every process launched by that client has this same
> User
> > connection ID. If you develop a way of matching this ID with your [users]
> > table, you will be able to identify in the server who is playing on the
> > client side. We do this by launching an special process protected by a
> > semaphore which creates a record in the [current_users] table filling a
> > filed with the [users] id, and in the On server close connection method,
> > another field with the User connection ID. From then on, you just load
> this
> > record in the On server open connection (you know the User connection ID)
> > so you can use it to get the [users] id in triggers.
>
> **
> 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: Triggers and modified by fields in roll-your-own user schemes

2017-07-03 Thread Kirk Brooks via 4D_Tech
Joaquin,
Great suggestion. I'm not going to use it in this case because we don't
currently have a session tracking system.

But the tip about On server open connection is great. I missed that it
fires each time a new process begins. I thought it only ran when initially
connecting to the server.

I really need to go back and re-read some of fundamental commands more
often.

After playing with this for about 10 minutes I've got a couple of questions:
 the user ID - how does this number correlate to 4D users? Or does it refer
to 'user' in a more general sense of a 'node' connecting to the server?

 the connection id is some sort of random value I assume but specific to
this particular process.


On Mon, Jul 3, 2017 at 9:14 AM, Joaquin Mendes Castro via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> We did this by using the On server open connection and On server close
> connection database methods. Any process launched by a user session shares
> an ID ($1) which can be used to track who is doing what.
>
> When a user logs into the application, we launch an special process which
> records this UserSession_ID and our internal User_ID in a table
> ([idsrv_CurrentUsers]). Then, on every new process launched, the On server
> open connection method does a query on this table with the UserSession_ID
> and loads the user's record as the current for this table. Further on,
> triggers just have to use the [idsrv_CurrentUsers]User_ID to know who shot
> it.
>

-- 
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: Is there a JSON handling component for v13?

2017-07-02 Thread Kirk Brooks via 4D_Tech
Michael,
The best I've found is the JSON functionality in Rob Laveaux's NTK plug in:
http://www.pluggers.nl/product/ntk-plugin/

Miyako also has a plugin on github: https://github.com/miyako/4d-plugin-json

I've used them both. Miyako's is fully capable and if you can't justify the
cost of NTK you can use it. I did for a couple of years on one project.
Having done that I'll say Rob's would have been worth the money even if I'd
only used it for the JSON commands. That's not a knock on Miyako. My
projects are all littered with instances of Miyako's influence. It's just
that Rob's implementation is better documented and in my opinion easier to
work.

One caveat to be aware of - there are one or two commands in both plug ins
that share a name. Consequently you can not use both at the same time. So
do some testing with them before committing to one or the other in your
project.

On Sun, Jul 2, 2017 at 3:18 PM, Michael Ferguson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I’d like the source code, but compiled is OK with good documentation.
>
> Thanks for any response,
>
> Michael Ferguson
> MyOfficelink
> **
> 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: Nested transactions - most appreciated feature

2017-07-02 Thread Kirk Brooks via 4D_Tech
Alan,

I have a slightly different take from Peter's - consider attempting to make
changes in a database with many users who may or may not be 'touching' or
accessing data involved in the chain of updating. Inventory updates are a
classic example. Pricing can be another. Ideally these sorts of things
would be done during off-hours but that's not always possible and a given
update may take a few seconds to run sometimes. This is the sort of case
where I find nested transactions really helpful. It's not possible to know
ahead of time everything that might be touched and things may be changing
in the meantime anyway. I like to break down a complex task into logical
components each of which may be used in other situations so it makes sense
to wrap each one in its own transaction and let the master transaction
decide whether any of those subsidiary ones warrant cancelling the whole.

To be honest I hadn't even considered the issue of working with components
but Peter does a lot more of that than I do. Plus I rarely have components
doing much of their own processing - just offering support and
functionality to the parent db.

I'll just add I think it's a bad idea to wrap any UI in a transaction. As
Peter notes I know some folks do it and it works for them but my experience
has never born that out.

On Sun, Jul 2, 2017 at 9:44 AM, Alan Chan via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> If there's no UI, why you need nested transaction? It's all on assumption
> of my understanding on nested transaction and could be wrong.
>

-- 
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: Nested transactions - most appreciated feature

2017-07-01 Thread Kirk Brooks via 4D_Tech
Peter,
For me it's just been the obvious ones - be sure to close each one you open
and remember that during development it's easy to cancel out of one.

I find writing methods that require transactions should always start &
close the transaction inside that method. Consequently I make most of those
functions that return true/false to correspond with the transaction state.

Doing that I've not had any problems because of nesting.

On Sat, Jul 1, 2017 at 1:49 PM, Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi
>
> Sorry to be late to the party on this.
>
> It always takes me about 5 years to start using a new feature of 4D with
> gusto. I tend to believe that if I’ve worked around some deficiency for
> years then suddenly having to *not* do so is too good to be true and that
> there must be some catch.
>
> In that regard I must register my total fan-approval for nested
> transactions. Not having to worry about what calls may be downstream of
> your big ‘transaction wrapper’ is absolute heaven.
>
> However, just before I throw all caution to the wind, is anyone aware of
> any ‘gotchas’ with transaction nesting that one should be aware of ? Or can
> we just nest stuff within stuff with exactly the same caviats as for a
> 1-level transaction and no more ?
>
> Thanks for any contributions !
>
> Peter
>
> **
> 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: Triggers and modified by fields in roll-your-own user schemes

2017-06-30 Thread Kirk Brooks via 4D_Tech
Arnaud,
Yeah, I considered that direction too. I ruled it out because it's
introducing a lot of moving parts for the sake of being able to run some
code in a trigger. Since triggers aren't used so far that would be a pretty
big change.

Making the modified field updates into a separate method looks like the
path of least upset.

On Fri, Jun 30, 2017 at 4:00 PM, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> Each time a process begins, I use an EoS (execute on server) method to
> write a process variable (an objet) in the twin. As the twin is also the
> process that executes the trigger, it will read user from that variable.
>
> 3 methods:
>
> a) on startup call User_infosSet
> set some properties in c_object <>userInfo_o on client side (user PK,
> name, login, machine, ip address, etc.)
>
> b) when a client process begins, always call User_infosSet_srv
> this is the EoS method, it receives <>userInfo_o as $1 and makes a copy of
> it in a c_object userInfo_o on server side
>
> c) when needed (client side, trigger…) call User_infosGet (property)
> get some property in the object,
>  case of
>: client side
>  read property in <>userInfo_o
>: server side (twin)
>  read property in userInfo_o
>
> Know issue:
> - one more process variable on server
> - never forget b) (as I sometimes do)
>

-- 
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: Triggers and modified by fields in roll-your-own user schemes

2017-06-30 Thread Kirk Brooks via 4D_Tech
Alan,
Not a bad approach. In this case the MODIFY RECORD commands appear in an
otherwise generic EDIT RECORD method so there are numerous forms involved -
and they are constructed such that there are multiple ways the record may
be caused to be saved. Theoretically they should all funnel back to the
SAVE_RECORD wrapper. But they don't.

On Fri, Jun 30, 2017 at 3:58 PM, Alan Chan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> MODIFY RECORD won't save record until you click "Save button". The same
> Save_Record Wrapper in Save Button should work without 2nd call. Do I miss
> something?
>
> In fact, this is exactly what we are doing and our app is also evolved
> from v3.
>
> Our wrapper is something like followings
>
> if(new record or modified record)
>
> start transaction and new err call
> validate all fields locally
> if(no error)
> log user \\this is what you do to log user
> end if
> if(no error)
> save record
> end if
>
> if(no error) \\no error in trigger
> validate transaction
> else
> cancel transaction
> end if
> end transaction and end err call
>
> end if
>
> Alan Chan
>
> 4D iNug Technical <4d_tech@lists.4d.com> writes:
> >The best solution I've come up with is to split out setting the
> >Create/Modify action to a separate method. Since this can't run in the
> >trigger it can run in the SAVE_RECORD wrapper and when MODIFY RECORD is
> >used I can call it immediately after. Results in a 'double save' but
> that's
> >no biggie.
>
> **
> 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
**

Triggers and modified by fields in roll-your-own user schemes

2017-06-30 Thread Kirk Brooks via 4D_Tech
Hi folks,

I'm working on an old db. Like begun in v3/pre 4D server old. It has its
own user scheme built in, no 4D users at all (or that matter here).

The issue is recognizing and tracking modified by/when data. Typically I'd
use a trigger for this but the db runs on 4D server and triggers, as we
know, are executed on the server. So there's no way for the trigger to know
about the user tracked by IP vars.

Now, the ancestral designers worked around this by writing a SAVE RECORD
wrapper that managed this stuff. The issue is several places where MODIFY
RECORD is called which, of course, doesn't require SAVE RECORD.

The best solution I've come up with is to split out setting the
Create/Modify action to a separate method. Since this can't run in the
trigger it can run in the SAVE_RECORD wrapper and when MODIFY RECORD is
used I can call it immediately after. Results in a 'double save' but that's
no biggie.

Anyone else have a better approach for this?

-- 
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: An efficient printing approach...

2017-06-30 Thread Kirk Brooks via 4D_Tech
Robert,
Is the intent to replicate the look and format of the document or simply
report the data? To replicate the look of the form will take longer (for
conversation I'd say at least 2 - 3 times longer). As for assembling the
data that will depend on whether it's readily available already or not. And
if you have to write an interface to accommodate users defining the query
parameters and such that becomes a non-trivial task in itself. So I'd guess
somewhere between a long afternoon and a week.

And I agree it would be good to obscure the identifying information. I'd
suggest you do that right away.


On Fri, Jun 30, 2017 at 10:54 AM, Robert ListMail via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I was tasked with creating this report in 4D where I chose to use Print
> Form…. Since it took me an embarrassingly long time to create this and
> since it could be done from scratch in Excel in 20 minutes… I wanted to
> hear from the smarter 4D Developers at large.  So, how would you build a
> report like this in 4D? Also, how much time might you budget or estimate…?

-- 
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: Set Print Option clarity needed

2017-06-30 Thread Kirk Brooks via 4D_Tech
This is also a confounding issue if you even tried to use "printing" on 4D
server to create PDFs.

On Thu, Jun 29, 2017 at 10:26 PM, Keith Goebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:
>
> Sounds like I have just been incredibly lucky so far that print settings
> have not been messed up by a second process.
>
> > On 30/06/2017, at 2:38 pm, Keisuke Miyako wrote:
> > printing has always been a global operation.
> >
> > after all, it is the application that is doing printing, not the process.
>

-- 
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: How to close a modal window if user clicks outside of it?

2017-06-29 Thread Kirk Brooks via 4D_Tech
Keith,
You and Chuck put me on the right track - ie. RTFM. What I want is
specifically what a modal is trying to prevent.

It looks like a popup window (#32) is exactly what I want because, well,
that's exactly what I'm doing...


   - The window is automatically closed and the "cancel" event is passed to
   the window when:
   - a click occurs outside the window;
   - the background window or the MDI (Multiple Document Interface) window
  is moved;
   - the user clicks the *Esc* key.
   - This window is displayed in front of its "parent" window (it must not
   be used as the main window of the process). The background window is not
   disabled. However, it no longer receives events.
   - You cannot resize or move the window using the mouse; however, when
   performing these actions programmatically, the redraw of background items
   is optimized.
   - Usage: This type of window is primarily used to generate pop-up menus
   related to 3D “bevel” or “toolbar” type buttons.

​And it seems to play nicely with having its window rect changed as
required. ​

really shows how focused I can get on one way of looking at things
sometimes.

On Thu, Jun 29, 2017 at 11:10 AM, Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Try with a Plain Form Window type and activate the On Deactivate event.
> Put a Cancel in that event to close the window.  It can't tell if the mouse
> just moves outside the window (you can do that with an invisible, grow,grow
> object), but a click anywhere else will close the window.
> --
>
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: How to close a modal window if user clicks outside of it?

2017-06-29 Thread Kirk Brooks via 4D_Tech
Chuck,
I think you are right.

On Thu, Jun 29, 2017 at 11:04 AM, Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Thu, Jun 29, 2017 at 2:02 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> >
> > I open a modal dialog within another form. I want to close this if the
> user
> > moused to or clicks on something outside the form. Since I'm working
> with a
> > modal dialog it just beeps.
> >
> > I tried using the On mouse leaving form event. It fires when the mouse
> > leaves any object on the form but not if I leave the form itself. This is
> > close but not too good.
> >
> > Is there some other way to recognize when the user is off the modal and
> > take action programmatically?
> >
> > Thanks
>
>
> i think what you want defeats purpose of a modal window. Not sure if it is
> something 4D should allow.
>
> regards
> Chuck
>
>
> --
> 
> -
>  Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
>  Informed Solutions, Inc.
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D, Sybase & SQL Sever connectivity
>   http://www.informed-solutions.com
> 
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption
> from disclosure as to this communication.
> **
> 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
**

How to close a modal window if user clicks outside of it?

2017-06-29 Thread Kirk Brooks via 4D_Tech
Hi folks,

I open a modal dialog within another form. I want to close this if the user
moused to or clicks on something outside the form. Since I'm working with a
modal dialog it just beeps.

I tried using the On mouse leaving form event. It fires when the mouse
leaves any object on the form but not if I leave the form itself. This is
close but not too good.

Is there some other way to recognize when the user is off the modal and
take action programmatically?

Thanks

-- 
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: Automatic type-ahead on single-column listbox?

2017-06-28 Thread Kirk Brooks via 4D_Tech
David,
Oh, that. Makes me realize how fast you must type to get more than a couple
of letters deep.

Not really great for lists with a few thousand rows I don't think.

Is that actually type-ahead or simply setting the scroll on the edited text
with a wildcard?

On Wed, Jun 28, 2017 at 5:53 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​...
> Set up an hlist and populate it. Sort of a one-column
> listbox without all of the glitter. Give the area focus and start typing.
> You automatically move to the right item.


-- 
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: Automatic type-ahead on single-column listbox?

2017-06-28 Thread Kirk Brooks via 4D_Tech
David,

On Wed, Jun 28, 2017 at 3:04 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> > It does if it’s only a single column. You don’t use a listbox, you use a
> hierarchical list.
>
> ​...
> Hlists don't have all of the nice style
> ​ ​
> features of a listbox, but they do have built-in type ahead, thanks.
>
​
They do? ​Remind me how that works. I don't think I ever knew that.

-- 
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: Contextual Cut, Copy & Paste...?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Robert,

I second Tim's approach - just build your own menu based on the On clicked
event with Contextual Click. I don't think a user could tell the difference
between it being a '4D menu' and an 'OS menu'. I'm not even sure there is
any.

The only thing I'd do differently is not bother with an IP var for the menu
ref. Just use it and loose it:

$menu:=Create menu

APPEND MENU ITEM($menu;"Cut")
SET MENU ITEM PARAMETER($menu;-1;"cut")

APPEND MENU ITEM($menu;"Copy")
SET MENU ITEM PARAMETER($menu;-1;"copy")

etc

// display the menu, get the result, clear the menu
$result:=Dynamic pop up menu($menu)
RELEASE MENU($menu)

Case of
  :($result="cut")
  
End case




On Wed, Jun 21, 2017 at 7:05 PM, Robert ListMail via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Is there a way to use the contextual menu of the host OS (Mac or Windows)
> for Cut, Copy & Paste within 4D?
>
> Thanks,
>
> Robert
>
> **
> 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: Is there a way to get a list of set semaphores?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Okey dokey - here's the list to my feature request:

http://forums.4d.fr/Post//19605563/1/



On Mon, Jun 26, 2017 at 11:23 AM, Kirk Brooks  wrote:

> Just wondering.
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
>
> *- Edmund Burke*
>
>


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

Is there a way to get a list of set semaphores?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Just wondering.

-- 
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: Array Summary Sum Utility Method

2017-06-22 Thread Kirk Brooks via 4D_Tech
Sannyasin,
Ok - between your suggestion and Adams banging the drum I'm going to DL
DataGrid and give it whirl - probably this weekend. Just from the website
it does look pretty cool.

On Thu, Jun 22, 2017 at 11:40 AM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Aloha Kirk!
>
> This is an awesome tip that I will use! In this case, I’m currently using
> objects/json to output reports and lists to DataTables (www.datatables.net).
> I’m really impressed with DataTables. I’m getting into using objects more
> and more, and love them.
>
> Sannyasin Siddhanathaswami
>
> On Jun 20, 2017, 4:33 PM -1000, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com>, wrote:
> 1) make an object array of each record.


-- 
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: Array Summary Sum Utility Method

2017-06-20 Thread Kirk Brooks via 4D_Tech
Sannyasin,

The simple answer to the situation you describe is to loop through the
records and build the arrays.

I seem to recall you're working with v15+, so with that in mind here's how
I'm handling these sorts of situations these days.

1) make an object array of each record.
Depending on your structure you may just put each record into the array
(think SELECTION TO JSON) or you may want to loop through the selection and
pull the relevant bits from the invoice line arrays as well as any linked
tables. The idea is to get all the data you may need to perform
calculations in the object. In your example, if I understand it correctly,
a give item may have more than one sales record of some sort associated
with it. Using my scheme you could include the list of those items as
arrays in the JSON object.

2) Populate your listbox.
I tend to put these object arrays as the first column and hide it (you
can't display an object column without using 4D Write and in this case you
probably don't want to). The remainder of the list box a) can use all
dynamic vars for the columns and b) can easily be inserted from user prefs.
Or you can put them in yourself. The point is you can load each row from
the data in the object array.

Why is this helpful?
For one thing you've got all the data you need encapsulated in the listbox.
That's pretty cool. You may need to have a bunch of fields, some from
different tables, in the data object and only need to have arrays for the
data you actually need to display. Calculations are easy to write, debug
and fast because they are all working on a c-obj in memory.

Finally, it's quick and easy to look through the data array to create
whatever sums and other totals you need.

If you need to do something like make the listbox hierarchical you can opt
to make the data col the last col. This just makes managing the user prefs
a little more complicated but really not too much.

In previous incarnations I've gone from included output forms (long time
ago) and having the use Subtotal to array based listboxes with dozens of
columns when only 5 or 6 would be displayed and this is by far the most
effective approach I've found.

And a big upside for me is this is a way to cache all the changes to the
invoice in memory so the user could decide to cancel. Since all the data is
being calculated and written to the c-obj for each row you can wait until
the user gives it the OkeyDokey before writing to disk. This is an
attractive option to starting a transaction, for example, when the record
is opened. I don't do that sort of thing because it can cascade through the
system as you touch more and more records plus it's a problem is someone
gets halfway through an entry and goes to lunch.

Hope this helps.

On Tue, Jun 20, 2017 at 2:25 PM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Aloha,
>
> Does anyone have a utility method for summarizing (and summing) a set of
> arrays?
>
> For example with Invoice Line Items:
>
> Arrays:
> aItemNumbers
> aItemDescription
> aQuantitySold
> aExtendedSoldAmount
>
> Of course, with invoice line items there are multiple records with item
> numbers. I want a summary array where there is only 1 element with an item
> number, and the aQuantitySold, and aExtendedSoldAmount gets summed.
>
> I know there’s lots of ways to do this, but didn’t want to reinvent the
> wheel if possible.
>
> Thanks!
>
> Sannyasin Siddhanathaswami
> **
> 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
**

About omitted params in 4D commands...

2017-06-19 Thread Kirk Brooks via 4D_Tech
I was just reading a KB tech tip  on OBJECT
DUPLICATE. I started using OD in v13 and really hadn't looked at the docs
for a while. The tech tip is showing how to control the level (or z-axis)
of a duplicated object. Handy, but not my point here.

The thing I was how tolerant the command is to omitted params. Here's the
syntax:

OBJECT DUPLICATE ( {* ;} object {; newName {; newVar {; boundTo {; moveH {;
moveV {; resizeH {; resizeV}}} {; *} )

I have ingrained in me the notion that if I want to pass the 'boundTo'
param but I'm not using variables I'll need to pass something like $nil in
the 'newVar' position. But the tech tip illustrates that I don't by using
this:

OBJECT DUPLICATE(*;"button";"button"+String($i);"button";($i*25);($i*25))

The 'newVar' param is just omitted. Huh?

So, is this a convention that's always existed and I just missed? Or is
this a feature of this particular command? I've got assume it can only work
when the params are unique types. In this case there's only one pointer so
that's pretty easy.

I'm not complaining - just want to understand how this works.

-- 
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: Modal dialog dilemma

2017-06-18 Thread Kirk Brooks via 4D_Tech
Jody,

​Nice post. I've also implemented several of these ​ideas but you're really
going more deeply than I have. My motivation didn't have anything to do
with bleed through. They came about as I was working more and more with
objects and dynamic variables.

On Sat, Jun 17, 2017 at 2:35 PM, Jody Bevan via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 1. On all forms we never use variables.
>
​Assuming you're talking about process variables. I agree mostly but there
are some times when they are still useful. Most recently as a dataChanged
flag. But that could be stored in the process object you t​ouch on later.

>
> 2. We have a generic form that has several objects on it. At runtime we
> will make objects visible or not, and change their titles, positions, etc.
> This permits us to have one form that handles Alerts, Requests, and
> Confirms. We provide more features than that with these dialogs (like help
> buttons, trace, etc). This means this dialog gets used extensively.
>
​I've played with this idea a bit too. Could you talk more about what kinds
of forms or records you're using this for? They are easy enough to
implement in concept but to make them look nice and such has been a
challenge for me. ​

4. Dialogs that a process call up though will need to get the input from
> the user. We accomplish this through an object we call our Process Object.
> Inside the process object a object is created for every running process.
> When a form is opened within the process an object is created for that
> form. When a dialog is opened an object is created within that form object.
> There we set what all the dialog objects are to be, and we also return the
> results from the user input. The form that called the dialog gets the
> information it is looking for from this object. Once the information is
> obtained that dialog object is deleted from memory.
>
​I caught a lot of flak last year when I suggested process variables had
become passe in favor of a single process object for managing the random
bits of information they are usually used for. I must admit I hadn't
thought about this approach. I like it. The form becomes more like a
reflection of the data (stored in the object) instead of the data actually
residing on the form. ​

Are you willing to talk about how you manage the fields and data in the
process object?

​This opens up a lot of options for things like inherited forms too as I
think of it. Instead of having different inherited forms in different sizes
there can be one and the objects simply sized as appropriate. ​

>
> It seems complex and it would be if we had to write the code each time. We
> have written nice generic methods for its use. We also created macros as we
> do for all this stuff that makes it very quick to build a request dialog
> (for example) in our code.
>
​What are some examples of the generic form methods you are using?​

​You know, this also allows for you to create a hell of an error log - you
could ​write the process object to the error record in addition to the
other stuff.

-- 
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: What are some causes of Plugin and Component folder synchronization errors?

2017-06-15 Thread Kirk Brooks via 4D_Tech
Nigel,
Yeah, that sounds like regular rolling on the floor laughing material...

It's a good tip though. Thanks

On Thu, Jun 15, 2017 at 8:48 AM, Nigel Greenlee via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk..Could be i have heard funny things happen with the new protocol..
>
> I can tell you a funny story though about a load balancer.
>
>  I was working on a project(non-4D related) in which we were setting up
> users mobiles phones. The setup made a connection into the company
> infrastructer, we kept getting stuck with some phones just not getting a
> connection..lots of angst and a big blame fest…threats to throw us out of
> the building etc…weeks in(when nearly finished) they found the load
> balancer had a IP in its balancing list that no longer existed-so when we
> started setting up 10 phones at a time one of them would get directed to
> that IP and nothing would happen!
>
> Good luck with network…
>
> Nigel Greenlee
>
>
> > On 15 Jun 2017, at 16:29, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Nigel,
> > I've narrowed it down to some issue with the network. There isn't
> anything
> > particularly huge in the plugin or network folders. But watching the
> actual
> > data transfer (that is, watching the graph on Little Snitch) I see that
> the
> > download just stops and then 4D times out and puts up the "Couldn't sync
> > Plugins folder" message. Just contacted my guy at the colo asking if they
> > installed any load-balancing stuff as first thought. He says no.
> >
> > I wonder if this is an artifact of the 4D network protocol?
> >
> > On Wed, Jun 14, 2017 at 10:14 PM, Nigel Greenlee via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> A few months back I was testing something out that resulted in my
> creating
> >> large files(>2gb) inside my .4dbase(package). When i logged in from
> >> ‘client’ to server i noticed a significant load on folder synching and
> the
> >> synching would then fail.
> >>
> >> It is worth checking you have not ended up with something large in your
> >> folder that is synching to client.
> >>
> > --
> > 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
> > **
>
> **
> 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: What are some causes of Plugin and Component folder synchronization errors?

2017-06-15 Thread Kirk Brooks via 4D_Tech
Nigel,
I've narrowed it down to some issue with the network. There isn't anything
particularly huge in the plugin or network folders. But watching the actual
data transfer (that is, watching the graph on Little Snitch) I see that the
download just stops and then 4D times out and puts up the "Couldn't sync
Plugins folder" message. Just contacted my guy at the colo asking if they
installed any load-balancing stuff as first thought. He says no.

I wonder if this is an artifact of the 4D network protocol?

On Wed, Jun 14, 2017 at 10:14 PM, Nigel Greenlee via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> A few months back I was testing something out that resulted in my creating
> large files(>2gb) inside my .4dbase(package). When i logged in from
> ‘client’ to server i noticed a significant load on folder synching and the
> synching would then fail.
>
> It is worth checking you have not ended up with something large in your
> folder that is synching to client.
>
-- 
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: .ExternalData folder outside of the database folder?

2017-06-12 Thread Kirk Brooks via 4D_Tech
John,
I was initially excited about this external storage option for the same
reasons: lots and lots of image files I needed to store and index and maybe
have the option to edit via external programs (Photoshop or Pixels). This
is not the real intent of the design though.

I think the goal for storing files externally is to speed up queries on
those records. As I understand it when a sequential (non indexed) query is
performed the entire record is loaded into memory. So not loading these big
text/blob/picture fields instantly speeds up that process a lot.

When folks like us look at it as a storage solution we're hacking it into
something different. For me the biggest issue that instantly came up was
the size of the backup files and the time they took to build. You don't (or
didn't, I haven't checked recently) have an option to exclude external data
from the backup. This makes sense from 4D's perspective because 4D has no
way of distinguishing whether that data is super critical or not. Data is
data so it backs it all up.

Ultimately I went with a scheme where I index the documents in 4D and store
them on AWS (and thanks again to Bruno LeGay for his excellent component
for managing this sort of thing). For image files I store two versions: a
thumbnail (300x300) and the full file. There's an argument for storing the
thumbnail in the datafile. I choose not to and that's very likely just a
matter of taste.

Once it's on AWS getting the file is simplicity itself - you simply
reference its URL. To store a changed copy you'll need to re-upload the new
file. And it's cheap. You can use the cost calculator on AWS to work it out
but I suspect it will cost less per month than you spent on coffee today
plus you've got security options galore.

Ping me offline if you'd like to do a phone call and I'll show you how I'm
using it.

On Sat, Jun 10, 2017 at 10:07 AM, John Baughman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> As I read the docs, there is no way to have the .ExternalData folder
> anyplace other than inside the database folder and still have 4D manage the
> files.
> ​
>

​...
>
> My question is, why can’t the path to the default folder be defined by the
> developer or end user?
> ​...​
>
> I don’t see why there couldn’t be a way to designate the location of the
> default folder. Is there a way to do this now that I am missing? Is my
> thinking flawed in some way? Perhaps this is a good idea for a feature
> request?
>

-- 
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: Desktop DBMS engines

2017-06-11 Thread Kirk Brooks via 4D_Tech
David,
Have you had a look at this site:
https://db-engines.com/en/ranking/relational+dbms


On Sun, Jun 11, 2017 at 11:37 AM, David Eddy via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Folks -
>
> Can anyone extend this list with additional desktop DBMS engines they’ve
> encountered… known to be still alive or otherwise.  As we all know, clients
> have an annoying habit of hanging on to working applications long beyond
> their natural life.  Thanks.
> 4D
> dBase & clones
> AlphaFour
> FileMaker (May 2017 ComputerWorld says 1,000,000 users.)
> Paradox
> Mimer
> Clarion
> FoxPro
> QuickBase (from Intuit?)
> Microsoft Access
> Xojo
> Clarion
> R:Base
> Btrieve
> C-ISAM
> - David
>
> “When the green flag drops, the bullshit stops."
>
> **
> 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
**

Vote for improving the folder management in Home on Explorer

2017-06-07 Thread Kirk Brooks via 4D_Tech
Hi folks,
I just posted a featReq (I'm calling them that now) on the forums for
improving the folder management in Home. Take a look and vote it up.

http://forums.4d.fr/Post//19529057/1/

-- 
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: Dynamic Process Variables???

2017-06-06 Thread Kirk Brooks via 4D_Tech
Neil,
That's pretty cool. It never would have occurred to me to use Get pointer
that way.

I've only used dynamic vars on forms. 4D's ability to handle them is pretty
good as you discovered. As far as how long we've been able to do that I
think it's v13 at least. It's been hard for a lot of us to accept this new
syntax and the seeming lack of control that comes with it.

For example being able to pass a nil pointer to LISTBOX INSERT ARRAY for
column, header and footer vars just feels wrong. But 4D accepts it and
creates the var on the fly which you can then reference and in some cases
even type.

Your second example fails because you're addressing a variable before it's
defined which doesn't actually have anything to do with dynamic vars.


On Tue, Jun 6, 2017 at 1:03 PM, Dennis, Neil via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I just created a new database and created a method with this code:
>
> C_POINTER($pArray;$pLongInt)
> $pArray:=Get pointer("Array")
> ARRAY REAL($pArray->;1)
> $pArray->{1}:=7
> ALERT(String($pArray->{1}))
>

-- 
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: How do you force resources to download these days?

2017-06-04 Thread Kirk Brooks via 4D_Tech
David,
I tried using this most recently when I was building some html templates
for display in web areas. I found it problematic but couldn't really
understand why. Simple setup - 4D server running on one machine, update the
resources folder with things like html pages, css, js, etc. On dev machine
call the NOTIFY RESOURCES FOLDER MOD command. On another client machine not
see the changed files propagate. Get frustrated. Restart everything to see
changes happen.

On Sun, Jun 4, 2017 at 8:32 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Mon, Jun 5, 2017 at 10:22 AM, Justin Carr via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > NOTIFY RESOURCES FOLDER MODIFICATION
>
>
> Thanks J. Hmmm. Added in V11. Hmm. I'm clearly the last to know.
>
> Any words of wisdom from the field on use of this command in
> multi-developer mode? I'm trying to update constants around the joint.
> Right now I'm doing EXECUTE ON CLIENT and Execute on client to have each
> machine run the right code locally.
>
> Thanks!
> **
> 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: Custom comments: Lots of tips, more wanted!

2017-06-04 Thread Kirk Brooks via 4D_Tech
David,

On Sat, Jun 3, 2017 at 11:40 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Sun, Jun 4, 2017 at 2:40 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> > You know what else would be good is if constants weren't stored in
> > Resources but in a separate Constants folder. Why? Because they don't
> need
> > to ship with the db if it's compiled and it's a pain to remember to
> remove
> > them after building the compiled app.
> >
>
> Huh, interesting idea. Do you mid submitting that as a feature request and
> see what we get back?

http://forums.4d.fr/Post//19516139/1/

​I bet the option on the build routine is easier and would be perfectly
acceptable for me. ​

> And ultimately it would be preferable for them to be integral to 4D rather
> > than as an add on. ​
> >
>
> Agreed. I've thought so since custom constants were first available in 4D
> 6.5. Holding breath.I think that would mean storing them in the
> struture, which has some downsides and doesn't seem to be the way 4D is
> heading.

​Good point. Maybe what we need is just a more robust editing option? 4DPOP
isn't bad - but like you say it's a little cumbersome. And having some
tools for surveying multiple files for things like duplicates and
repetitions would be good. ​

I'm not sure how best they could integrate them natively in
> design, but it sure would be nicer. Maybe some kind of define statement?
>
> Define(Theme;Label;Value) // Value can be Long, String, Real, or Boolean
>
> Define("Error Constants";"Error level is informational";1)
> Define("Error Constants";"Error level is warning";2)
> Define("Error Constants";"Error level is error";3)
> Define("Error Constants";"Error level is critical";4)
> Define("Error Constants";"Error level is fatal";5)
>

​I'm going to have to try that and see if it makes things easier for me. I
do like the idea of adding them on the fly. Coupled with an (interpreted
only) RELOAD CONSTANTS command it would greatly ease the headache of adding
constants early rather than later. Typically I sketch out a process (I
still use paper or a whiteboard) and then start roughing it out in 4D. Once
the fundamental actions are working I start filling in more error handling,
options and all the stuff that makes it good for users but more
complicated. Sometimes the constants I'm going to want are apparent early
on but more times than not it's not really solid until deeper in.

The reload thing is a deal on apps with an extensive startup process.

-- 
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: v16 Component Compiler error

2017-06-04 Thread Kirk Brooks via 4D_Tech
Nigel,

On Sun, Jun 4, 2017 at 6:15 AM, Nigel Greenlee via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​...
> so it seems someone at 4D needs to pop in to the pop plugs and fix some
> things.
>
​Nice.

​But seriously - why would you ​build an app with 4DPOP in it?

-- 
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: Custom comments: Lots of tips, more wanted!

2017-06-03 Thread Kirk Brooks via 4D_Tech
David,


On Sat, Jun 3, 2017 at 10:30 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:
>
> * Constants for strings as they make @$%@#$%@#% stupid errors from typos a
> thing of the past, well, at least where they use them. This is super
> helpful when working with property names in C_OBJECT. (Really what we need
> are definable schemas for C_OBJECT contents that the compiler checks -
> custom types - but that's a whole different discussion.)
> ​
>
​Agree. ​
​Since I've been using c-obj more and more for parameter passing and just
general data handling in memory I've started using constants more than
before for object keys exactly because of the need for keys to be exact.
With constants the key label can be more semantic (ie: module specific
thingy name) even when the actual key is more generic (ie: "name").

And you suggestion for being able to re-load constants is good.

You know what else would be good is if constants weren't stored in
Resources but in a separate Constants folder. Why? Because they don't need
to ship with the db if it's compiled and it's a pain to remember to remove
them after building the compiled app.

And ultimately it would be preferable for them to be integral to 4D rather
than as an add on. ​

-- 
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: Empty 2D arrays - how to determine type

2017-06-01 Thread Kirk Brooks via 4D_Tech
Chip,
I believe you can use the Type function on the zero array. Given ARRAY
LONGINT($aArray;0;0) you could call:

Type($array{0})

​and it will return Array longint. ​


On Thu, Jun 1, 2017 at 3:14 PM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I need to determine the type of a 2D array, which maybe empty (i.e.
> size 0 x 0), which is at the end of a pointer
> In the method where the 2D array is declared Type(My_Array{0}) returns
> 18 (Array text)
> BUT when the 2D array is passed via pointer (to a component)
> Type($ptr->{0}) returns undefined in an interpreted database.
>
> Any ideas??
> Example (note all typed in email):
> Array text(My_Array;0;0)
>
> $type:=Type(My_Array{0})  //$Type = 18 -- Array text
> My_method(->My_array)
>
> //My_Method
> c_pointer($1;$Array)
> c_longint($Type)
>
> $Array:=$1
> $Type:=Type($Array->)  //$Type = 13 -- Array 2D
>
> if ($Type= 13)
>   $Type:=Type($Array->{0})  //$Type = 5 (interpreted) -- Is Undefined
>   // WTF! ! ! !
> end if
>
>
> Thanks
> Chip
>
> ---
> 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
> **




-- 
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: Procedural Splitter Movement

2017-05-30 Thread Kirk Brooks via 4D_Tech
Wait a minute...

On Tue, May 30, 2017 at 10:55 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> say you have a splitter (which has a numeric data source)
>
​It does?​


assigning a value like
> Splitter:=Splitter-10
> will move it to the left (or up) and other objects will follow
> ​.​
>

​It will? That is fabulous. ​

​Is that documented and I just completely missed it? (Which is totally
possible as you all know.)​

And - does that work for any object?


> but OBJECT MOVE will be shifting its base, so it will not interact with
> other objects.
>
> 2017/05/30 23:49、Stephen J. Orth via 4D_Tech <4d_tech@lists.4d.com 4d_tech@lists.4d.com>> のメール:
>
> Either I’m having a brain-fart, or just not remembering correctly on this
> topic...
>
> If I procedurally move a splitter, will the objects surrounding this
> splitter adjust accordingly? I'm looking for the same response that would
> occur if the mouse is used to move the splitter, except I want to do it
> procedurally.
>
>
> **
> 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: Procedural Splitter Movement

2017-05-30 Thread Kirk Brooks via 4D_Tech
​Steve,
I don't think so - at least I haven't been able to see that happen.
Whenever I do that I also resize the affected objects. ​

On Tue, May 30, 2017 at 8:49 AM, Stephen J. Orth via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Either I’m having a brain-fart, or just not remembering correctly on this
> topic...
>
> If I procedurally move a splitter, will the objects surrounding this
> splitter adjust accordingly?  I'm looking for the same response that would
> occur if the mouse is used to move the splitter, except I want to do it
> procedurally.
>
>
> Steve
>
>
> **
> 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: Web Areas On Form Page >1

2017-05-29 Thread Kirk Brooks via 4D_Tech
Cannon,
I know my solution works on both platforms but since I develop on a Mac I
don't know if it even showed up on the Windows side.

I seem to recall coming to the same conclusion Ingo mentioned - that the
web area isn't instantiated until it's actually displayed.

This is all in v15 , BTW. And using the webkit. I don't know if any of this
changed since or if it's tied to the webkit. Basically I got what I needed
working and moved on...

On Mon, May 29, 2017 at 1:32 PM, Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
> ​
>
> It’s interesting that this works correctly for Steve. I’m wondering if
> it’s because I’ve only tried on the Mac so far and he’s using Windows. Do
> you know if you’ve tried it on both platforms?
>
> --
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: Please give us a split-pane in the Method Editor

2017-05-29 Thread Kirk Brooks via 4D_Tech
You know if every method really on did one thing, and only had a few params
that never changed and ... well then the split screen really wouldn't be
necessary.

But here are the places I really miss it.
1) when I'm passing parameters to a method in a c-obj.
After I'm more than about 15 lines down I would really like to be able to
see the top of the method, where I'd document what's in the c-obj, right on
top of the code I'm working with. Especially if this is a complex branching
situation where I'm more like 100 lines from the top. Even with a large
screen (which I have) it's not as easy. And if the c-obj has more than a
few keys it's even more involved.

2) when I'm working with a single method that calls itself.
I like to put all the actual code for most of my forms into a single
process method I call a 'form controller'. This method will have some
actions that can be called from objects within the method. Like "save" -
the save button, obviously, but maybe also something that causes a refresh,
reset, new record - whatever. The situation is that I need to be sure I
have everything lined up correctly between where I'm working and what the
'save' code is expecting.

3) when I'm documenting the method.
I prefer to put all the documentation at the top of the method in most
cases. In fact I start each method with at least a simple sentence
declaring what it's purpose is. This usually changes over time becoming
more complex - and being able to see the code in question right by the
documentation is a big help.



On Mon, May 29, 2017 at 3:36 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Please give us a split-pane in the Method Editor
> http://forums.4d.fr/Post//19482991/1/
>
> Please vote for this feature request. And if anyone wants to make a better
> argument, please do! It's early here and I'm not at my best yet...
>

-- 
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: Favorite tricks and keystrokes: Please take one and leave on

2017-05-29 Thread Kirk Brooks via 4D_Tech
On Mon, May 29, 2017 at 3:16 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Mon, May 29, 2017 at 11:11 PM, Tim Nevels via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> > I miss the split pane feature too. So useful in long methods. Wish they
> > would bring it back.
> >
> I also miss it. So much.
>
​Me too - I was thinking about this just the other day.​

​Why did they take it out?​

-- 
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: Web Areas On Form Page >1

2017-05-29 Thread Kirk Brooks via 4D_Tech
Cannon,
I had the same problem. I just looked to see how I resolved it. Turns out I
just brute-forced the matter and put that second 'page' onto a separate
form and open it into the window. Looks & behaves just like 'page 2' but
it's not.

I'm actually using multiple pages more conservatively - rarely more than 3
or 4 pages anymore. Either I use dialogs like this (encapsulating the form
actions on the dialog) or use object names to group things together and use
visibility to manage them.

On Mon, May 29, 2017 at 9:12 AM, Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Is there something different about web areas when they are on a form page
> > 1? I’ve used lots of web areas before and never run into my current
> problem and the only thing I can think of that is different is that it is
> on form page 3. Here is roughly what happens:
>
> FORM GOTO PAGE(3)
> //Set up the web area, create an html page, save it to disk, etc.
> WA OPEN URL(*;"waHealthReport";$tHTMLFilePath)
>
> The first time this runs, nothing happens. Subsequent runs work correctly.
>
> Anything I’m missing?
>
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Hill Spring, AB Canada
> 403-626-3236
> 
> 
>
>
> **
> 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: Favorite tricks and keystrokes: Please take one and leave on

2017-05-28 Thread Kirk Brooks via 4D_Tech
Cannon,
Yes! Big plus 1 on this.

I discovered it last year. It's really a huge boon to using array based
listboxes especially if you've also developed a schema for representing the
data objects the listbox displays. Like you say in the past if I wanted to
allow a user to do data entry that was going to involve more data each of
those had to be in a separate array. And if I wanted to let the user
configure which columns of data they wanted to see it just got more
complicated.

Now all the data are in the object array, I can easily allow the user to
choose the fields they want to display (adding or removing from the
listbox) and building the calculations is standardized since there is one,
well defined object to refer to.

As a final feature any changes can be held in the object array until the
user saves or commits them. Useful in some situations.

On Sat, May 27, 2017 at 7:08 PM, Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> One of my favorite new techniques is to use an object array as a hidden
> column in a listbox array. In the old days (before v15 r something or the
> other) I often had array based list boxes which had a bunch of hidden
> columns to store data that I wanted to do something with when the row was
> selected. Now I only need a single hidden column. Each element of the
> object array can store a wealth of additional information about the row.
> And it is really easy to extend what is stored in the object in the future.
> No more adding additional columns and making sure they are updated in all
> the right places. So nice!
>
>
-- 
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: v13 crashes compiled and freezes

2017-05-23 Thread Kirk Brooks via 4D_Tech
Lutz,

Agreed. This is a db that started back in the '90s and has an extremely
complicated scheme of arrays to handle the menus. Then over the years other
devs needed to change or add some functionality and, I think, rather than
try to unravel what was existing added on more menu management for their
purposes. This resulted in a very complex web which I upset by making a
change unrelated to menus at all. I'm going to take a little time and see
if all of that is even necessary any longer. The tools available for menu
management are much better now. When I found myself trying to pull a tech
note out of ACI FTP from 1996 so I could read up on how menus were managed
back then I realized I may be going about this the wrong way.

On Tue, May 23, 2017 at 12:10 AM, Epperlein, Lutz (agendo) via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> My first favorite cause of crashing compiled databases is a negative array
> index. That's very reliable, hard to find.
> The best way to avoid such problems is to code defensively while handling
> 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: ImageMagick

2017-05-22 Thread Kirk Brooks via 4D_Tech
Good catch Tim.

On Mon, May 22, 2017 at 1:57 PM, Jim Hays via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> In case anyone is using ImageMagick these days - something to be aware of.
> I don't use it but I've seen it discussed on the NUG.
>
> https://arstechnica.com/security/2017/05/yahoobleed-
> flaw-that-festered-for-years-leaked-private-yahoo-mail-data/
>
> But maybe you saw this last year:
> https://arstechnica.com/security/2016/05/easily-
> exploited-bug-exposes-huge-number-of-sites-to-code-execution-attacks/
>
>
> HTH,
>
> Jim
> **
> 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: v13 crashes compiled and freezes

2017-05-22 Thread Kirk Brooks via 4D_Tech
OK, I resolved the freezing part - turns out there was an event handler
installed that was filtering keystrokes.

On Mon, May 22, 2017 at 8:19 AM, Kirk Brooks  wrote:
>
> 1) why does 4D freeze completely? I've never seen this before. The error
> dialog is shown but 4D is completely unresponsive.
>
> --
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
**

v13 crashes compiled and freezes

2017-05-22 Thread Kirk Brooks via 4D_Tech
This is my weekend for perplexing 4D issues.

v13.6: crashes and freezes compiled but not a hint of a problem running
interpreted. The exact point of the crash is not even clear.

Here is the snippet of code where the crash is reported:

If (<>vt_CurrProc#ProcType )
  <>vt_CurrProc:=ProcType
  If (Not(<>bCanAcquireMedia))
DisableMenuAcquire
  End if
End if

RW_Lock   //semaphore
InitMenus   //load menu bar & names

$j:=Size of array(as_localMen)

For ($i;1;$j)

-->
​​
If (Length(as_localMen{$i})>1)

   ...

The error in the 4D error dialog is an array range error of al_localMen.
Suspicious given the two lines above it but that's what it reports.

So enabling the debuglog and running compiled:

0 p=6 puid=25 Log level: 4
0 p=6 puid=25 meth: DO_MENUS
0 p=6 puid=25 (0) cmd: Current process (ProcType). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: Current process (ProcType). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: Semaphore("$ReadWriteLock") (RW_Lock). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: SET MENU BAR(1) (InitMenus). 4 ms

4D err dial
​og start...

​
62 p=6 puid=25 form: s_mess; event: OnLoad

63 p=6 puid=25 meth: S_MESS (coreDialog)
63 p=6 puid=25 (0) cmd: Form event (error_HANDLER (coreDialog)). < ms


We get into the InitMenus method, set a menu bar and then there's a pause
of about 60ms before the 4D error dialog begins to initialize itself. That
dialog goes on to report the error as the array range check in the parent
method.

The InitMenu code is:

If (Not(<>InCataloguerMode))
  SET MENU BAR(1)
Else
  SET MENU BAR(3)
End if
  //custom menu names
For ($menuNum;1;Size of array(<>aiFullMenu))
  For ($menuItem;1;<>aiFullMenu{$menuNum})
$menuCode:=String($menuNum)+String($menuItem;"00")
$index:=Find in array(<>as_MItemIDs;$menuCode)
If ($index>0)
  SET MENU ITEM($menuNum;$menuItem;<>at_MItemNam{$index})
End if
  End for
End for

So I'm really stumped by this one.

1) why does 4D freeze completely? I've never seen this before. The error
dialog is shown but 4D is completely unresponsive.

2) what is the the actual error? An issue with the Menu bar (because that's
where the debuglog recording stops) or with the array (because that's what
's reported as the error)?


I have run both the structure and the data through MSC a couple of times.
The only issues with the structure are warnings about missing style sheets
in various forms, none of which are even draw at this point and are petty
common in an old v13 structure anyway.

I'm looking for ideas here.


-- 
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: Corrupted index that won't fix

2017-05-21 Thread Kirk Brooks via 4D_Tech
Tim and all,
Good suggestions. I'm working on something else at the moment and actually
try any of these yet. I did run the standard repair on the data as well.
The issues seems to have to do with the composite index made up of the
record id and table name.

As I think about it I decided using table names was a bad idea because they
can be so easily changed and would corrupt exactly that sort of thing. I
changed it to table number. The fact the error log shows the old name might
be clue.

I'll report back once I can get into it again.

On Sun, May 21, 2017 at 1:00 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On May 21, 2017, at 9:00 PM, Kirk Brooks wrote:
>
> > Checking index pages on Cluster Index 167 on DOX_ATTACH._data ,
> > DOX_ATTACH.record_id (tableName_recordId) [200 errors]
> >
> > I'm not sure what else to do besides dropping the index. I'm assuming,
> > perhaps incorrectly, that if the data are good the index should be able
> to
> > write itself correctly.
> >
> > I'm hoping one of you can give me some insight into how to correct this.
> > The server is running 15.3 on Win 7.
>
> I had a situation with a damaged index and trashed the .4dindx file to
> rebuild all indexes. I ran MSC again and the index damage was still there.
> I did an MSC data file repair and that fixed the problem.
>
> I had the same idea as you Kirk that index damage could be fixed with just
> an index rebuild but in this situation it required a data file repair.
>
> Curious what kind of index damage you had. Mine mentioned something about
> "null clusters" if I remember correctly.
>
> Tim
> Sent from my iPad
> **
> 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
**

Corrupted index that won't fix

2017-05-20 Thread Kirk Brooks via 4D_Tech
I verified a data file and MSC reported the data were fine but the indexes
had some errors. No problem, I think, I'll just trash the index files,
restart and let them rebuild. After doing this twice the indexes are still
showing as :

Cluster Index 167 on DOX_ATTACH._data , DOX_ATTACH.record_id
(tableName_recordId) [OK]
Checking index Cluster Index 167 on DOX_ATTACH._data , DOX_ATTACH.record_id
(tableName_recordId) [OK]
Checking index page addresses on Cluster Index 167 on DOX_ATTACH._data ,
DOX_ATTACH.record_id (tableName_recordId) [OK]
Checking clusters on Cluster Index 167 on DOX_ATTACH._data ,
DOX_ATTACH.record_id (tableName_recordId) [OK]
Checking list of deleted clusters on Cluster Index 167 on DOX_ATTACH._data
, DOX_ATTACH.record_id (tableName_recordId) [OK]
Checking index pages on Cluster Index 167 on DOX_ATTACH._data ,
DOX_ATTACH.record_id (tableName_recordId) [200 errors]

I'm not sure what else to do besides dropping the index. I'm assuming,
perhaps incorrectly, that if the data are good the index should be able to
write itself correctly.

I'm hoping one of you can give me some insight into how to correct this.
The server is running 15.3 on Win 7.

-- 
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: Exploring CALL WORKER vs New process

2017-05-20 Thread Kirk Brooks via 4D_Tech
Tim,
I'm glad you reminded me of this one. I don't have problems with sending
emails so much but the process for downloading them caused problems. I
actually split that process off into a separate database - the downloads
get processed into a watched folder. One of my first thoughts was to split
that task into a preemptive process but I see that won't do any good for
the time being.

On Sat, May 20, 2017 at 12:54 AM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Another area is with plugin calls like 4D Internet Commands -- in
> particular the email commands. Many of them can block 4D waiting for a
> reply from the email server. And since currently all plugin calls happen
> running in the cooperative mode they block every process while waiting for
> that slow email server.
>
> So if you are trying to send an email from 4D Server this blocking effects
> ALL users. Users experience intermittent slowdowns and don't know why. I
> had one situation where I had to move all email operations from 4D Server
> to a 4D Client slave to stop this.
>

-- 
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: Tags in record on 4d.

2017-05-19 Thread Kirk Brooks via 4D_Tech
I'll just add you don't actually need to put the keywords in a separate
table anymore. You can add a text field to your table. Populate the field
with the keywords (or tags) using a space as the delimiter. Then set that
field to have a keyword index and query it using the keyword operator.

I've used this approach since v13 for things like Contact or Partner
records to simplify doing queries for names, for example. In this case a
handy benefit is you can mix in things like the soundex or metaphone codes.
JPR also mentioned this technique in a 4DWT session.

On Fri, May 19, 2017 at 8:04 AM, Guy Algot via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Eric,
>
> I’ve used this for years and called it Keywords. A separate related table
> stores the Contact Key and the Keyword. You can search on the Keywords and
> then relate that selection to Contacts. This was before objects. But like
> Koen said, objects would work as well. Depends on how flexible you want to
> be.
>
> Did you go to the World Tour? JPR demo’d something like this on Day 1.
>
-- 
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: How to trap a form save keystroke in an object method ?

2017-05-18 Thread Kirk Brooks via 4D_Tech
Peter,
How about adding a hidden button to trap for Enter key strokes?

I run all my active objects into a single project method (the 'form
controller' I like to talk about). So I'd have that button call the form
controller and handle the save code the same way the normal save event
would process. This also makes it easy to add a button to trap for the
return key.

On Wed, May 17, 2017 at 6:51 PM, Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi
>
> I rarely come across this problem.
>
> Lets say you have a field with an “On Data Change” object method which
> does field level validation that rejects an entry.
>
> Lets says the form has a default button and the user clicked the “Big
> Enter” key (on the numeric keypad) which invokes a ‘save’ action.
>
> Here’s the problem:
>
>  • the field level validation rejects the entry and restores the ‘in
> range’ value that was already there
>  • but after executing the script 4D still ploughs on and tried to save
> the record
>  • the form level validations don’t trap the error condition because it
> was ‘put right’ at the field level, so 4D saves the form
>
> How can the ‘save form’ keystroke be arrested if the field level
> validation fails ? It appears that FILTER KEYSTROKE(“”) only works if you
> place it in the “On Before keystroke” event. It doesn’t work
> retrospectively after the “On Data Change” script has validated at field
> level.
>
> Peter
>
> **
> 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: Exploring CALL WORKER vs New process

2017-05-18 Thread Kirk Brooks via 4D_Tech
Keith,

First off I'm not clear what the intent of wOpen is - are we modifying the
record or simply displaying it?

If it's only being displayed you don't need CALL WORKER to change it - any
process that can load it can change it. The issue becomes notifying the
display process to refresh itself - which would probably be an On timer
event (if you're running on 4D server it would have to be) or On outside
call (or CALL FORM...) if it's standalone.

If wOpen is allowing the user to edit the record I'd say that's a bad idea
to have outside processes modify a record the user has open - at least
without the user having control and knowledge of what's going on. As I
think about it if this is a case where you're handing off some processor
intensive operation from the form you want to run by CALL WORKER and then
get the results back that's plausible. Personally I'd rather have the input
form receive the data and handle updating the record at the form level than
allow another process to load, modify and unload the record.

It still seems like a lot of extra coding for not much benefit - but I may
not fully get your intention. I do a lot of this sort of thing already
using Execute on server to move the heavy processing off the client and
avoid moving lots of data over the network.

On Thu, May 18, 2017 at 8:22 AM, Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Are there good reasons to keep using "New process" in a situation like the
> following, or can it be replaced by "CALL WORKER"?
>
> //--Base process that shows a list of records from [Table].  Pick a record
> and
> $p:=New process("wOpen";0;[Table]PriKey;*)
>
> //--wOpen - displays the record on the screen
> $key:=$1
> Query([Table];[Table]PriKey=$key)
> $w:=Open Form Window("ShowRecord")
> Dialog("ShowRecord")
>
> Now, "Base process" would like to tell the new process to change a value
> in the record.
> After "Base process" gets the value of $w, it could use "CALL FORM" to
> accomplish that.
> However, if I had used: CALL WORKER ( [Table]PriKey ; wOpen) instead of
> "New process" to create the process, I could, with minor changes in wOpen,
> use "CALL WORKER" to get the process to change the record's values.
>
> //--process that shows a list of records from [Table].  Pick a record and
> CALL WORKER ( [Table]PriKey ; wOpen)
>
> //--wOpen - displays the record on the screen
> PROCESS PROPERTIES ( Current Process ; $key ; $p1 ; $p2 )// $key gets the
> Process Name
> Query([Table];[Table]PriKey=$key)
> $w:=Open Form Window("ShowRecord")
> Dialog("ShowRecord")
> KILL WORKER
>
> Thanks,
> Keith - CDI
> **
> 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: Can't delete methods

2017-05-17 Thread Kirk Brooks via 4D_Tech
Ah - sometimes the Explorer doesn't completely set itself to the 'area' you
clicked on in the left column. So if you 'think' you've selected the
"Methods" you may not have. Click it again and then try the delete again.

On Wed, May 17, 2017 at 7:40 AM, Doug Hall via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> I'm just clicking the minus sign below the project methods list. Is there
> another way?
>
> On Wed, May 17, 2017 at 9:39 AM, Doug Hall <doughall...@gmail.com> wrote:
>
> > Nothing but a system alert sound.
> >
> > On Wed, May 17, 2017 at 9:14 AM, Kirk Brooks via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Doug,
> >> How are you trying to delete them and what happens when you do?
> >>
> >> On Wed, May 17, 2017 at 7:07 AM, Doug Hall via 4D_Tech <
> >> 4d_tech@lists.4d.com
> >> > wrote:
> >>
> >> > I have a few methods that I can't delete. I looked in the method
> >> properties
> >> > and can find nothing out of the ordinary, which might be preventing
> >> this.
> >> > They're not used anywhere in my database, and I even emptied the
> >> methods.
> >> > Can someone please point me in the right direction, here?
> >> >
> >> > Thanks,
> >> > Doug
> >> > 
> **
> >> > 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
> >> **
> >
> >
> >
> **
> 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: Can't delete methods

2017-05-17 Thread Kirk Brooks via 4D_Tech
Doug,
How are you trying to delete them and what happens when you do?

On Wed, May 17, 2017 at 7:07 AM, Doug Hall via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> I have a few methods that I can't delete. I looked in the method properties
> and can find nothing out of the ordinary, which might be preventing this.
> They're not used anywhere in my database, and I even emptied the methods.
> Can someone please point me in the right direction, here?
>
> Thanks,
> Doug
> **
> 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: Schemes for record level access control

2017-05-15 Thread Kirk Brooks via 4D_Tech
David,
Thanks for throwing this in. It really does make more sense to use a
longint even if it is (currently) only a binary choice.

On Fri, May 12, 2017 at 6:03 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Just as a simple point, it's nice to have access values as a number:
>
> 1 2 3 4 5
>

-- 
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: Schemes for record level access control

2017-05-15 Thread Kirk Brooks via 4D_Tech
Hi Jorg,
Thanks much for taking the time to share. The immediate situation I'm
trying to work with isn't as formally hierarchical as your example plus I
need to exclude 'restricted' data from even Read Only. I'm managing the
table & field access separately. ie. permission to even see a given table
is restricted by one's user group. Same idea is applied to fields within
the table. The mechanism is very similar to the one you illustrate.

What I'm honing now is how to identify specific records that may or may not
be accessible and efficiently manage them. Your experience is confirming my
initial take.

On Fri, May 12, 2017 at 5:51 PM, Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> G’day Kirk,
>
> > On 13 May 2017, at 05:42 AEST, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I'd like to hear from some of you who have implemented systems that allow
> > for record-level access control in a 4D database.
>
> Pick me! ;-)
>
> You’re sure you want to discuss this on the list down to the last detail?
>
> Here are some important starting points:
>
> First, forget everything about putting users in groups the 4D-way,
> actually forget/don’t touch the 4D-Access implementation at all.
>
> Now think of access strictly in to ways:  Read Only and Read/Write.
>
> Imagine an organisation structure 5 level deep (relation arrows like in
> 4D):
>
> Organisation <—— Branch <—— Department <—— Unit <—— User (have a table for
> each and you can build your application to be a multi-tenant one)
>
> Define access levels and apply for RO  and  RW (2D array LongInt):
>
> Full access (Designer)  FA
> Org access  OA
> Branch access   BA
> Department access   DA
> Unit access UA
> Author/User access  AA
> NO access   NA
>
> apply these levels to a spread sheet with columns like this:
>
> 4dTable name/#  RO_FA   RO_OA   … —> …  RW_AA   RW_NA
>
>
> - Keep this matrix for each and every user.
>
> At log in time assign the relevant information to interprocess variables
> or to an object.
>
> have the following LongInt reference fields in EVERY table
>
> UserCreated
> UnitCreated
> DepartmentCreated
> BranchCreated
> OrgCreated
>
> Every time someone likes to access the content of a table one has to check
> the access rights like this
>
> (code snippet sample)
>
> Case of
> : ($vlAccess=0)  //No Access
>
> If ($vlStatusField>0)
> QUERY($TablePtr->; & ;Field($TableNo;$vlStatusField)->=-9)
> End if
> $0:=2
> : ($vlAccess=1)  //Author Access
>
> If ($vbWholeTable)  //all non deleted records in table
> If ($vlCreatorField>0)
> QUERY($TablePtr->;Field($TableNo;$vlCreatorField)->=<>vlUserID;*)
> If ($vlDepartmentField>0)
> QUERY($TablePtr->; & ;Field($TableNo;$vlDepartmentField)->=<>
> vlUserDepartment;*)
> End if
> If ($vlBranchField>0)
> QUERY($TablePtr->; & ;Field($TableNo;$vlBranchField)->=<>vlUserBranch;*)
> End if
> If ($vlUnitField>0)
> QUERY($TablePtr->; & ;Field($TableNo;$vlUnitField)->=<>vlUserUnit;*)
> End if
> If ($vlStatusField>0)
> QUERY($TablePtr->; & ;Field($TableNo;$vlStatusField)->=1)
> Else
> QUERY($TablePtr->)
> End if
> $vbAccess:=True
> Else
> $0:=2
> End if
> Else   // in the current selection only
> If ($vlCreatorField>0)
> QUERY SELECTION($TablePtr->;Field($TableNo;$vlCreatorField)->=<>
> vlUserID;*)
> If ($vlDepartmentField>0)
> QUERY SELECTION($TablePtr->; & ;Field($TableNo;$vlDepartmentField)->=<>
> vlUserDepartment;*)
> End if
> If ($vlBranchField>0)
> QUERY SELECTION($TablePtr->; & ;Field($TableNo;$vlBranchField)->=<>
> vlUserBranch;*)
> End if
> If ($vlUnitField>0)
> QUERY SELECTION($TablePtr->; & ;Field($TableNo;$vlUnitField)-
> >=<>vlUserUnit)
> Else
> QUERY SELECTION($TablePtr->)
> End if
> $vbAccess:=True
> Else
> $0:=2
> End if
> End if
> end case
>
>
> This is all I have time for, but I hope that helps.
>
> Cheers
> Jörg
>
>
>
> **
> 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: Schemes for record level access control

2017-05-12 Thread Kirk Brooks via 4D_Tech
Right - so the ultimate permission is the most permissive of all available.

On Fri, May 12, 2017 at 4:56 PM, Alan Chan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> I assume a member might belongs to multiple teams but will a member
> belongs to multiple clubs?
>
> Alan Chan
>
> 4D iNug Technical <4d_tech@lists.4d.com> writes:
> >Hi Alan,
> >Those are the go-to solutions. In my case we aren't using the 4D password
> >system so I can't rely on that. Plus I need actual record level
> >restriction. So to follow your example, I may want a Team to be able to
> see
> >themselves and other teams in their Club (just making this up) but not
> >teams in other Clubs.
> >
> >
>
> **
> 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: Schemes for record level access control

2017-05-12 Thread Kirk Brooks via 4D_Tech
Hi Alan,
Those are the go-to solutions. In my case we aren't using the 4D password
system so I can't rely on that. Plus I need actual record level
restriction. So to follow your example, I may want a Team to be able to see
themselves and other teams in their Club (just making this up) but not
teams in other Clubs.

On Fri, May 12, 2017 at 4:33 PM, Alan Chan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> We restricted record access based on Team (Field related to Team and
> Member table), Module (menu bar), History (Date) and other access such as
> cross team and also by field level such as viewing cost, modifying sales
> price, bypassing margin control
> or credit control, just name a few, through 4D standard user/group access
> feature.
>
> With combination of all of above, we can restrict/control access from
> users on almost all level.
>
> 4D standard user/groups access are extremely helpful for these kind of
> control and we have more than 200 user groups for these purpose.
>
> Alan Chan
>
> 4D iNug Technical <4d_tech@lists.4d.com> writes:
> >Hi folks,
> >I'd like to hear from some of you who have implemented systems that allow
> >for record-level access control in a 4D database. This is the sort of
> thing
> >where we want to prevent unauthorized users from seeing or inferring the
> >'restricted' records.
> >
> >Theoretically it's pretty easy - include a field on relevant tables called
> >'restricted' or some such and the rules are you filter those records out
> if
> >the user's permission doesn't allow them. Simple enough but, as we know,
> >there be devils there. Maybe it's a whole different approach to the
> >structure?
> >
> >I want to hear about the details of what it took to make that work with
> >respect to related records, queries on related records, sorting and so on.
> >
>
> **
> 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
**

Schemes for record level access control

2017-05-12 Thread Kirk Brooks via 4D_Tech
Hi folks,
I'd like to hear from some of you who have implemented systems that allow
for record-level access control in a 4D database. This is the sort of thing
where we want to prevent unauthorized users from seeing or inferring the
'restricted' records.

Theoretically it's pretty easy - include a field on relevant tables called
'restricted' or some such and the rules are you filter those records out if
the user's permission doesn't allow them. Simple enough but, as we know,
there be devils there. Maybe it's a whole different approach to the
structure?

I want to hear about the details of what it took to make that work with
respect to related records, queries on related records, sorting and so on.

-- 
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: Problems with LISTBOX SET FOOTER CALCULATION and dynamic columns (v15)

2017-05-12 Thread Kirk Brooks via 4D_Tech
Hey Lahav,
You are correct - thanks for saying something. It prompted me to go look at
my actual code which is pretty similar:

    get the current doc values obj
$obj:=JSON Parse("{}")
$obj:=IG_get_curDocValues ($igPtr)

For ($i;1;Size of array(aIG_ftrVars))

OBJECT SET RGB COLORS(aIG_ftrVars{$i}->;$color;$bgColor)

OBJECT SET HORIZONTAL ALIGNMENT(aIG_ftrVars{$i}->;Align right)


Case of

: (aIG_ftrNames{$i}="sumSales")

aIG_ftrVars{$i}->:=String(OBJ_Get_Real ($obj;IG sum
subtotal);"###,###,##0.00")

: (aIG_ftrNames{$i}="sumCosts")

aIG_ftrVars{$i}->:=String(OBJ_Get_Real ($obj;IG sum cost);"###,##0.00")

​and so on ...


​I'd forgotten about using text vars in the footers. Do you know if they
changed it in v16?



On Thu, May 11, 2017 at 10:53 PM, lists via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi Kirk,
>
> The issue is the inability to use any of the automatic footer calculations
> such as SUM or AVG in a footer of a numeric column, since regardless of
> what type the column is, the dynamic footer variables are always of type
> Text.
>
>
-- 
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: Problems with LISTBOX SET FOOTER CALCULATION and dynamic columns (v15)

2017-05-11 Thread Kirk Brooks via 4D_Tech
Hi Olivier,
It's so interesting when someone follows up on a post from a year and a
half ago.

I haven't used this code in v16 yet. But in general what I've found most
reliable when fiddling with dynamic variables and listboxes is to let 4D
tell you what it did by using the LISTBOX GET ARRAYS command.

For example, if I add some arrays immediately after I'll call LISTBOX GET
ARRAYS and use the array of pointers to the column variables. For whatever
reason, and there are arguments to be had about why I shouldn't have to do
this, I can't recall it not working. Same with the footer vars - go ahead
and pass a nil pointer (easily derived by putting C_POINTER($nil) in your
method) then use the pointer returned by 4D in LISTBOX GET ARRAYS. Like I
said, 'yes, you should be able to pass a pointer and then use that
pointer.' Sometimes yes, sometimes no. I don't really care - I just get the
pointer arrays and it always works.

I do this so much I found it handy to make a method that takes a listbox
name and returns a specified array (colVars, footerVars, headerVars, etc.)
so I don't have the overhead of directly calling LISTBOX GET ARRAYS.


On Thu, May 11, 2017 at 10:18 PM, Flury Olivier via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk & Miyako,
>
> I am struggling with the same problem, works interpreted but not compiled.
> The type of the dynamic footer variable remains "2" (text). Tested with 4D
> 16.1.
>
> Or did you figure out a way to make it work?
>
> If not, and if this is the way it works (not possible to re-type a dynamic
> variable), then it makes the feature of inserting a dynamic footer variable
> to a listbox useless.
>
> Or should I file a bug?
>
> Best,
>
> Olivier
>
> -Ursprüngliche Nachricht-
> Von: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Kirk
> Brooks
> Gesendet: Dienstag, 29. Dezember 2015 02:31
> An: 4D iNug Technical <4d_tech@lists.4d.com>
> Betreff: Re: Problems with LISTBOX SET FOOTER CALCULATION and dynamic
> columns (v15)
>
> I'll have to try comping later - deep in dev mode at the moment. Have to
> finish this section and clean up to compile and test but I'm optimistic.
>
> On Mon, Dec 28, 2015 at 5:22 PM, Keisuke Miyako 
> wrote:
>
> > I guess it is the result of retro-fitting a new feature (i.e. dynamic
> > listbox using form local variables) without breaking language
> compatibility.
> >
>
> ​Yep - and I'm always talking about this sort of thing. In fact I even
> described doing exactly this to Spencer​ for the array but just choked
> taking it that next little step. Another example of how helpful this forum
> is.
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
> **
> 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
> **
>



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

[OFF] I need an OAuth tutor

2017-05-11 Thread Kirk Brooks via 4D_Tech
I have a project that requires having 4D connect via OAuth. I know this
totally doable but I just keep getting stuck. So, I'd like to hire someone
who knows this stuff to tutor me for an hour or two. I'm thinking we do a
Teamviewer session or similar.

Contact me off line if you're interested.

Thanks

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

<    1   2   3   4   5   6   7   >