Re: Server Process "Frozen"-ish

2017-09-13 Thread Kirk Brooks via 4D_Tech
Steve,
I have a few that I've been running for a long time. #1 is a method that
manages sending emails. Emails created by users and the system go into a
que and then are sent by the server. The method just sits and runs every
few minutes. Another one runs every few minutes to update the current sales
totals that live in arrays in the server process. Client machines grab the
data from there if they are interested. Some guys will stay up until
midnight on the end of the month to get a screenshot of themselves on top.

I've got a number of other house keeping kind of methods that run at
various times. These are controlled by another stored method that wakes up
every few minutes and checks to see if there are any methods to run. This
makes it easy to schedule things that I want to run in off times or on
schedules like once a week or so.

But you have a point about some stored methods bogging things down. Reading
email turned out to be one. So much so I just moved those operations to a
separate database. It just runs every few minutes and checks if there are
emails to download, does so if there are, unpacks the attachments and such
and puts it all in a watched folder for the main db to read in via a stored
method over there.

Uploading to AWS in bulk also turned out to be a bottleneck so I put that
into the email database as well. This has the happy effect of moving that
processing to a different core as well though that's becoming less of a
thing. User's aren't impacted if they run slowly.

I am a big fan of Execute on server as well but that's a different animal.

On Wed, Sep 13, 2017 at 1:38 PM, Stephen J. Orth via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I've given up trying to write and use stored procedures, the Server is
> just too fragile.  I'd be open to anyone telling me you can really use
> stored procedures in a "hard core" way without completely killing all
> connected users performance.
>
> For years now, with each new release of 4D, I've been patiently waiting
> for my opportunity to really utilize the power of the server hardware our
> Clients purchase.  However, each new version I continue to find it is not
> robust enough to really use stored procedures.
>
> --
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: Listbox Spacing Between Columns

2017-09-23 Thread Kirk Brooks via 4D_Tech
Aloha,
Probably the simplest solution is to tweak the format in the number column
and add a couple of spaces at the right.

eg. "$###,##0.00  ;($###,##0.00)  ; -  "

Add more spaces if you like.

On Sat, Sep 23, 2017 at 2:21 PM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Aloha!
>
> I have a listbox column for dollar amounts (aligned right) followed by a
> Description column with text aligned left. Unfortunately, that means the
> text of those two columns are butting up against each other. Is there a way
> to add a bit more space between columns?
>

-- 
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: Listbox Spacing Between Columns

2017-09-24 Thread Kirk Brooks via 4D_Tech
Sannyasin,
Sorry about that - could have sworn I'd used that before.

Next approach is to read the real arrays into text arrays. In this case
since they are just display it doesn't really matter. In lots of cases it's
a benefit using text arrays for user input as it lets you accept formulas
for input and then evaluate them. (eg. "1+34+2.2") Useful for forms where
users are updating real world data. For me that's things like inventory
worksheets.

On Sat, Sep 23, 2017 at 7:40 PM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Excellent idea, unfortunately trailing spaces are ignored. Too bad, as
> that would have been perfect for this circumstance. Any other ideas?
>
>
-- 
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: Listbox Spacing Between Columns

2017-09-24 Thread Kirk Brooks via 4D_Tech
Sannyasin,
It works with any text. Outside of listboxes I let users write formulas for
things like pricing and commissions. It's nice to let them do this in terms
of things they understand so a formula can look like:

P= (Cost * x) + Z
P= (MSRP * (1 - x)) + Z


There are two ways you can evaluate them.
Native 4D code:
You need to have a a process var defined for the result, I use:
'pfcr_price'. Here's a simplified version of a method used to calculate
selling prices. $1 would be a formula like the ones above. x and Z are most
likely static and the cost and msrp vary depending on the item.

$formula:=$1

$x:=$2
$z:=$3
$cost:=$4
$MSRP:=$5

$exe_string:=Price_formula_insert_values ($formula;$x;$z;$MSRP;$cost)
$exe_string:=Replace string($exe_string;",";"")
$exe_string:=Replace string($exe_string;"P=";"pfcr_price:=")

EXECUTE FORMULA($exe_string)

$0:= pfcr_price


Price_formula_insert_values handles inserting the actual values for the 4
variables, x, z, cost and msrp. Then I remove any commas (in v15 they
started choking execution) and swap "P=" for the name of my variable. Now
just execute the line and return the result.

NTK from Rob Laveaux
Since acquiring NTK I've started using Rob's execute function. Preparation
is the same but it works in a single call. Plus he let's you tokenize the
formula which is good if you will be applying it to large data sets.
Another cool tidbit in NTK.

You have to be careful here about how sophisticated you want to get. You
could let users reference any 4D math functions, for example. But you will
need to do the error checking for things like unclosed parens and such. I
keep things pretty simple for the most part. And like I say to provide
on-the-fly ability to do something like add a string of numbers or enter an
amount with a 3.25% discount in a single line is pretty cool.

If you have really sophisticated users you can provide an formula window on
a form, or a listbox line, and give them access to any variables you have
defined.

Speed becomes an issue if you start looking at thousands of operations but
for the flexibility the trade off can be worth it. Or you can look into NTK
as I mentioned.

On Sun, Sep 24, 2017 at 12:04 PM, Sannyasin Siddhanathaswami via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Very cool idea! Does this formula evaluation only work with arrays? Or
> text fields too?
>

-- 
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 it possible to put a SVG file directly on a form?

2017-09-24 Thread Kirk Brooks via 4D_Tech
or does it have to be converted to a picture?

-- 
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: Listbox Spacing Between Columns

2017-09-24 Thread Kirk Brooks via 4D_Tech
Miyako,
That's a really good point.

So the better way would be to get the local thousands separator and filter
that. I suppose the best approach would be to convert each string value to
a real and then string in back in with no formatting. But that gets
complicated when the string is from a listbox cell and the user is making a
change to a formatted number.

Regarding v15 choking on commas - is that specifically a comma or would it
be the case for any thousands separator in an execute statement?

On Sun, Sep 24, 2017 at 4:26 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> even if it doesn't seem applicable to your immediate deployment target,
> it is good practice as a programmer
> to not assume that a thousand (decimal) separator would always be a comma
> (period).
>
> 2017/09/25 7:43、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com d_t...@lists.4d.com>> のメール:
> $exe_string:=Replace string($exe_string;",";"")
>
>
>
> **
> 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 it possible to put a SVG file directly on a form?

2017-09-25 Thread Kirk Brooks via 4D_Tech
Hi Jim,
Thanks for the reply. I recall some discussion a while ago when I was
having issues with text resolution in SVG I was creating and then rendering
into pics. Someone (Miyako?) mentioned placing the file directly on the
form. The thing I wanted was to preserver the 'scalable' part of the SVG.
Plus the files are really small natively. I'm playing with icons again and
looking for a way to embed the files without having to create pic vars.


On Sun, Sep 24, 2017 at 11:25 PM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Of course you can display the source in a text variable (either visible or
> invisible) on a form if you need to save the SVG temporarily. What are you
> trying to do?
>
> On Mon, Sep 25, 2017 at 12:51 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > or does it have to be converted to a picture?
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ===
> >
> > *The only thing necessary for the triumph of evil is for good men to do
> > nothing.*
> >
> > *- Edmund Burke*
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: http://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
>
>
>
> --
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
>
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
> **
> 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 get a the hidden array of a listbox?

2017-09-27 Thread Kirk Brooks via 4D_Tech
This is v15 - how do I do that. Listbox get array would seem like the
answer, and I think it is in v16, but not in v15.

Is it possible?

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: How to get a the hidden array of a listbox?

2017-09-27 Thread Kirk Brooks via 4D_Tech
Thank Doug.

I should have been more specific - I'm trying to get it within a method.
I'm updating some listbox methods and want to be able to grab a pointer to
that array without having to supply it previously.

The hidden array is very cool but seems like a bit of a bolted on after
thought in terms of tools for working with it.

On Wed, Sep 27, 2017 at 11:45 AM, Douglas von Roeder via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk:
>
> Check out the History tab in the upper right of the docs for Managing List
> Box Objects
> <http://doc.4d.com/4Dv16/4D/16.2/Managing-List-Box-
> Objects.300-3433556.en.html>
> It
> indicates that the page was modified in 15R4.
>
> Also, the string "managing row display" is in the V16 docs but not the V15
> so perhaps the feature was introduce in R4?
>
> --
> Douglas von Roeder
> 949-336-2902
>
> On Wed, Sep 27, 2017 at 11:16 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > This is v15 - how do I do that. Listbox get array would seem like the
> > answer, and I think it is in v16, but not in v15.
> >
> > Is it possible?
> >
> > 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
> > **
> **
> 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
**

OPEN COLOR PICKER or OBJECT SET RGB COLORS inconsistencies

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

I was playing with using the OPEN COLOR PICKER command for the first time.
Reasonably cool feature that really is only missing a way to close the
window programmatically and get the selected value directly. But it's way
better than the rgb sliders we had to use for years.

I used a modified version of the approach detailed in this tech tip
. The process is to have an obscure text
area on your form, open the color picker for it to set the background color
and then use OBJECT GET RGB COLORS to get that color since you can't
capture the picked color value directly.

All seemed well and I had a nice display of the selected color and its hex
string. Until I clicked over to the listing of web safe colors in the
picker. The thing is each of those colors lists its hex value and the hex
string I calculated was not the same. Sometimes really off.

For example, hex color selected  -->  color reported:

red: #FF ( or 0x00FF in 4D) --> #FF2600
'burnt orange': #FF6600 --> #FF7C00

light gray: #CC  -->  #D6D6D6

black and white are correctly reported


My first suspicion was the function to string the RGB color to hex. But
this is just the String function. I also wondered if my Hex to longint
function might be wrong even though it's not being used. It's one of the 3
examples of how to do that on the KB and they all give the same answer (but
probably vary in the time they take).

So that leaves a couple of possibilities:

   1. the color returned by OPEN COLOR PICKER is not exactly the value
   selected
   2. the color set by OPEN COLOR PICKER is not exactly the value selected

I can't determine which because I can't know the actual value the color
picker is installing in the form object. I do know that OBJECT SET RGB
COLOR is consistent with OBJECT GET RGB COLORS because if I set and
retrieve a value they are the same. So I think these two methods do what
they say they do.

When I set the object color from the hex string and drag the color picker
over the form area the differences look more pronounced on dark colors. But
trying to quantify these sort of differences without a colorimeter is not
reliable.

Anyone else seen this? Any ideas? Worth filing a bug report?

​This is v16.2 (32 bit) on macos Sierra. ​

-- 
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: OPEN COLOR PICKER or OBJECT SET RGB COLORS inconsistencies

2017-10-01 Thread Kirk Brooks via 4D_Tech
Hi Miyako,
I take the point that the representation of a given RGB value (whatever it
may be) will differ depending on the color space and the capabilities  of
the device that's displaying it. That's why we calibrate our monitors. But
I don't see how that's relevant here. I think we're talking about setting
and retrieving a mathematical value - whatever happens in the display is
based on that value and will go where it may. But at the core that value is
what it is.

I looked at the color picker on Mac Sierra and it doesn't offer the
'device' choice when viewing the web safe color panel - which is where the
HEX values also appear. I tried changing it to device on the CMYK panel but
the results returned by Object get rgb colors still don't agree with the
web safe ones.

The issue here isn't about what the color looks like (another discussion)
but why the selected RGB value differs from the one 4D reports. I would
expect a form object that has it's RGB value set on a Mac to have that same
RGB value on a Windows machine, for instance, even though I know they will
look very different viewed side by side. That's exactly why some of us like
to work with specific RGB values - though that's beyond the scope of what
we're dealing with here.

One place something like this could come up is converting between different
color representations. So if RGB colors are stored in CMYK (just for
discussion - no idea if that's true) switching between the two could
introduce some small variations and that could produce the variances I'm
seeing. I suspect 4D doesn't store RGB natively based on the fact it was
years before we got the choice of using RGB colors but that's just
speculation.

This isn't a big deal but I know some users are going to notice it in this
particular situation.

On Fri, Sep 29, 2017 at 6:17 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> on the color picker panel you should find a cogwheel icon,
> which allows you to pick a color space.
>
> after all,
> RGB is not an absolute definition unless you also specify the color space.
>
> when you use the picker tool,
> it will always return the RGB in the generic (NSCalibratedRGBColorSpace)
> space,
> which is not the same as HTML (sRGB) or device (4D).
>
> when you open the picker,
> the device space is selected by default, so all is fine.
> but when you use the picker tool, it switches to generic,
> so the RGB representation differs to that used in 4D.
> you need to manually switch the space to device,
> or use the value returned by the command (which is converted to device).
>
> > 2017/09/30 0:50、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> > Anyone else seen this? Any ideas? Worth filing a bug report?
> > ​This is v16.2 (32 bit) on macos Sierra. ​
>
>
>
>
> **
> 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: OPEN COLOR PICKER or OBJECT SET RGB COLORS inconsistencies

2017-10-01 Thread Kirk Brooks via 4D_Tech
Miyako,
Well thanks for showing me that. I see what you're talking about now. When
I've dealt with this sort of thing before it was in the context of
reconciling colorspaces within a program like Photoshop to an output device
like monitor, printer or such. It never occurred to me the color picker
would be changing colorspaces depending on the display. After reading up on
'web safe' I get the issue now.

And now I've got a value to point to that matches what I show which is a
good thing.

On Sun, Oct 1, 2017 at 7:14 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hello,
>
> in your original post you mentioned the "web safe" color profile, a
> collection of 216 colors.
>
> find "burnt orange" (FF6600) in that pane, and select it.
>
> switch to "RGB" (second from left) and click the cogwheel.
> select device color space (the one that 4D uses).
>
> you will see that the hex value changes from FF6600 to FF7C00, on the
> panel.
> this is the value that OPEN COLOR PICKER returns.
>
> 2017/10/02 10:30、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com d_t...@lists.4d.com>> のメール:
>
> I looked at the color picker on Mac Sierra and it doesn't offer the
> 'device' choice when viewing the web safe color panel - which is where the
> HEX values also appear. I tried changing it to device on the CMYK panel but
> the results returned by Object get rgb colors still don't agree with the
> web safe ones.
>
>
>
> **
> 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 to do about users who won't follow instructions?

2017-10-04 Thread Kirk Brooks via 4D_Tech
Pat,

There is a real difference between being a developer and being a trainer.
I'm not a particularly good trainer. I just can't get my head around the
beginner mind well enough in these circumstances to be really effective. In
others I can but not in 4D world. So it's usually best I refer such
questions to someone else because it's probably not so much an issue of the
actual technicality of the question as it is communicating it in both
directions. I hear the questions and tend to think of the technical
elements involved. They hear my answers as being long and overly
complicated instead of comprehensive and enlightening. And my emails are
too long. Part of that may be simple mansplaining but part is just the way
I think about it which is useful (mostly) as a developer but just too
freighted for a trainer.

Not much help here to your question I'm afraid. Except to say I don't think
it's your fault.

-- 
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: Number format

2017-10-04 Thread Kirk Brooks via 4D_Tech
That's the way I've always been able to make it work - with the space for
the zero condition.

On Wed, Oct 4, 2017 at 7:16 AM, Tom Dillon via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Try "###.##0,##0;-###.##0,##0; "
>
> Note that (I think) you need a space after the second semicolon.


-- 
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 Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Kirk Brooks via 4D_Tech
Miyako,
Will that trick work compiled?

On Tue, Oct 10, 2017 at 9:06 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> why not simply use Get last table number?
>
> and you don't really need to use SQL to get a table pointer from name,
> just do something like...
>
> C_POINTER($p)
> $name:="Table_1"
> $formula:=""
> PROCESS 4D TAGS($formula;$formula;->$p)
>


-- 
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: [offish]Volume of mail

2017-10-10 Thread Kirk Brooks via 4D_Tech
You know it's not like the French Forum has a legion of posts either.

I just opened the 'v16 Corner' and the first 50 posts span from last Friday
to March (of this year). 50 topics in 7+ months. The 'Current
versions(v16-v15-R)' first 50 is from yesterday to July. These are the
English ones. The French area is a little more active.

At a glance I think this list is fairly representative at least of English
speaking users.

I'll say one thing for interacting via a mailing list - I like being able
to have iNug as a subfolder in one of my email accounts. Makes it easy to
search (I've got the iNug going back to '06), easy to interact with and I
don't have to log into something else. I still find the forums
unflatteringly reminiscent of '90s era forums though supporting images is
nice.

On Thu, Oct 5, 2017 at 12:44 PM, Randy Jaynes via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I think we’re all too lazy to get up and move all the way over to the 4D
> forums.
>
> I do go there for research and find the forums much more active, and with
> far many more users than we see here.
>
> And with 4D themselves pushing us in that direction, I see more and more
> of us who have been on this list for 20+ years posting less and less here.
>
> I don’t think it’s a diminished community because the forums certainly
> seem to be thriving, and I have to admit the ability to add links and
> images and so on makes it easier to illustrate our problems. What I _don’t_
> like is that it’s much more work to get it done.
>
> I think mailing lists are just a thing of the past and a few of us are
> holding on for all we’re worth.
>

-- 
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 Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Kirk Brooks via 4D_Tech
That's pretty cool - being able to get a pointer into a local var like
that.

On Tue, Oct 10, 2017 at 10:17 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> of course it works compiled :)
>
> > 2017/10/11 1:12、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> > Will that trick work compiled?
>
>
>
>
> **
> 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: Print From Web Area

2017-10-11 Thread Kirk Brooks via 4D_Tech
Cannon,
If the web area isn't using the WebKit it's rendered using whatever the
system browser is. I think that would mean that browser would be used to
print it as well but I haven't really tested that.

On Wed, Oct 11, 2017 at 2:58 PM, Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> If I generate a report in HTML and show it in a web area on a form, is
> there a way I can request that it be printed in exactly the same way as if
> it was in Safari or Firefox and printed from there?
>
> Thanks.
>
> --
> 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: Print From Web Area

2017-10-12 Thread Kirk Brooks via 4D_Tech
Hey Cannon,
I would enable the context menu and let the user invoke printing with a
right click on the web area.

You can control access to the inspector with the web area parameter.

On Thu, Oct 12, 2017 at 7:04 AM, Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> What command would I use to invoke the printing in the first place?
>
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Hill Spring, AB Canada
> 403-626-3236
> 
> 
>
>
> > On Oct 11, 2017, at 5:11 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > If the web area isn't using the WebKit it's rendered using whatever the
> > system browser is. I think that would mean that browser would be used to
> > print it as well but I haven't really tested that.
>
> **
> 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: Subrecords with subrecords

2017-10-12 Thread Kirk Brooks via 4D_Tech
Lee,
I assume you mean migrate the data out of that structure and into a brand
new one?

I'd say the thing to do is look at the result of opening it in v16 - which
you already did and said the nested subtable isn't even there. So now add
that table yourself linking as appropriate to the new table 4D created.

The trick is going to be coercing 4D into exporting the second level
subtable (and I just gotta say - what spectacularly bad idea that was) into
some sort of data export. That's gonna be the key - whether you can even do
that or not.

But you said it's compiled. Does that mean you don't have the interpreted
structure? If so I think that's the end of the story. Unless the guys at
tech support can work some magic unavailable to mere mortals.

Stuff like this makes me wonder what the real aim of this sort of perpetual
backward compatibility really is.


On Thu, Oct 12, 2017 at 6:07 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> In v16 the 2nd level subtable isn't moved over. The field is in the 1st
> level subtable. My goal with all this is to write something to migrate the
> data.
>

-- 
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: Subrecords with subrecords

2017-10-13 Thread Kirk Brooks via 4D_Tech
Tim,
On Fri, Oct 13, 2017 at 8:50 AM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If I remember correctly, the 2004 method editor will show sub-subtable
> field references, but as soon as you edit a line with the reference (or
> maybe even retokenize the whole method) it drops the sub-subtable
> references. So you have to replace all these lines of code with EXECUTE
> commands. And you’ll have to write all the sub-subtable conversion code as
> a series of EXECUTE commands for every line with a sub-subtable reference.


​Really interesting hack. ​I'm trying to visualize this - "So you have to
replace all these lines of code with EXECUTE commands."  Do you mean
opening the structure in 2004 will show the names of the sub-subtable
fields so you can then write the code using that name and run it with
EXECUTE and not choke?

-- 
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: QUERY into variable vs. Records in Table

2017-10-19 Thread Kirk Brooks via 4D_Tech
Hi Jeff,

On Thu, Oct 19, 2017 at 10:28 AM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​...
>

all it's doing is waiting for a relatively rare condition to happen (and a
> record to appear in this table).  It might happen at most once or twice per
> day, maybe only once every few days, but when it happens it has to be dealt
> with immediately. It's such a waste to be constantly querying for a record
> that 9 times out of 10 won't exist.
>
​
An approach I use in these cases is (I'm using pseudo code and this off the
top of my head)​:

​// Handle_rare_condition (critical param{;internal param})

Case of

:(Count parameters=1)

//  Write $1 to the [Message table}

$id:=Execute on server(Current method name;0;Current method name;$1;Current
process;*)

Resume process($id)


:(Count parameters=2) //  this part is executing on the server


$done:=false

While(Not($done))

All Records([Message table])

Loop ([Message table])  --  do important stuff

Pause process(Current process)

End while

End case​


​When ​Handle_rare_condition is called with one param it writes that param
to the Message Table. Then it calls itself on the server. Execute on server
will either start the process, if it isn't already there, or since I
included the trailing * simply return the id of the existing process, which
if it exists is probably paused. Resume process($id) is ignored if the
process isn't paused (like when you just created it). Otherwise it wakes it
up.

On the server side $1 is pretty much ignored in this case. $2 might be
useful (I use this same form on Clients for spawning processes so knowing
the parent process number can be useful for messaging). In this case you
could make $1 a magic number of some sort to indicate the part of the code
running on the server. Or you could write the [Message table] record first
and then call this method without any params to initiate it and the parent
process as $1 to indicate the server code.

Whatever, the bottom part of the method starts a loop on the server which
sounds like it could get all records for [Message table], loop them and do
the important stuff. Then just go back to sleep. As someone else suggested
this could be called from a trigger on [Message table] to run whenever one
of those records was created. ​

​This would not involve any queries.​

I like putting the spawning and execution of server side methods in one
method. All the important stuff is in one place.

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

SVG add object question

2017-10-21 Thread Kirk Brooks via 4D_Tech
I must be confused about how this works. I have some SVG files I want to
use to create button icons. These are nice, simple, native SVG. I want to
manipulate them using SVG. I can open a file and export it to a pic
variable just fine. But I'm not able to put that object into a new svg.

For example:

$svgImg:=SVG_Open_file ($path+$aDocs{$n})

$svg:=SVG_Copy ($svgImg)
$pic1:=SVG_Export_to_picture ($svg;0)
SVG_CLEAR ($svg)

This works as expected.

$svg:=SVG_New
$newObj:=SVG_Add_object ($svg;$svgImg)
$pic2:=SVG_Export_to_picture ($svg;0)


This doesn't work. $pic2 is blank even though $svg has received the new
object. I can see that by looking at $svg in the viewer.

What am I missing 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: SVG add object question

2017-10-22 Thread Kirk Brooks via 4D_Tech
Jim,
No, the file is an SVG document made up of XML. SVG_open_picture is what
you're thinking of.

On Sun, Oct 22, 2017 at 2:46 AM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> You are opening an image, not  xml. You should save the source xml also and
> edit it
>
> On Sat, Oct 21, 2017 at 8:48 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > I must be confused about how this works. I have some SVG files I want to
> > use to create button icons. These are nice, simple, native SVG. I want to
> > manipulate them using SVG. I can open a file and export it to a pic
> > variable just fine. But I'm not able to put that object into a new svg.
>

-- 
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: SVG add object question

2017-10-22 Thread Kirk Brooks via 4D_Tech
Hi Keith,
Huh - that sounds like the problem I'm having. Plus I was thinking the
added document ref would remain valid - like adding an object to a c-obj.
That's not the way it works I know now. Makes sense to get the elements and
just add those. That's more or less what I would up doing anyway.

Thanks for the insight.

On Sun, Oct 22, 2017 at 8:24 AM, Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I think I recall a discussion a while back about SVG_Add_object not
> working well when the object being added was another svg document.
> Two svg docs can be "combined" using SVG_ELEMENTS_TO_ARRAYS, and
> SVG_Add_object for each reference in the doc being added.
> This technique doesn't produce a complete merge if doc2 has structures,
> like patterns, that the elements of doc2 depend 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: Primary Key in 4Dv15

2017-10-24 Thread Kirk Brooks via 4D_Tech
Ronnie,

You can use the Generate UUID command to fill or regenerate a the key
fields.

On Tue, Oct 24, 2017 at 2:49 AM, Ronnie Teo via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> Need to seek some advice in converting a client’s database from v11 to v15.
>
> For one of the tables, 4D reported that the primary key contains NULL
> values upon conversion or that the primary key contains duplicate values.
>
> The primary key was defined to be a UUID-type value.
>
> So if some of the records are blank for the primary key, how do we proceed
> from there?
> Also, if 4Dv15 is assigning the primary key when the database is first
> launched, how could it have generated duplicate values?
>
>
> Is there an option to get 4D to re-generate the primary key field again
> for that table?
>
> Failing that, is there an option to instruct 4D to ignore and not track
> those tables?
> Thanks
>
> Regards,
> Ronnie
>
>
> **
> 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: Tip: Exporting to a target folder in a package

2017-10-24 Thread Kirk Brooks via 4D_Tech
Peter,
You know Chuck is right - letting user's store stuff in Resources is
problematic. I'm working on something right now where I came across this.
In my case I'm letting users created button icons. Such files can only be
referenced by buttons only when they are in the Resources folder. But the
resources folder can be rebuilt especially if you have your database
packaged or on 4D server and the user would 'loose' their files. I decided
to use the Active 4D folder to store a backup of the files in question
because I don't want the user to have to think about it. On startup the
database looks there and copies any missing files to the local Resources
folder.

Perhaps you could do something similar? This would allow users to store
their files wherever they like, so long as the database knows about it, and
check the files are synced at startup.

On Tue, Oct 24, 2017 at 3:29 AM, Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have XLIFF applications that generate stuff like custom constants and
> language resources.
>
> Unfortunately, if you use 4D’s desktop navigation commands like “Create
> Document(“”)” or Select Folder and the like, to allow the user (me !) to
> locate the target folder for the export, it doesn’t let you navigate inside
> a package (which is where all my destination folders are since they are in
> the Resource folder for the structure).
>

-- 
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: POP3 Email Processing

2017-10-27 Thread Kirk Brooks via 4D_Tech
On Fri, Oct 27, 2017 at 7:05 AM, Epperlein, Lutz (agendo) via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The main problem with 4D Internet Commands is:
> It blocks the whole application while waiting for and downloading messages
> from the server.


​I moved downloading emails into a separate 4D database for this reason.
It's not as clunky a solution as you might think. The app doesn't require
any users to be logged in. I run it as a separate 4D server instance and it
simply wakes up periodically, checks some email accounts it monitors,
downloads any messages, deals with attachments and writes the data to a set
of watched folders which the parent database checks.

In our case we receive a lot of image files via email which was a real
performance hit​ for all the reasons you list. Separating it out made even
more sense when I began storing all those images on AWS and there was no
need to have them in the parent db at all.

I'm starting to think it might be worthwhile to add the email sending tasks
as well. The parent db drops out-going emails into a watched folder, the
email db sends them.

-- 
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: Placing cursor in text field in included form

2017-10-27 Thread Kirk Brooks via 4D_Tech
Lee,

First, write a method to take an object name as $1 and uses HIGHLIGHT TEXT
to place the cursor wherever you want it.

Second, call this method using EXECUTE IN SUBFORM("subform name";
"MyMethod";*;"subform object name")


On Fri, Oct 27, 2017 at 10:10 AM, Lee Hinde via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> in v15...
>
> Input form with an included layout that is just a text field. User clicks a
> "new" button which adds a related record, date/timestamps it as the first
> part of the field.
>
> User would like the cursor to be placed to the right of the time stamp.
>
> Based on the commented out code, the previous dev tried to do it with :
>
> *POST CLICK*(400;400)
>
> *POST CLICK*(400;400)
>
> I'm wondering if there is a more modern approach available.
> **
> 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: find only partial strings

2017-10-27 Thread Kirk Brooks via 4D_Tech
Peter,
Try this pattern:  "\bseg\b"

When you paste it into 4d the string will change to "\\bseg\\b".

The '\b' is 'word boundary' so this looks for the letters 'seg' between
word boundaries.

On Fri, Oct 27, 2017 at 12:07 PM, Peter Mew via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi
> If I have a document, that has both the word "seg" and the word "segment",
> is there a way I can find the positions of just the word "seg"
>

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

Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
I thought I had such a method but it seems I don't. Before I re-invent this
particular wheel does anyone have this already and are willing to share?

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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
Jeff,
Just display a c-obj in a hierarchical list. I want to mimic the way the
debugger shows c-objects.

On Sun, Oct 29, 2017 at 11:03 AM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> What are you trying to do?
>
> > On Oct 29, 2017, at 1:38 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I thought I had such a method but it seems I don't. Before I re-invent
> this
> > particular wheel does anyone have this already and are willing to share?
>
> **
> 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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
Jeff,
Nice idea. I'd appreciate a look.

On Sun, Oct 29, 2017 at 2:37 PM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> We built one using a couple of JavaScript files and a CSS file that opens
> in a web area. Read-only of course, but interactive and
> collapsible/expandable.
>
> Let me know if you’re interested and I’ll post it here.
>
> > On Oct 29, 2017, at 5:26 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Jeff,
> > Just display a c-obj in a hierarchical list. I want to mimic the way the
> > debugger shows c-objects.
>
> **
> 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: Method to put a c-obj (or JSON) into a hierarchical list

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

Here's a native 4D solution. This is something I just roughed out so
consider it a starting point for your own work.

I noticed, and take advantage of, a couple of interesting aspects of how 4D
handles c-objects.

1) OB GET($obj;"some key"; Is text)  will almost always return the correct
value as a text string.

I say "almost" because I couldn't find this documented as an official thing
and I haven't tried it with stuff like pointers. And it doesn't return
c-objects as stringified JSON. So - almost.

But it does seem reliable for text, numbers, booleans, and nulls. What
about dates? Dates are turned into strings in a c-obj (and JSON) so they
are actually already text. Not to worry. What about blobs? Big long text
fields.

2) OB GET ARRAY($obj;"some array";$aText_arrary)  works with everything
except actual object arrays. And nothing in native 4D works with arrays
containing mixed type (like an array with some number, some text and some
objects as elements, which is valid JSON) though it will parse such an
array.


​This aspect of using text is in keeping with what I've noticed working
with other platforms that use JSON heavily - they frequently make all the
JSON values text. I see this with DocuSign, for instance. Huge JSONs and
every value is wrapped in double quotes. Put me off at first but as I
worked with it came to appreciate the strategy - virtually no confusion
about data type. When I needed a number I knew I had to turn the string
into a number and change it back when writing. Was actually quite simple.

This is the first time I've used the 'Additional text' parameter on a
hierarchical list. I use it for the 'value'. The docs say it's a string
which suggests it could hold up to 255 chars. I decided to limit this to
100 for cosmetic reasons. Since a text key could have a lot more data than
that I put the entire data value into another custom parameter I call
'c_data' as hat tip to XML. Again the docs are a little unclear about
whether this is text or string. I'm thinking text and I'm also thinking I
wouldn't use this approach if I know I've got big text blocks in this JSON.

​A real draw back to using the hList is I can't figure out how to make the
'Additional data' part enterable. The keys are enterable is you make the
list enterable. ​

​Nonetheless it does what I wanted: take a c-obj and display it in a
hierarchical list. ​


==
  //  Json_to_hList
  // Written by: Kirk as Designer, Created: 10/29/17, 04:06:00
  // --
  // Method: Json_to_hList (c-obj; ptr; ptr)
  // $1 is c-obj
  // $2 is ptr list var
  // $3 is ptr to itemRef longint
  // Purpose: tranfer the c-obj to an hList

Err_check_methodParams (3;Count parameters;Current method name)

C_OBJECT($obj;$1)
C_POINTER($2;$3)
C_LONGINT($i;$n;$j)
C_TEXT($errMsg)

$obj:=OB_new
$obj:=$1
$list_ptr:=$2
$itemRef_ptr:=$3

$list:=New list  // this list will get this c-object
$list_ptr->:=$list

ARRAY TEXT($aKeys;0)
ARRAY LONGINT($aTypes;0)

OB GET PROPERTY NAMES($obj;$aKeys;$aTypes)
SORT ARRAY($aKeys;$aTypes;>)

$n:=Size of array($aKeys)

For ($i;1;$n)
  $itemRef_ptr->:=$itemRef_ptr->+1
  $itemRef:=$itemRef_ptr->  //  the itemRef for this item

  Case of
: ($aTypes{$i}=Is object)
  $subList:=New list
  Json_to_hList (OB Get($obj;$aKeys{$i};Is
object);->$subList;$itemRef_ptr)

  APPEND TO LIST($list;$aKeys{$i};$itemRef;$subList;False)
  SET LIST ITEM PARAMETER($list;$itemRef;"type";$aTypes{$i})

: ($aTypes{$i}=Object array)
  $arrList:=New list

  ARRAY OBJECT($aObjs;0)
  ARRAY TEXT($aText;0)
  OB GET ARRAY($obj;$aKeys{$i};$aText)  //  most accomodating
  OB GET ARRAY($obj;$aKeys{$i};$aObjs)

  For ($c;1;Size of array($aText))
$value:=$aText{$c}
$thisKey:=$aKeys{$i}+"["+String($c)+"]"

If ($value="[object Object]")  // this is an object
  $subList:=New list
  Json_to_hList ($aObjs{$c};->$subList;$itemRef_ptr)

  APPEND TO LIST($arrList;$thisKey;$itemRef;$subList;False)
  SET LIST ITEM PARAMETER($arrList;$itemRef;"type";$aTypes{$i})
Else   //   use this
  If (Length($value)>100)  // could be 255
$c_data:=$value
$value:=Substring($value;1;100)+"..."
  Else
$c_data:=""
  End if

  APPEND TO LIST($arrList;$thisKey;$itemRef)
  SET LIST ITEM PARAMETER($arrList;$itemRef;Additional text;$value)
  SET LIST ITEM PARAMETER($arrList;$itemRef;"cData";$c_data)
  SET LIST ITEM PARAMETER($arrList;$itemRef;"type";Is text)

  $itemRef_ptr->:=$itemRef_ptr->+1
  $itemRef:=$itemRef_ptr->  //  the itemRef for this item
End if
  End for

// 
  APPEND TO LIST($list;$aKeys{$i};$itemRef;$arrList;False)
  SET LIST ITEM PARAMETER($list;$itemRef;"type";$aTypes{$i})

Else
  $value:=OB Get($obj;$aKeys{$i};Is text)

  If

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
To follow up a little bit -

After working with the above code I'm starting to really like it.

First a correction, where it says " $subList:=New list" change it to "
$subList:=0".
As soon as the next line is executed $sublist gets assigned a new list
anyway and this is a memory leak.

The other change I made is to write the full path to the key as another
parameter. The benefit with this is I have that path to use for updating
the c-obj when something is changed.

It turns out to be pretty simple to handle editing the values. I added an
enterable variable to the form and hide it. When I double click on the
display hList I can get all the relevant bits easily:

: (Form event=On Double Clicked)

GET LIST ITEM(Self->;*;$itemRef;$itemText)

GET LIST ITEM PARAMETER(Self->;$itemRef;Additional text;$value)

GET MOUSE($x;$y;$mousebutton)

GET LIST PROPERTIES(Self->;$appearance;$icon;$lineHeight)

OBJECT GET COORDINATES(Self->;$left;$top;$right;$bottom)


​And with a little math determine the x,y and width of where the ​to
position my hidden variable relative to the hList:

$n:=($y-$top)\$lineHeight  //  n lines from top of the list

$y:=$top+($n*$lineHeight)

$x:=$left+150  //  the 150 is arbitrary

$width:=$right-$x-18  //  18 is for the scroll bar


​Then just move it into place, make if visible and put $value into it. This
is when I realized having the full path to the value is useful - much
easier than having to work it out by walking back up the 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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Hi Ortwin,
Nicely done.

In this case I want to be able to view and edit the json easily. This is a
developer tool I'm building but the solution is really all hierarchical
list based. The key for me is being able to edit the json value without
messing with the key. This is where I discovered the Additional text
parameter of an hList is useful. It's really the first time I've had reason
to use hList parameters to be honest. In v2004 I used hLists extensively
for various data display chores but since v13 and the improved listboxes I
use very few. This is the first time they are a superior solution and the
parameters provide the extensibility I need.

Here are a couple of screenshots to show what I'm doing:

https://www.dropbox.com/sh/8r72qwgs6lqa2wo/AAB_0--YFCwGMzdJu9tat0oVa?dl=0


One shows what a json looks like in the hList. The other shows how the
hidden var looks allowing the user to edit the value. None of that would be
particularly useful without the ability to include data like the full key
and even the data type, if you wanted that, in the parameters.

Like I say I happen to be using this for JSON but it could be extended to
any key:value kind of hierarchical list.


On Mon, Oct 30, 2017 at 12:48 AM, Ortwin Zillgen via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> some reading
> 
>
>
>
>
> Regards
> O r t w i n  Z i l l g e n
> -
>    
>  
> member of developer-network 
>
> **
> 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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Koen,
I like that one.

I wouldn't think it would be very difficult to get the data back into 4D.
You could 'push' it with js using the 4D callback approach Tim Penner
writes about here: http://kb.4d.com/assetid=77177. I've really found that
useful.



On Mon, Oct 30, 2017 at 7:46 AM, Koen Van Hooreweghe via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> Same idea as Jeff. But I'm using jsoneditor (https://github.com/josdejong/
> jsoneditor <https://github.com/josdejong/jsoneditor>) in a web area to
> display objects.
>
> Its an editor, but I have only used it to display an objects content.
> Haven’t tried to get the modified data back to 4D.
>
> HTH
> Koen
>
> > Op 29 okt. 2017, om 22:26 heeft Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> het volgende geschreven:
> >
> > Just display a c-obj in a hierarchical list. I want to mimic the way the
> > debugger shows c-objects.
>
>
>
> 
> Compass bvba
> Koen Van Hooreweghe
> Kloosterstraat 65
> 9910 Knesselare
> Belgium
> tel +32 495 511.653
>
> **
> 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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Miyako,
I've taken to always specifying the type when I use OB GET except in cases
like copying a key from one object to another. I like that OB GET doesn't
throw an error when it's typed and the key doesn't exist.

It would be interesting to hear about how they are able to parse mixed type
json arrays sometime, as I think about a little more.

On Sun, Oct 29, 2017 at 5:28 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I think that's because the assignment operator is typically over-ridden by
> a toString() method or something similar in template or class based
> languages.
>
> anyway,
>
> 4D is a strongly typed language, so the use of the 3rd argument "Is text"
> does not remove the need to declare the left operand.
>
> if you
>
> $t:=OB Get($o;"foo";Is text)
>
> then you must
>
> C_TEXT($t)
>
> to make it work in compiled mode.
>
> > 2017/10/30 7:57、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> >
> > ​This aspect of using text is in keeping with what I've noticed working
> > with other platforms that use JSON heavily - they frequently make all the
> > JSON values text.
>
>
>
>
> **
> 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: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Hey Tim,

Good point. I thought it might be an issue between 32 and 64 but I think I
was just conflating the effect when dealing with other data types. ie.

C_LONGINT($i)
C_OBJECT($obj)

$t:=OB Get($obj;"key")  //  no error
$i:=OB Get($obj;"key")  //  ** error
$i:=OB Get($obj;"key";Is longint)  //  no error


Or it could be when I was looking at compiled code. I haven't tested this
rigorously yet. It's pretty helpful that it 'defaults to text' as it were.


On Mon, Oct 30, 2017 at 12:20 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Oct 30, 2017, at 2:00 PM, Kirk Brooks wrote:
>
> > I've taken to always specifying the type when I use OB GET except in
> cases
> > like copying a key from one object to another. I like that OB GET doesn't
> > throw an error when it's typed and the key doesn't exist.
>
> Hi Kirk,
>
> I did not know that if you include the type in OB GET and the property
> does not exist in the object you don’t get an error.
>
> I did a quick test of this with this code and did not get an error.
>
> C_OBJECT($o)
> C_TEXT($test_t)
>
> $test_t:=OB Get($o;"theProperty")
>
> $test_t:=OB Get($o;"theProperty";Is text)
>
> Is this a runtime error you get only when compiled?
>
> Tim
>
> 
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.com
> 
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
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: pointers to arrays

2017-10-31 Thread Kirk Brooks via 4D_Tech
Peter,
This is easy to do with local arrays and dynamic variables. It looks like
you only need to build text arrays. You can declare a local array, ARRAY
TEXT($aText2d;0;0). Then you can resize this to add more 'columns' as
needed and populate them.

Next you need to populate the listbox. First delete all the existing
columns (if any) then insert the number of columns you need. To use dynamic
vars you pass Nil for the column and header vars. Let's say you need 4
columns, it looks like this:

LISTBOX DELETE COLUMNS(*;"listboxName";1;LISTBOX GET NUMBER
COLUMNS(*;"listboxName"))

C_POINTER($nil)

For($j;1;4)

LISTBOX INSERT COLUMN (*;"listboxName"; $j; "col_"+string($j); $nil;
"hdr_"+string($j); $nil)

$colPtr:=object get pointer(Object named;"col_"+string($j))  //  now 4D has
created a variable for the column and we can get its pointer

COPY ARRAY($aText2d{$j};$colPtr->)  //  and copy the data to that array

End for

​Even if you need mixed data types I'd still use text arrays for handling
the display and user interface and do the data conversion on in the
background. You can use the same approach with different types of arrays
but it's a lot more work whereas converting to and from text is easy. ​And
this works complied.

D
​oes that make sense? ​Do I get your need correctly?

On Tue, Oct 31, 2017 at 12:42 PM, Peter Mew via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thank You
> And How do I create the Arrays in the First Place
> -pm
>
>
-- 
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 to put a c-obj (or JSON) into a hierarchical list

2017-10-31 Thread Kirk Brooks via 4D_Tech
Tim,

As we all know this sort of thing isn't what I'm particularly good at - but
maybe it's the case that the compiler hits the -20007 error before getting
to the more specific characterization that it's caused by incompatible
types. If it's not that then I agree it would be nice if the messages were
the same.

I wan't aware that the error handler would get tripped by that though. That
may be the buried lede here - and an argument for installing error
handlers. Makes it easier to run interpreted and mimic compiled.

Wouldn't it be cool if we could toggle the interpreted mode to run in
strict typing mode to mimic compiled?


On Tue, Oct 31, 2017 at 4:08 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​...
> They are supposed to make interpreted code produce the same kind of error
> messages that occur in compiled code. This is an example of that not being
> done. Obviously the guys doing the compiler work don’t talk to the guys
> that are doing the interpreter work.




-- 
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 to put a c-obj (or JSON) into a hierarchical list

2017-10-31 Thread Kirk Brooks via 4D_Tech
Er - "I wasn't aware the error handler would get tripped by line 14" is
what I meant to type.

On Tue, Oct 31, 2017 at 5:09 PM, Kirk Brooks  wrote:

> I wan't aware that the error handler would get tripped by that though.
>


-- 
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: [Warning] Settings properties values on object field by object notation

2017-11-01 Thread Kirk Brooks via 4D_Tech
Tim,

On Wed, Nov 1, 2017 at 10:13 AM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Nov 1, 2017, at 11:04 AM, Keisuke Miyako wrote:
>
> > like a global preference, to the effect of
> >
> > "Call OB Copy implicitly when performing object assignments"
> >
> > it is an interesting point of view,
> > to frame it as an issue of the assignment operator being different,
> > as opposed to how objects and their properties are different "because
> they are references".
>

I agree with you it would be great to have a specific operator. To me that
would be :==  to mean OB COPY instead of OB ASSIGN REF (or whatever what
happens now should be called). That way there would be no ambiguity about
you want which is important for shared code or components.
No idea how practical that is since it would only be valid with a
particular data type. I would love to see  == added as a type specific
comparator too but that's another thread.


>
> I like that idea. If you are an “expert” or an optimization fanatic
> working to reduce every millisecond and every byte of memory used, you turn
> the preference OFF. Everything works like it currently does. You know what
> your are doing and if you make a mistake, it’s on you.
>

​Thinking about this - let's say I have a situation where I regularly need
to use APPLY TO SELECTION to all or a large number of records​ (large =
100ks or a million) and these might be records in a 'mature' structure so
they may have lots and lots of fields including some object fields and
maybe even some blobs and big text fields (all stored in the record for
sake of argument). The time to run this command will depend on how many
records actually have to be written to disk. If the ATS is something like a
method that marks records as "done" if some criteria is met most, maybe
all, records might not be changed. This wouldn't be an optimization of
milliseconds if each record was re-written even if it didn't change. Just
speculating but this is could explain why 4D does what it does. Of course
if a method is applied that updates the 'done' key in an object field...
it's good we know to also make some field level mod to trigger the save
action.

OTOH - if I have a database where such situations would never occur (though
I hate to assume 'never') and I use object fields a lot (and I do) having
the option to tell 4D to always rewrite a record on save would be useful.

This doesn't bother me really. Sometimes I use 4D to build a race car and
sometimes I use it to build a tractor. The cool thing is I can use it to
build both. The complication is I can use it to build both. It's up to me
not to put 4' tall tires on the race car and not to put the high speed
transmission in the tractor even though I can.

My perspective - this is a quirk of 4D resulting from mashing up JSON,
about as loosey goosey a data transfer protocol as you can get (well,
there's REN), with a strictly typed language. It works but there are
issues. This is an issue. Which means it needs to be known and documented.
I don't want to beat up on the folks maintaining the docs so I agree with
the earlier comment about the value of user (developer) comments on the
docs for calling out such things.

-- 
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: [Warning] Settings properties values on object field by object notation

2017-11-02 Thread Kirk Brooks via 4D_Tech
+1 - all of it

On Wed, Nov 1, 2017 at 9:56 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thanks to TIm and Brian for responding here, always appreciated.
>
> There is no lack of clarity from 4D that the official channel is to post on
> the forums. Before that, it was bugs.4d.fr. That's always been clear.
> Heck,
> I can't even count the number of times I said that on this list over the
> years. Of course when I said it, I didn't really think much good would come
> from it. I can open up 4D today and point out tons of bugs (cosmetic,
> usability, functional, and crashing) that have been known about for years
> and versions. So, yeah, reporting bugs doesn't have a lot to do with bugs
> getting fixed.
>
> Pardon me for being so simple minded, but what remains completely unclear
> is why customer information is ignored. See, that's the issue: You've got
> customers sending you information, you know what they say, and you say
> "nope, doesn't count." That's about 4D's relationship with your customers,
> it's not about your customers doing things wrong. "Posting on the NUG
> doesn't count" just feels like a weak cop-out. That 4D doesn't see this, I
> just don't understand.
>
> If you guys used any sort of normal, commercial bug-tracking or forum
> platform, I think the position "do everything there" would be a lot more
> tenable.  But a hidden bug system (which I still have no access to because
> of my hemisphere) and a home-made forum system in 2017? You just have to
> accept that that's not going to work for some people. For good reason.
>
> I've tried the Forums. While 4D Engineers participate there a little, I
> heard nothing form the Product Team. Ever. And from Engineering, I mostly
> heard or observed that posts were being put in the "wrong" forum, and that
> any sort of design critique wasn't welcome. You can say that a feature is
> not working correctly, but that a feature or feature set has a design flaw?
> Not a good reception. At all.
>
> The question is, do you want to make 4D better? Do you want to make 4D more
> reliable? Yes or no. Blowing off customer input = "no". Making it harder
> for customers to provide input = "no". Not providing feedback on bug status
> = "no." Not documenting the tools properly = "no". Calling bad design
> "standard behavior" = "no." Telling people that its' down to us to track
> down a bug that freezes the server and that 4D isn't actively investigating
> it on their own? Yeah, that's most definitely "no." Giving people a hard
> time for pointing out flaws in the *design* of features, also "no".
>
> Your business, your choice.


-- 
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: Normalization question

2017-11-08 Thread Kirk Brooks via 4D_Tech
Doug,
That's a really good resource for ideas for structuring things. I haven't
looked at in a long time - it's grown quite a lot.

On Wed, Nov 8, 2017 at 12:23 PM, Douglas von Roeder via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> This is a link  to a
> treasure trove of data models. I checked a couple of the models in the
> "employees" section and the generic model
>  generic_model/index.htm>
> might provide some ideas.
>

-- 
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: Counting occurrences of specific characters In a document

2017-11-08 Thread Kirk Brooks via 4D_Tech
Kirk,
One trick for counting the number of characters is :

$n:=length($text)
$text:=replace string($text;$char;"")
$n:=$n-length($text)


That will work for your text file.

Excel is more complicated. If it's .xls it's basically XML. Miyako made a
component for working with them that may work for you. Check out his github
site. You may be able to just parse the XML too, I haven't ever tried so
can't say for sure.


On Wed, Nov 8, 2017 at 5:42 PM, rooftop99--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> What is the most efficient way to count the number of occurrences of a
> specific character in a large document?  Specifically, What are you doing
> to count Excel rows (or CR delimited text files) in a similar scenario?
>

-- 
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: Slow characters visualization

2017-11-10 Thread Kirk Brooks via 4D_Tech
Ferdinando,
If you happen to have some forms open that include subforms and you have
the subform open too it can cause the design process to use a lot of CPU
cycles which might cause your system overall to behave as you describe.
This was especially true if the subforms had listboxes. I haven't noticed
this in a long time and this specific issue may have been resolved.

The thing is something is using a lot of processing power in the design
process. It's probably doing some sort of dynamic redraw or update.

On Thu, Nov 9, 2017 at 11:15 PM, stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I All,
>
> I notice that the slow in characters visualization, is always, even if the
> method have 10 rows.
> When i write into one method the cpu consuming of 4D V15.5 is around
> 12/15%, like if 4D do a big work in interpretation of a code that i write
> into a method.
> This only on 4D V15.5 in other version of 4D all is normal.
>
> Only i have this issue?
>
> Thanks
> Ferdinando
>
> Message: 1
> Date: Mon, 6 Nov 2017 22:03:19 +0100
> From: "stardata.info"
> To:4d_tech@lists.4d.com
> Subject: Slow characters visualization
> Message-ID:<042ac318-dd04-b313-c069-4312c66f9...@stardata.info>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Hi all,
>
> I use 4D V15.5 on windows.
> Sometimes when i write a method the editor is not fast responsive, in
> fact i can see the character digited only after one second.
>
> Someone know the reason, and how i can solve?
>
> Thanks
> Ferdinando
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



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

List item parent question

2017-11-13 Thread Kirk Brooks via 4D_Tech
I'm working with hLists for the first time in a long time. I have a hList
with 3 hierarchical levels. I select 'this item' at level 3 and want to get
the Parent.

A

B

  B-sub1

  B-sub2

this item

  B-sub3

C

D


​I expect the parent is B-sub2. List item parent returns the parent as B.​

I verified there are unique itemRef values for all the list items and this
is v15.5. ​

​Is this expected behavior?
​​


-- 
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: Debug window messed up

2017-11-13 Thread Kirk Brooks via 4D_Tech
Really? It's that simple?

Did you just make that up?

On Mon, Nov 13, 2017 at 8:55 AM, Vincent de Lachaux via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Create a method with just one line : TRACE
>
> Run the method with the shift key down will restore the debug 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: List item parent question

2017-11-13 Thread Kirk Brooks via 4D_Tech
Sujit,
Yeah, I thought about that too but no error gets thrown.

On Mon, Nov 13, 2017 at 10:46 AM, Sujit Shah via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> No
>
> Perhaps an error in 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: wa open url command in v15

2017-11-16 Thread Kirk Brooks via 4D_Tech
Chuck,
Yeah, using WA OPEN URL to open pdfs was a great hack for a while. Those
were the days. I do this a lot and finally had to abandon it because of the
sorts of issues you report. I resorted to this method for opening files. I
am certain I got most of the details from reading something Miyako posted.
I've been using if for a while and works with PDFs and pretty much any
other type of file.

  // Method: File_open (text) -> text
  // $1 is full path to a file
  // $0 is err msg
  // Purpose: attempt to open the file on the current user machine
  // Works on Mac & Windows
  // ** Will not open files on 4D Server **
C_TEXT($1)
C_TEXT($errMsg;$0)
C_TEXT($script)
Case of
  : (Application type=4D Server)  // no, no no
$errMsg:="You can't use this command on the server."

  : (Count parameters=0)
$errMsg:="No document specified."

  : (Test path name($1)#Is a document)
$errMsg:="Invalid document path."

  : (Folder separator=":")  // macintosh
$script:="open \""+Convert path system to POSIX($1)+"\""
SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
LAUNCH EXTERNAL PROCESS($script)

  Else   //  windows
$script:="Invoke-Item '"+$1+"'"
$errMsg:=PS_ExecuteCommand ($script)
End case

$0:=$errMsg

​and the Powershell execute method is:

​
  // PS_ExecuteCommand ( text{;text}) -> text
  // $1 is command
  // $2 is exe mode - default is 'synchronous'
  // $0 is result - includes error string
  // Purpose: executes $1 in powershell  - only valid on Windows machines
  //  $PS_Call:="powershell &"+Char(Quote)+$1+Char(Quote)

C_TEXT($1;$Command)
C_TEXT($2;$ExecutionMode)  // synchronous (default) | asynchronous
C_TEXT($0;$Result)
C_TEXT($Input;$Error;$PS_Call)

$Command:=$1
If (Count parameters>1)
  $ExecutionMode:=$2
Else
  $ExecutionMode:="synchronous"
End if

$Result:=""
$Input:=""  // input stream not supported

$PS_Call:="powershell "+Char(Double quote)+$Command+Char(Double quote)

SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
  // 
  //
If ($ExecutionMode="asynchronous")
  SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
  LAUNCH EXTERNAL PROCESS($PS_Call)
Else
  SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"true")
  LAUNCH EXTERNAL PROCESS($PS_Call;$Input;$Result;$Error)
End if
  //
  // 
If ((OK=0) | ($Error#""))
  $0:="Error: "+$Error
Else
  $0:=$Result
End if


On Thu, Nov 16, 2017 at 9:13 AM, Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> I am using this command to open a pdf file on a 4D form. It does not work
> on everyones mac. (I don’t know about PC’s) I have the web area set as
> follows:
> opem external link checked
> Use integrated web kit checked
> Access 4D methods checked
>
> Preview is default pdf viewer on both machines that work and those that do
> not.
>
> Even with that setting, on my machine PDFs open in my 4D window with an
> acrobat look and feel
>
> On another machine they open with a preview look and feel.
>
> Is there anyway I can set to use preview on a MAC and reader on a PC
> programatticaly
>
> Any ideas why one machine might be having this problem. That machine has
> acrobat professional installed
>
> Thanks and 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 Server 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

Re: Drop Down Menu Form Event

2017-11-17 Thread Kirk Brooks via 4D_Tech
Jim,
I use On click as well, but I rarely use dropdowns that are enterable
(combo lists). In that case you want to recognize the data change event to
do whatever in that case. Or turn off the On data change event and make the
list non-enterable so you only have On clicked events to handle.

As far as 'causing' other events On click doesn't do that but it does
register on the form itself. So, when you click a button the button object
fires an On click event if you have that event enabled for it. After the
button method runs the On click event is passed on to the form method and
if you have On click enabled on the FORM that method runs.

I suggest you figure out which events you need by turning them all off and
then enabling the ones you need. By default 4D enables a lot of form
events. It's a holdover from the ancient event scheme of
Before/During/After from a long time ago. As a default they want a form or
object to behave more or less like one did back then. And that's OK I
suppose but it leads to cases of developer FE-FOMO (form event-fear of
missing out). That is, fear that by turning off events our forms will
somehow stop working.

I argue to look at it the other way - start blank and enable the events you
actually need to accomplish the form's goal. On load is almost always a
good idea on a form. I usually prefer to initialize all my form objects
from the form method rather than enable On load for individual form
objects. Just a preference. So I generally don't enable On load for form
objects. For buttons, lists and such it's On click unless I'm being fancy
with something like On drop. That's pretty much it unless I have a specific
need in which case I enable what I need - On timer, On resize, and so on.

The form itself usually gets On load, On clicked, On outside call, On data
change, On loosing focus. That will cover you most of the time. The form
method might look like this:

Case of

:(Form event = On Load) //  initialize, load lists etc.


:(Form event = On outside call) //  respond


End case

//  this code will run for every event enabled on the form

//  I use this area for code to manage the look and state of form objects

OBJECT SET VISIBLE(*;"someObject_@";$visible)
OBJECT SET ENTERABLE(*;"someObject_@";$enterable)


From there turn on what you need and update the code to accommodate it. I
like to do things like manage form objects visible, enabled, enterable
settings after evaluating the specific event but that's my preference and
style. That's why I have things like On clicked and On loosing focus
enabled on the form but don't specifically evaluate them in the form method
(or enable them on the form objects) - they trigger updates of the form
display in response to whatever the user might have done.

Final thing to remember is enabling an event on a form isn't required to
enable it on an object. And enabling an event on a object doesn't cause the
form to respond to it.

On Fri, Nov 17, 2017 at 7:31 AM, Jim Medlen via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> What is the best Form Event to use with a Drop Down Menus on a form ?
>
> Is it better to use On Clicked or On Data Change ?
>
> Does On Clicked cause multiple form events when used with a Drop down Menu
> ?
> (when opening the menu and when selecting a choice from the menu)
>

-- 
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: New error about primary keys

2017-11-21 Thread Kirk Brooks via 4D_Tech
Lee,
I seem to recall something like this when I converted a datafile that had
dupes in the PK field. But I don't recall the specific wording on the dlog.

On Tue, Nov 21, 2017 at 4:19 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> I've seen the dialog that comes up with database with ambiguous primary
> keys - the one that starts with  "This version of 4D provides a more robust
> log file and you".
>
> But I just converted a v13 database to v15 and got a different alert:
>
> "Potential issues with primary keys have been found. Please contact your
> database administrator."
> With two buttons: Close Database and Continue.
>
> I was upgrading from a backup; the index file was new.
>
> I ran MSC/Verify on the datafile and it says everything checks out - no
> errors. But it goes through the test in less than a minute with a 850 MB
> data file, which doesn't seem right.
>
> I searched the Doc center with the first sentence of the alert and
> generated an http 504 error. Yay me!
>
> Anyone know what this means?
> **
> 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: Subform initialize logic

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

On Thu, Nov 23, 2017 at 5:14 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> As I understand correctly, when not on page 1, this subform is only
> initialized when the page is loaded
>

​I assume you are talking about a subform you placed in the design
environment and not one where you used OBJECT SET SUBFORM.
I'll also assume by "initialized" you mean it fires an On load form event.

When and how often a subform gets the On Load form event depends on what
page it's on, as you have noticed.
If the subform is on:

page 0 -   On Load ONLY the first time the parent form is loaded
page 1 -   When the form is loaded AND each time you re-load page 1
(assuming the parent form has more than 1 page)
page 2+ - Each time that page is loaded - which means each time you use
GOTO PAGE (n)


​You can see this for yourself: make a simple subform with a single
variable. The form method simply writes the form event to this variable and
then calls the parent method. Make a 2 page form and put this subform on
Page 0, 1 and 2 (label them to keep them straight). Load the parent form
and watch the how each form event is handled.


> In my widget I have an attribute defined called "enabled"
> When using a dropdown for example, I can disable the dropdown "On load",
> even when the dropdown is on page 2
> Because the widget is not initialized on load (because it is on page 2), I
> have to "remember" the disabled state in a variable, or re-execute the
> disable logic, when changing to page 2
>
​
Now we're talking about strategies for managing subforms. As with most
things 4D there isn't a single strategy that's 'best' for every situation
and especially with subforms because they can be used in so many different
ways. ​With that in mind my preferred strategy for handling subform config
is to put the subform config in a process method and call it from the
parent form.

There's no rule that says the subform has to initialize itself or if it
does the code has to be in the subform method. Sometimes it's easier if you
control when this happens. So just move all the subform config code to a
process method and call it using EXECUTE METHOD IN
SUBFORM("subform";"Subform_config_method"). A bonus here is you can pass
params, like a c-obj, to dial in the setup. You can also call it from the
subform method if you need to.

​This is especially handy if, as you describe, you want to do all the
config while the parent form is loading. This way you can. ​Or to circle
back to the case of using OBJECT SET SUBFORM this is a reliable way to
handle config.

While trying to eliminate variables I have to introduce others. This
> doesn't make sense to me
>
​True but it's a matter of scope. ​A subform, especially a widget, is like
a mini-process within the parent form that can have its own variables and
it's own set of form events it responds to. That can be quite useful but it
means you have to have a little more infrastructure on the subform to take
advantage of it. Again a couple of strategies:

you can have invisible subform variables

you can use duplicate object to populate a subform with specific objects

you can use the parent form object as the data object

​#3 is especially useful in v16 since the subform object can be a c-object.
​In your specific case I bet you already have a form boolean var called
'enabled'. You know it doesn't have to be visible and it doesn't have to be
big - you can set it's coords to 0 width and 0 height.

Gr,
>
​Hope this gives you some ideas.
​
-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: Subform initialize logic

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

On Thu, Nov 23, 2017 at 11:01 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

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

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


-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: Subform initialize logic

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

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

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

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

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

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

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

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

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

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

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

-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: Numeric Array Variable Not Reset When Array Redefined

2017-11-26 Thread Kirk Brooks via 4D_Tech
Allan,
I went along for quite a while before realizing changing the size of the
array didn't clear it too.

COPY ARRAY also fundamentally changes the array dimensions and content
including the {0} element.

On Sat, Nov 25, 2017 at 4:56 PM, Allan Udy via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> ​...
>  it appears that redefining an array variable and resetting its size it
> does NOT automatically reset the numeric value of the array variable.  You
> actually need to  use Clear Variable,


-- 
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: Numeric Array Variable Not Reset When Array Redefined

2017-11-27 Thread Kirk Brooks via 4D_Tech
Pat,

On Mon, Nov 27, 2017 at 1:33 AM, Pat Bensky via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The selected or specified value of the array is stored in the "zeroeth"
> element.
>

​I don't think that's universally true any longer. It's the way things like
popup lists and combo boxes work or scrollable lists. But it's not the case
with listboxes​. For instance I like to use a 1 column listbox to display a
list of documents in a folder. I store the path to the folder in the {0}
element instead of an separate variable.

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

The speed penalty for pointers is pretty low compiled

2017-11-27 Thread Kirk Brooks via 4D_Tech
I still have a lingering sense that using pointers to variables imposes a
noticeable speed penalty on code execution time. It's an old sense. I was
just thinking about it while using a simple method I have for doing
Increments. It's called Increment, takes a pointer to a var and adds 1 to
it.

$1->:=$1->+1


​Because we don't have += in 4D. I don't know why.

I wondered how much time it takes to de-reference the pointer. I wrote a
couple of loops and iterated 100k times. Interpreted the difference was
larger than I expected.

$n:=$n+1~49ms
Increment(->$n)  ~3800ms​


​Ok, I thought, so for a loop like that I stick to direct referencing the
vars. How much effect does compiling have? A lot.

​$n:=$n+1~0ms
Increment(->$n)  ~50ms​


This is with v15.5 running on a 1 year old MacBookPro. ​
​Ten iterations per test case.
​
So it's true using pointers instead of directly referencing variables takes
more time. Of course we're talking about 100k operations here. That would
really matter on large calculations performed 100s of times. For anything
involving direct interface with the user, though, I don't think it's really
a factor.

BTW, you can get around the 'pointer penalty' by using local vars directly
and then copying the results to the pointed to object. This makes a
noticeable difference if you are doing things like filling arrays on the
server. Say I've got a method to look up some stuff and then populate 5
arrays which I pass to the method as pointers. At size it becomes faster to
declare the arrays in the method, fill them and then use COPY ARRAY to copy
to the pointed to 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: The speed penalty for pointers is pretty low compiled

2017-11-28 Thread Kirk Brooks via 4D_Tech
Arnaud,

On Tue, Nov 28, 2017 at 1:26 AM, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> In the same kind of old belief, the "price to pay" to call a method in
> compiled mode is very low, but still passing a pointer parameter seems
> slower than other types of parameters.
>
​Good point - another vestigial ​programming habit that contributes to
long, tortuous methods that are complex, hard to debug and fragile.

​It is interesting how those of us who've used 4D for a long time and were
exposed to the "optimization" strategies of 20 years ago managed to so
deeply ingest them we still habitually use them. I have to say I wish 4D
was more concerted in suggesting best practices.

-- 
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: The speed penalty for pointers is pretty low compiled

2017-11-30 Thread Kirk Brooks via 4D_Tech
Hey Jody,
Great post.

On Thu, Nov 30, 2017 at 7:43 AM, Jody Bevan via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> You are right how we stick to our old habits. We do though because they
> have proven to work and sticking with them saves a lot of time.
>
​True but there's retro code that while working and stable is also
un-necessary any more or simply overly complicated because it's relying on
procedures written prior to certain capabilities 4D even had. I wonder how
many folks are still using the old drag and drop commands for instance.


> What we have done is to rewrite our shell every so often. The goal is to
> make use of all of the new features of 4D that we can, and to try new ways
> of doing things. We did this over the last year with v16. We really pushed
> out a lot of the way we used to code and did it the new way we decided on.
> One thing we did find is that in uncompiled with Team Developer it was
> slow. We got concerned. I did notice it was also slower on Stand Alone
> developer but not as bad. We do not use global variables on forms (or in
> our code), use our own dot.notation in C_Objects extensively, and use
> pointers even more than before (and with local variables).
>
> We finally decided we had better compile it to see what the end user speed
> was going to be like. We breathed a big sigh of relief as the code executed
> quickly. I suspect that a lot of the new way of coding gets ‘hard coded’ by
> the compiler so that it does not have to take the time to create the item
> in memory - thus the speed increase.
>
> Back to the topic of the thread - rewriting our shell though expensive for
> us, it helps move our mind set, test out new theories, and keep our code up
> to date with the 4D Technology.

​I agree. I've re-written the main db our company uses three times now in
the last 14 years. Started in 6.8, then jumped to 2004 and then to v13. The
one from '04 to v13 was ​hard. In my case mainly because I took that
opportunity to correct some structural issues that had come up as the scope
of the project increased. It just had to be done. And the benefits are
worth it.

The size of the code base actually shrank. When you implement the newer
functions 4D offers it frequently makes for less code to accomplish the
same things. It also allowed me to position the project to interact more
with other services. The user experience improves and I'm better able to
keep it looking a little more modern than a lot of 4D looks. That's more
important than mere aesthetics. The more I can make my interfaces resemble
the sort of interfaces they see in their browsers the easier it is for them
to use my program.


> Testing is critical though. We got bit very badly with SQL when it first
> arrived. Once France got involved they identified the cause quickly, and
> fixed it. Learned a good lesson there - yet again.
>
​Agreed again. I really do wish 4D did a better job of presenting new
technology. And how they intend us to use it as a place to start. Or
perhaps more to the point how to transition to it. And why. Again I'll
point back to the drag and drop stuff. I recall posting something about how
to implement the new form events and the pasteboard but I was looking at it
from the context of working with the old commands and trying to understand
how adding the new capabilities was a benefit. ​
​Which was a complete waste of time​. Finally someone, probably Miyako or
Josh, flatly told me "just walk away from the old way of doing it - you
don't need it anymore." Duh! Light bulb moment. I'm paraphrasing and it was
probably nicer but that's what I needed to hear to ditch my old way of
looking at it and start fresh.

Personally I think 4D walks a tight line on that sort of stuff - not
wanting to alienate old projects or make it seem like they _have_ to be
re-written. And then, as you say, we've all be bitten by jumping onto
something new only to stumble on to some bug. Well, you know what they say,
if it was easy to write good code every a**hole in the world would be doing
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: Tab into subform containers and GOTO OBJECT

2017-11-30 Thread Kirk Brooks via 4D_Tech
Hi John,
I'm curious what the situation is for having multiple embedded subforms
beyond things like widgets for dates and such. Care to talk a little about
what you need to do or why stacked subforms was your choice for it?

On Wed, Nov 29, 2017 at 5:11 PM, truegold via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Parent form: subform container1 -> subform container2 -> Subform (here’s
> where I want to set GOTO OBJECT)
>

-- 
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: The speed penalty for pointers is pretty low compiled

2017-11-30 Thread Kirk Brooks via 4D_Tech
Hey Wayne,

On Thu, Nov 30, 2017 at 1:10 PM, Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​> ​Agreed again. I really do wish 4D did a better job of presenting new
> ​ ​
> technology.​
>
> ​Not wanting to sound like a 4D shill but I think the new blog (
> https://blog.4d.com) is fantastic for demonstrating new features.
>

​You are absolutely correct. Thanks for pointing that out.
Ha, I wind up doing exactly the sort of thing I'm saying not to 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: Tab into subform containers and GOTO OBJECT

2017-11-30 Thread Kirk Brooks via 4D_Tech
John,
Yep, it does make sense. Does sound pretty complex.

On Thu, Nov 30, 2017 at 12:27 PM, truegold via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> I had it all worked out (prior to last 4D world) using Object arrays. Then
> I found out that I will need to have a licenses for 4D Spreadsheet (or
> whatever they call it) to use them. Think 4D property editor and that’s
> what I created.
>
​Well two thoughts. First, you can use an object array in a listbox without
4D WritePro or anything else - you just can't display them directly. But so
what? I use an object array frequently in listboxes. Make it the {1} column
and invisible. If I understand what you want to do add two columns: one for
the key and one for the value and make them both text. Now you can just
loop through the rows and write the key and the value (as text). When the
user changes something you just update the c-obj in the #1 column.

Second is I worked out a routine to put c-objects into an hList and allow
the user to edit the values if you prefer to look at it like a c-obj. I'll
be sharing that at my presentation in DC. ​

So now I am redoing it using panes=subform but there will be at least three
> separate palettes which house the panes. And I like this approach because
> then I can include richer UI objects like sliders and the like.
>
> I am trying to create something like an Inspector functionally similar to
> what you will see in OmniGraffle or Curio or many other apps.
>
​Interesting. I'd like to see it in action sometime.

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

bad code does bad things

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

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

This article

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

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

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

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


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

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

​Finally I'll cite this one

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

 WTFs/minute.


​OK, back to work cowboy. ​

-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: poor performance LISTBOX INSERT COLUMN

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

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

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

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


-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: Component works with compiled source but not as a component

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

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

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

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


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

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

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

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

Re: Component works with compiled source but not as a component

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

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

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



-- 
Kirk Brooks
San Francisco, CA
===

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

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

Re: Assign multidimensional array

2017-12-04 Thread Kirk Brooks via 4D_Tech
Ferdinando,
Copy array works fine with 2D arrays if you want $B to be - a copy - of $A.
But it sounds like you need to _append_ the elements.

You can also use COPY ARRAY on specific arrays within the 2D array.
Example:
$A has 4 'arrays' with some number of elements in each array. I have $C
that I want to copy to $A{2}:

COPY ARRAY($C;$A{2})

​This is equivalent to

ARRAY TEXT($A{2}:Size of array($C)) ` assuming text arrays

For($i;1;​
Size of array($C)
​)

$A{2}{$i}:=$C{$i}

End for​


On Mon, Dec 4, 2017 at 9:35 AM, stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> I need to append one array into another array with the same coloumns.
>
> Copy not think that work.
>
> I need to use 4D V12...
>
> Thanks
>
> /Ferdinando/
>
>
> Il 04/12/2017 18:13, 4d_tech-requ...@lists.4d.com ha scritto:
>
>> Message: 10
>> Date: Mon, 4 Dec 2017 17:29:29 +0100
>> From: Arnaud de Montard
>> To: 4D iNug Technical<4d_tech@lists.4d.com>
>> Subject: Re: Assign multidimensional array
>> Message-ID:
>> Content-Type: text/plain; charset=utf-8
>>
>>
>>
>> Le 4 déc. 2017 à 15:59, Chip Scheide via 4D_Tech<4d_tech@lists.4d.com>
>>> a écrit :
>>>
>>> Ferdinando,
>>> not sure if Copy Array will copy multi-dimensional arrays - you could
>>> try.
>>>
>> ARRAY TEXT($zz;2;3)
>> $zz{0}{0}:="test"
>> ARRAY TEXT($zzz;0;0)
>> COPY ARRAY($zz;$zzz)
>> ASSERT($zzz{0}{0}="test")  //0 index value
>> ASSERT(Size of array($zzz{2})=3)  //lines
>> ASSERT(Size of array($zzz)=2)  //columns
>>
>> it works:-)
>> -- Arnaud de Montard
>>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



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

Execute on server gotcha

2017-12-05 Thread Kirk Brooks via 4D_Tech
I use EOS methods a lot. They can make a huge difference since we run over
IP connections. As part of my init for new processes I put all tables into
Read Only and unlock the ones I need as I go along. You all probably do
that too.

Every now and then I'd be vexed by occasional locked records. 4D reports
them as being locked by a process I know started off with all tables read
only and I couldn't find anyplace where I'd changed it on that particular
table. And the randomness made it hard to replicate - especially on my
development machine.

This morning I finally realized it was the result of some EOS methods.
Here's the deal (I suspect most of you already know this):

When a method executes on server it runs in the 'twin' instance of the
process on the server. That's a totally separate memory space. It's a
totally separate record locking space as well. So when I set a process to
READ ONLY(*) this is only true for the client side instance of the process.
The server side twin is still the default of READ WRITE(*).

I have some EOS methods that do things like complex queries to get arrays
or sums that are optimized on the server. It hadn't occurred to me this is
where I was locking up records sometimes. But it was. Because the twin
process was still locking all the records it touched.

The solution I implemented is an addition to my process init method. A new
method that executes on the server :

If (Application type=4D Server)

READ ONLY(*)

End if

​I added the test for the application type because calling EOS methods in
single user mode runs in the same process and that could be confusing
sometimes. And in reality I have some more stuff in there but this makes
the point.


-- 
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: Execute on server gotcha

2017-12-05 Thread Kirk Brooks via 4D_Tech
Hi Miyako,
Nice post.

On Tue, Dec 5, 2017 at 5:01 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> the place to look in documentation is in "Triggers"
> http://doc.4d.com/4Dv16R4/4D/16-R4/Triggers.300-3317281.en.html

​OK. Not intuitive but I get the correlation. This is the first time anyone
has directly tied the relation of memory spaces for triggers and client
side processes.

​


> quote:
> • With 4D in local mode, the trigger works with the current selections,
> current records, table read/write states, record locking operations, etc.,
> of the invoking process.
> • With 4D Server, only the context of the database of the invoking client
> process is preserved (locked records and transactional states). 4D Server
> also (and only) guarantees that the current record of the table of the
> trigger is correctly positioned. The other elements of the context (current
> selections for example) are those of the trigger process
>
> the language is a bit indirect,

​like I say "avocado" and ​

​you say "black berry"?
​

> but the read write state falls under "other elements".
>
​I believe triggers pre-date multiple processes but I haven't looked back
to check. Nonetheless I can see how the technical infrastructure of the
triggers would lend to managing the processes. ​This also seems to imply
that when a client process is created it's established on the server first
and then in the client. Makes sense - I just hadn't thought about it
before.


> also a must-read:
> http://doc.4d.com/4Dv16R4/4D/16-R4/4D-Server-Sets-and-
> Named-Selections.300-3423889.en.html

​And there we have a great visual of the relationship between the client
and server memory spaces. Personally I would include such a visual in a
discussion about processes and the server with a main header of something
like 'Process Memory Spaces' and under that discuss how the various 4D
mechanisms exist and interact. Something to speed up this moment of 'Ah
ha!' ​



> a good use of the shared context is to create a set or named selection
> without a prefix on the client and pass its name(s) to the EOS method. very
> efficient.
>
​Help me with this one. Because you're saying I create a set on the client
side, let's use 'test' since that's what's on the chart. By the chart
'test' only exists on the client memory space. So if I pass the name of
this set to an EOS method then the contents of that set propagate to twin
on the server side? ​


> I also like to put a line that says:
> ASSERT(METHOD Get attribute(Current method path;Attribute executed on
> server))
>
​That is useful for development in single user mode since there's no way to
mimic the effect of running on the server. Do you know if Method Get
Attribute is any faster/slower/it doesn't matter than testing the
application type? ​


-- 
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: Execute on server gotcha

2017-12-06 Thread Kirk Brooks via 4D_Tech
Hi Janet,
The point about unloading the records is a good one.
Have you see this recent tip in the KB:  http://kb.4d.com/assetid=77893

Looking at some of my methods that run EOS my biggest issue is the
assumption I was in READ ONLY when in fact it was READ WRITE.

I like the suggestion Miyako made about testing the method execution
attribute at the top of the method. I could couple that with a test of the
application type to indicate indicate when a method intended to run EOS is
actually running in single user.

-- 
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: Execute on server gotcha

2017-12-06 Thread Kirk Brooks via 4D_Tech
Hi Chip,
Correct I believe. Looking at the chart:

http://doc.4d.com/4Dv16R4/4D/16-R4/4D-Server-Sets-and-
Named-Selections.300-3423889.en.html

not only is the $test set local to the client machine but the <>test set is
too - they differ in scope on the client machine's processes. But the
'regular' test set's scope (as I should think of it) is both the client
machine and the twinned process on the server.

That's probably by design within 4D I'm guessing. I always looked at that
chart as specifically referring to triggers but now I know it's accurate
for sets and named selections as well. Which is a pretty cool feature I
haven't taken much advantage of.

On Wed, Dec 6, 2017 at 6:41 AM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> clarification please.
>
> if the set created on the client side is "$Test" then it is NOT
> available in the trigger/EOS correct?


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

Anyone seeing issues with OPEN PRINTING JOB and Windows 10?

2017-12-07 Thread Kirk Brooks via 4D_Tech
 I have a user running a brand new Win10 laptop and is unable to print a
report built inside an OPEN/CLOSE PRINTING JOB clause. This is an old
report and no other users are having issues.

I'm looking for ideas about what it might be.

-- 
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: Anyone seeing issues with OPEN PRINTING JOB and Windows 10?

2017-12-07 Thread Kirk Brooks via 4D_Tech
 Sorry - I should mention this is v15.4.

On Thu, Dec 7, 2017 at 12:14 PM, Kirk Brooks  wrote:

> I have a user running a brand new Win10 laptop and is unable to print a
> report built inside an OPEN/CLOSE PRINTING JOB clause. This is an old
> report and no other users are having issues.
>
> I'm looking for ideas about what it might be.
>
> --
> 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: Typing a menu ref for Dynamic pop up menu

2017-12-07 Thread Kirk Brooks via 4D_Tech
 John,

On Thu, Dec 7, 2017 at 1:00 PM, John Baughman via 4D_Tech <4d
_t...@lists.4d.com> wrote:

> The compiler then complains when I try to append to the list saying
> “Changing the type of vTopLevelList from type text to type Real.
>

​You can only use APPEND MENU ITEM with a menu ref. You mention "I try to
append to the list" which suggests you're using APPEND TO LIST which is
looking for a list ref and that's a longint.

-- 
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: Typing a menu ref for Dynamic pop up menu

2017-12-07 Thread Kirk Brooks via 4D_Tech
 Yeah, I've spent no small amount of time maintaining code I eventually
determined wasn't being used too.

On Thu, Dec 7, 2017 at 1:31 PM, John Baughman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Duh!  Of course. Actually the method in question had been replaced and was
> not being used anymore, or more probably not ever used.
>
> Thanks,
>
> John
>
>
>
> > On Dec 7, 2017, at 11:13 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > John,
> >
> > On Thu, Dec 7, 2017 at 1:00 PM, John Baughman via 4D_Tech <4d
> > _t...@lists.4d.com> wrote:
> >
> >> The compiler then complains when I try to append to the list saying
> >> “Changing the type of vTopLevelList from type text to type Real.
> >>
> >
> > ​You can only use APPEND MENU ITEM with a menu ref. You mention "I try to
> > append to the list" which suggests you're using APPEND TO LIST which is
> > looking for a list ref and that's a longint.
> >
> > --
> > 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
> > **
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
>
>
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



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

Anyone have a link to a Northwind SQL dataset?

2017-12-09 Thread Kirk Brooks via 4D_Tech
Hi Folks,
I would like to setup the Northwind sample data set. I found this site:

https://northwinddatabase.codeplex.com/

but 4D fails when attempting to use SQL EXECUTE SCRIPT on it. I looked at
the Microsoft site but have no idea which flavor would/could work.

So - anyone have a suggestion?

-- 
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: Anyone have a link to a Northwind SQL dataset?

2017-12-09 Thread Kirk Brooks via 4D_Tech
 Hi Lee,
I've started looking at Neo4js and they use Northwind as a demo data set. I
want to put the same dataset into a 4D database to work out interacting
with Neo4js from 4D. I thought it would be easy...

On Sat, Dec 9, 2017 at 2:43 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> That looks like a sql server sample database.
>
> https://docs.microsoft.com/en-us/dotnet/framework/data/
> adonet/sql/linq/downloading-sample-databases  en-us/dotnet/framework/data/adonet/sql/linq/downloading-sample-databases>
>
> why were you curious about 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: Anyone have a link to a Northwind SQL dataset?

2017-12-09 Thread Kirk Brooks via 4D_Tech
 Hey Pat,
I'm using v16.3 on a Mac. I put the file in the folder with the database
and ran

SQL EXECUTE SCRIPT("northwind.sql";SQL On error confirm)

​The error seems to happen right away:

​
Error when executing the method "__test" at line number 5

Generic parsing error. Parsing failed in or around the following substring
interval - ( 1, 15 ) on line 1 - ...SE [Northwind]
...

Error code: 1301
Generic parsing error. Parsing failed in or around the following substring
interval - ( 1, 15 ) on line 1 - ...SE [Northwind]
...
component: 'SQLS'
task -5, name: 'P_1'

Error code: 200
Attempt to read beyond end of stream
xtoolbox
task -5, name: 'P_1'

Error code: -39
End of file (eofErr).
component: 'CARB'
task -5, name: 'P_1'




On Sat, Dec 9, 2017 at 6:36 PM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Are you connecting from a Mac or PC?
> Which version of 4D?
> Can you make the connection to the Northwind db OK?
> What error do you get?
> What's the script contents?
>
> So many questions ... :)
>
> Pat
>
> On 9 December 2017 at 21:14, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com
> >
> wrote:
>
> > Hi Folks,
> > I would like to setup the Northwind sample data set. I found this site:
> >
> > https://northwinddatabase.codeplex.com/
> >
> > but 4D fails when attempting to use SQL EXECUTE SCRIPT on it. I looked at
> > the Microsoft site but have no idea which flavor would/could work.
> >
> > So - anyone have a suggestion?
> >
> > --
> > 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
> > **
>
>
>
>
> --
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
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: Anyone have a link to a Northwind SQL dataset?

2017-12-10 Thread Kirk Brooks via 4D_Tech
 For those of you playing along at home - I found this site on Github where
you can get the basic data set. The structure is pretty simple to just make
in 4D.

https://github.com/tmcnab/northwind-mongo


On Sat, Dec 9, 2017 at 2:14 PM, Kirk Brooks  wrote:

> Hi Folks,
> I would like to setup the Northwind sample data set. I found this site:
>
> https://northwinddatabase.codeplex.com/
>
> but 4D fails when attempting to use SQL EXECUTE SCRIPT on it. I looked at
> the Microsoft site but have no idea which flavor would/could work.
>
> So - anyone have a suggestion?
>
> --
> 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: Anyone have a link to a Northwind SQL dataset?

2017-12-10 Thread Kirk Brooks via 4D_Tech
 Pat,
If I'm looking at it correctly this would allow me to access a running MySql
database from 4D.

What I was trying to do was create the Northwind db in a 4D database so I
could practice exporting the data neo4J is using in its demo. I thought it
would be useful for working out the code on the 4D side if I could be
working from the same dataset. But it's looking like more trouble than the
benefit.

On Sun, Dec 10, 2017 at 10:08 AM, Pat Bensky via 4D_Tech <4d
_t...@lists.4d.com> wrote:

> Hey Kirk,
>
> I haven't looked into this with v16 yet (it's on my To Do list) but in
> previous versions you needed to install an ODBC driver on Mac. See:
> https://www.catbase.com/configuring-an-odbc-driver
>
> Does that help?
>

-- 
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] File will not open in excel

2017-12-15 Thread Kirk Brooks via 4D_Tech
Hi Chip,
I get these from time to time as well. PITA.

The ones I get have some weird formatting at the beginning. If you look at
it in your text editor you'll probably see some style tag (  ...
) followed by two tables. The first one probably has the column
headers and the second one the data. After screwing around with trying to
do it elegantly I resorted to quick brute force:

Delete the style tag.
Delete the first   pair so that you've got a single table.
Save the file.
Open it in a browser.
Copy and paste back into your text editor.
Save.

No you've got the contents as a tab delimited plain file.

On Fri, Dec 15, 2017 at 12:57 PM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Got a file which claims to be an excel file (.xls) but will not open as
> an excel spreadsheet (Mac Office 2011 Excel)
> When the file opens in excel, it is opened as if it was a plain text
> file, when opened in Windows Office 2010 Excel it opens, and opens as a
> spread sheet.
>


-- 
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: Creating/Modifying 4DWrite/Pro Documents via Web Page

2017-12-21 Thread Kirk Brooks via 4D_Tech
On Thu, Dec 21, 2017 at 10:01 AM, Timothy Penner via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> {
> Note: The 4D Write Pro internal document format is a proprietary HTML
> extension, compatible with HTML5/XHTML5, but which supports its own subset
> of HTML/CSS attributes and tags. As a result, only HTML documents exported
> by 4D Write Pro can be opened by 4D Write Pro without any risk of data
> loss. Importing HTML documents that were created externally could produce
> errors.
> }
>

​Which is why despite the many useful things 4dWritePro provides I prefer
to avoid 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: Programmatically Manage Parent Tab an Multi-Subforms

2017-12-24 Thread Kirk Brooks via 4D_Tech
John,
Spencer's suggestion isn't bad and would allow you to use SET SUBFORM
OBJECT within a method executed using EMIS called by the parent.

The only other way I've been able to accomplish what you want to do is with
nested EMIS calls:
{Parent Form} EXECUTE METHOD IN SUBFORM
("Subform_1";"EMIS_1";*;"EMIS_2";"Update_form_tab";"param
2")

{Subform_1} executes EMIS_1 which is:   EXECUTE METHOD IN
SUBFORM("SubSubForm";$1;*;$2;$3)

{SubSubForm} executes EMIS_2 which gets $1= "Update_form_tab" and $2="param
2"


It works. And it's ugly. In such a case having a really solid naming
convention is going to be crucial. Because a subform only exists in the
context of the parent form nesting them makes for a twisty winding path to
"push" commands onto them from any place besides the parent form. This
makes me think about the reverse - typically a subform can simply access
anything on the parent - but I wonder about accessing objects on the
grand-parent?

I would encourage taking a step back and look at the whole task, or set of
tasks, you're trying to accomplish and seeing if nested subforms is really
the best solution. If you decide it really is the way to go then perhaps a
strategy where you store all the data the subforms will interact with in a
single process object is what you need. An object is great for this because
it's extensible and flexible. The code for each subform expects that object
(creates it if it's not already there) and so acts like an input form for a
subset of the process object. Think of the subform as a way to display
what's in the process object, that is - the real data - instead of the
subform *being* the data. From this point of view the subform's nested
level doesn't really matter and actually becomes independent of the parent
form.

This doesn't directly solve the problem you have at the moment but you
could use SET TIMER in the subform (according to the docs SET TIMER is
scoped to the subform) so you could look at some list in the process object
and configure itself if the list in the object doesn't match the list on
the subform. Code on the subform would respond to changes in this list and
update the process object. Boom - you've got a way to update a nested
subform based on something set by the grand parent form. No idea what kind
of performance issues you might encounter if you went wild with various SET
TIMER intervals on multiple subforms though. The key here, I think, would
be designing things so whatever is looking for the data
displayed/edited/set by the subforms resides in the process object and
everything that accesses that data only looks for it in the process object.


On Sun, Dec 24, 2017 at 8:37 AM, truegold via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> But I discovered I need one of the subform pages, let’s call it “Edits”,
> to change, based upon a different context, to either a different page or a
> different subform using code. The key here is that some action in the
> parent form needs to cause the subform container to display a different
> form.
>
> Seems easy… But I haven’t been able to get it to work.
>
> Parent Form (Tab control)
>-> Subform container
>   -> actual subform
>
> Logically it seems that I need to programmatically set the correct tab and
> tell the subform container to change the subform displayed. And then, of
> course, have the subform appear in the subform container.

-- 
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: Programmatically Manage Parent Tab an Multi-Subforms

2017-12-26 Thread Kirk Brooks via 4D_Tech
John,

On Tue, Dec 26, 2017 at 6:56 AM, truegold via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I think I will take a few more days off and when I return look at it with
> fresh eyes.


​Frequently the very best advice and, for me anyway, ​usually the very
hardest to follow.

-- 
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: List Box Header background color programatically.

2017-12-26 Thread Kirk Brooks via 4D_Tech
John,
Listbox headers are essentially buttons so I think you've got the same
options as buttons and setting the background color isn't one of them. You
could make a graphic and load it as the icon but that would involve
re-drawing it if the column changed size.

I wonder if you can call OBJECT SET FORMAT on them too? Probably can't
change the button type (which looks like 3D-bevel) but that does open up
the formatting options a bit. Simply changing the button from 3D-bevel to
3D-none makes them transparent and you could pretty easily manage the
background from there with object rectangles beneath them.

On Mon, Dec 25, 2017 at 6:48 PM, John Baughman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have tried…
>
> OBJECT SET RGB COLORS(*;"Day"+String($k)+”Header”;Foreground
> color;$weekEndColor)
> OBJECT SET COLOR OBJECT SET 
> COLOR(*;"Day"+String($k)+"Header";-(Foreground
> color +(256* weekEndColor)))
>
> I can get the foreground color to work, but not the background.
>
>
> Or is it just not possible to set header background colors
> programmatically? Can’t find anything in the Docs.
>
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
>
>
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **




-- 
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: List Box Header background color programatically.

2017-12-26 Thread Kirk Brooks via 4D_Tech
Hi all,
On Tue, Dec 26, 2017 at 7:51 AM, Kirk Brooks  wrote:

> I wonder if you can call OBJECT SET FORMAT on them too? Probably can't
> change the button type (which looks like 3D-bevel) but that does open up
> the formatting options a bit. Simply changing the button from 3D-bevel to
> 3D-none makes them transparent and you could pretty easily manage the
> background from there with object rectangles beneath them.
>

​Ah - no. Neither OBJECT SET FORMAT or OBJECT get format work on listbox
headers in v15.5 anyway. I think the listbox header objects are buttons but
only a subset of the object formatting options are open to us mainly
involving the title, font and such.

I did just discover I can set the help tip for each header object! ​

-- 
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: Electronic Signature Pads

2017-12-28 Thread Kirk Brooks via 4D_Tech
Lee,
How did the 4D app present/communicate/capture the signature image?

On Thu, Dec 28, 2017 at 8:51 AM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Justin,
>
> I’ve used this https://willowsystems.github.io/jSignature/#/about/ <
> https://willowsystems.github.io/jSignature/#/about/> in a project. It
> looks similar to the one you mention. (GitHub link here:
> https://github.com/szimek/signature_pad  signature_pad>)
>
>
> > On Dec 28, 2017, at 8:36 AM, Justin Will via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > What about using and html area and using the Signature Pad library?  I
> use this on a web app and it works great.
> >
> > https://szimek.github.io/signature_pad/
> >
> > Thanks
> > Justin
> >
> > **
> > 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: Using web areas in v16, is there a way to 'talk back' to 4d...

2018-01-04 Thread Kirk Brooks via 4D_Tech
Lee,
Be more specific about the scope of "talk back".

The easiest way to directly allow users to interact with a web area
displaying a page you created is the filter URL option. This is how I use
web areas and either do something like popup a 4D menu or make a connection
to an actual web link. I've never tried filtering URLs on a website I
loaded from the net.

Anyway, it's really easy if you make anything the user can click on an
anchor. And it works using the webkit or not.

if you've got js doing things on the web page or the user is entering data
and you need to tap on 4D's shoulder to get it to do something the $4d and
URL callbacks Miyako linked to is what you need. In that case you may have
to use the webkit.

On Thu, Jan 4, 2018 at 3:55 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> without needing a web server license and without using the 'embedded web
> rendering engine'?
> **
> 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
**

Can I use METHOD GET NAMES in the Host to get methods from a component?

2018-01-18 Thread Kirk Brooks via 4D_Tech
Doesn't look like it but maybe there is something I'm not thinking of.

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: Can I use METHOD GET NAMES in the Host to get methods from a component?

2018-01-18 Thread Kirk Brooks via 4D_Tech
Hey Julio,
Thanks for the example. I did pretty much the same thing by creating a
component method to get the method names and comments of methods. I was
hoping for a way to get the names of all available methods in other
components - not just the ones I write.

On Thu, Jan 18, 2018 at 1:34 PM, Julio Carneiro via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Try this:
>
> - Add a new method to host, call it “ProxyMethodGetNames" and make it
> ‘shared between host and components’, with the following code:
> >   C_Pointer($1;$arrNames)
> >
> >   $arrNames:=$1
> >   METHOD GET NAMES($arrNames->)
>
>
>
> - on your component, replace METHOD GET NAMES call by:
> >   ARRAY TEXT($aMethodNames;0)
> >   EXECUTE METHOD(“ProxyMethodGetNames”;*;->$aMethodNames)
>
>
> That should do it… (edit at will)
>
> That technique, where you use a host method as proxy to obtain info not
> available to components works great. It may fail with some special 4D
> commands, but has worked for me with all those I tried.
> Give it a try.
>
> julio
>
> > On Jan 18, 2018, at 6:22 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Doesn't look like it but maybe there is something I'm not thinking of.
> >
> > Thanks!
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ===
>
> --
> Julio Carneiro
> jjfo...@gmail.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
**

TIP: Method to calculate a formula using c-object values

2018-01-21 Thread Kirk Brooks via 4D_Tech
Hi folks,
Here is a method I find incredibly useful. It's another one of those things
I suspect a lot of you have already written but I haven't seen anyone
talking about it so I will.

This method allows you to write a formula as a text string referring to
object keys then pass the formula and c-obj to the method. The key values
are inserted into the formula and the result is returned. Optionally you
can specify a result key and the result will be written to the object as
well.

​The method assumes you're using Canon's OBJ component. If not just
substitute whatever you use for getting/setting object values. This is v15
compatible. It could easily be modified to use the new dot-notation in v16.

Note that you must wrap key names in the backtic (`). I needed something to
identify a key from anything else and there are not a lot of unique options
on the keyboard anymore.

The actual calculation uses #4DEVAL so your formula can include:

key names

4D methods
project methods
process and IP variables

constants


A formula might look like this:  " ((`y` * 23) + `abs.frt`)^ `123.frt`"
The extra spaces are just for readability - they are ignored in execution.

All keys are read as REAL. Text keys are converted to real as are long and
boolean keys. Missing keys are zero.

If I want to assign the result of the formula to a key in the object:
 " `x`= ((`y` * 23)+`abs.frt`)^ `123.frt`"

If x doesn't exist it's created. If it does it's updated.

Finally the 3rd para allows you to specify writing the result as text in
the object. Why you do that? There are good reasons for managing all values
in a c-obj as text (it's easier). But this also allows you to do things
like date operations and save the result as a date string, for example.

Here are few uses:

​$formula:="`x` = Cos(`y`) "

$formula:="`x`=((`y`*23) + `abs.frt`) ^  `123.frt`"

$formula:="`x` = (<>IPconstant * processConstant)"  // referring to keys is
optional

$formula:="`newDate`=String(Add to date(Current
date;`year`;`month`;`day`);Internal date long)"


​This last one is particularly cool. ​It works because #4DEVAL simply
evaluates the string passed to it.

$formula:=""  //calculation
PROCESS 4D TAGS($formula;$result)


The result is text even though the calculation may return a real (or any
other) value. Here's where the 3rd parameter comes in because it allows me
to write this text result to the object.

Consider an object:

{
"year": 0,
"month": 1,
"day": 23,
}

I pass the formula above:

$x:=OB_calculate ($obj;$formula;True)

​The object is updated to:

{
"year": 0,
"month": 1,
"day": 23,
"newDate": "March 16, 2018"
}​

​and $x is 162018​ which is simply the numbers of the date string and
meaningless.

I developed this method to manage listboxes where the data for the listbox
is in a hidden object array. This is a handy interface approach. It makes
it possible to display a listbox where the calculations involve a large
number of other values. Using arrays for the listbox data would typically
involve a lot of hidden arrays. Using an object array involves only the
columns of interest with the other data in the object.

With this method I can update the object array as required. And since the
formulas are all text based I don't even have to hard code the business
logic of the formulas. I could allow end users to define their own business
logic for their data, for instance. Or tailor how an interface works for
particular instances. You can do that now too, of course, but this is
probably a little easier.

Note on string objects. In v15 using

$real:=OB get($obj;"key";Is real)

doesn't correctly convert a text value if it contains commas. Using the Num
function accounts for this and also allows you to control the separator so
I suggest using:

$real:=Num(OB get($obj;"key";Is text))

​If the key is already a real this won't matter and if it's text it will be
handled correctly including currency symbols.​


Final note on key names - $pattern doesn't check for spaces in key names.
This is technically allowed but usually discouraged. If you need to
recognize key names with spaces tweak $pattern to suit. It does find
hyphenated keys, eg. "pad-right".

Be sure to add your preferred error checking code!

​=​
 //  OB_calculate
  // Written by: Kirk as Designer, Created: 01/21/18, 11:17:23
  // --
  // Method: OB_calculate (c-obj; text{;bool}) -> real
  // $1 is a c-obj
  // $2 is a formula
  //ex:  ((`y`*23)+`abs.frt`)^`123.frt`
  //or:  `x`= ((`y`*23)+`abs.frt`)^`123.frt  // write result to x
  // $3 is TRUE to write result to object as text  - default is false
  //ignored if result isn't written to object
  // $0 is result
  // Purpose: The formula will be populated with key values and calculated
  // All keys are treated as REAL but the keys may be text, real, long,
bool or date
  // Missing keys = 0
  // Key names must be wrapped in backtic:  `thisKey`
​ and not contain spaces​
  // any

Re: v16 List Box Set Enterable not working?

2018-01-22 Thread Kirk Brooks via 4D_Tech
The link Miyako included to the section on Managing Entry does actually
talk about this. (I confess I hadn't read it very carefully before now
myself.)

You use OBJECT SET ENTERABLE to manage the enterability of the 'object'
which is the listbox column.
To control the enterability of an individual cell you use the On Before
Data Entry form event.

It may seem a bit odd to have an object method return a value but that's
how it works.


Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*


On Mon, Jan 22, 2018 at 8:07 AM, Jim Crate via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On Jan 21, 2018, at 10:41 PM, 4d--- via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > The following works fine in v14, but in v16 doesn’t work. Is this a
> known issue??
> >
> > OBJECT SET ENTERABLE(ar_invBalance{$row};True)
> > EDIT ITEM(ar_invBalance;$row)
>
> I tried EDIT ITEM in v16 last week and it didn’t work for me either.
>
> Jim Crate
>
> **
> 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
**

Re: Going to the Summit Training, does it worth it?

2018-01-22 Thread Kirk Brooks via 4D_Tech
I agree it's worthwhile. Many of you will recall this hasn't always been my
quietly held opinion.

The biggest thing that changed? I actually started going to them.

The biggest benefits for me personally have been making personal
connections with people in the company and other developers. On the
technical side it's a great opportunity to be introduced to new
capabilities in the platform and see what other people are doing with 4D.
We are a small community so opportunities like this aren't as available as
other platforms. And it's particularly easy to get stuck in one way of
thinking about how to use 4D or doing something when the technology has
progressed and new options and tools have developed. Summits and the World
Tour are excellent opportunities to be challenged, inspired and informed.

I think the cost is consistent with 4D's approach to pricing in general.
Travel and lodging can make it a little pricy but again it's not out of
line.

If you use 4D in a business context, have the time and budget I think it's
worth it. At least they have been for me for the past eight or nine years.

I must note that I am a presenter this year as well.


Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*


On Sun, Jan 21, 2018 at 9:11 AM, JPR via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> [JPR]
> Hi Guys,
>
> Recently I've received a lot of mails, from USA, Germany, France, etc.
> asking almost the same questions, so I've decided to do a global answer.
> Basically, the question looks like "I'm very busy, and I just would like to
> know if it's it worth it, to spend one day dedicated to this new version.
> You see, I'm on 4D for a zillion years, and I don't really see what you can
> say that I do not know yet, or that I can't learn by reading the
> documentation."
>
> My answer to this question is "Yes!"
>
> HTH,
>
> My very best,
>
> What do you say? I should develop the answer a little bit?
>
> OK, but I will not detail the training content, for I'm not good at
> advertising. Nevertheless, just some hints:
>
> - We will talk about Objects, and don't think that what you know from the
> V16R5 is enough, there is much more.
> - We will talk about Collections. Yes, I know, you use it, and you already
> know everything about it. At least this is what you believe. Developer of
> little faith, just wait until you will see Collections in the new version...
> - We will talk about Records, and don't think that the fact you use
> Records since the beginning will actually help you to go from 'Classic' to
> the New way.
> - We will talk about Selections, specially to explain how you can get rid
> of most of the limitations you had to bear for years.
> - We will talk about Relations, which become much more important, and I
> will tell you that what I told you in previous trainings is obsolete.
> - We will explain the Language. OK, OK, you already use the dot notation,
> and you think you have got everything, but frankly, read my lips, you
> didn't get everything...
>
> And much more, and the philosophy behind,  and the very new way of
> thinking 4D, and multiconnection, and Optimistic Locking, and Listboxes,
> etc.
>
**
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 List Box Set Enterable not working?

2018-01-23 Thread Kirk Brooks via 4D_Tech
Jim,
I think you are correct. Miyako also talked about this in another post some
weeks ago. As I recall the deal is 4D needs to redraw the listbox but I
don't recall the specifics, I'm afraid. Reminds me of a joke on an old CSNY
album: "I didn't think you could tune and start on the same note."

I'm trying to think of how I deal with these sorts of things. I never seem
to bump into this issue so it must be something about the way I go about
adding row. Typically I separate the action of updating a listbox from
navigation and user interaction. Perhaps you can modify the method a little
bit to do the same.

Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*


On Tue, Jan 23, 2018 at 6:22 AM, Jim Crate via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On Jan 22, 2018, at 11:30 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> I suspect it is related to calling EDIT ITEM in the same “run loop” when
> the row is added,
>
>
**
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: Print settings Crash

2018-01-24 Thread Kirk Brooks via 4D_Tech
Magnus,
I run v15.5 on my OLED MacBookPro with no problems under Sierra. I also
suggest upgrading from the v15R.

Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*


On Wed, Jan 24, 2018 at 4:52 AM, Magnus Torell via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Dear,
>
> Strange problem I run into.
>
> The command Print Settings crash my 4D Remote on Mac OSX Sierra
> ​...
>
>
> 4D Version is v15R5. There are many clients that work without issues for
> more than a year.
> This is a semi new MB Pro that I setup for 4D client.
**
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: Document capture

2018-01-26 Thread Kirk Brooks via 4D_Tech
Hi Kenneth,

You've gotten a lot of good feedback already. I deal with a lower volume of
documents but high access rates. Last year I moved the actual document
storage to AWS using Bruno LeGay's component. Storing large numbers of
actual documents in 4D isn't really feasible. Even if you use the 'store
outside of datafile' option the backups still include the physical files.
And you start to run into the OS limitations on numbers of files in folders
at some point. I decided to store an index of the documents in 4D,
including the AWS file paths. Within 4D you can access the documents most
easily with a web browser - either the user's system browser or in a web
area. Or you can embed the link in a web page. I do this with images, for
example. And I recommend storing two versions of images as well: a
thumbnail and the actual doc.

In my workflow this is great. Referencing the documents is a snap and
doesn't consume tons of my bandwidth. If the user wants to keep a copy they
just download it. It would be just as easy for you to download the file as
well if you actually need to. And AWS is very cost effective for this sort
of task.

This was a good solution for us. AWS can handle terabytes of documents in a
flash and you can create sophisticated levels of security if you need it.
Regardless of how much storage space you need your 4D datafile remains
manageable.

Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*


On Thu, Jan 25, 2018 at 9:39 AM, Kenneth Geiger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi all,
>
> I’m beginning to work on a new project (4D v16 on Windows) for a client
> that handles a LOT of physical documents for their clients. They’ve got a
> huge storage issue and when they need to refer to a document, they spend
> huge amounts of time searching the physical files.
>
> I’ve not started prototyping anything yet but I think I’ve got a viable
> approach. The server will have a shared directory with a sub-directory for
> each of their clients. There will be a dialog where the user enters
> information about the document, including a text box where they can enter a
> brief description of the document. The user would then drag-and-drop a scan
> of the document onto the description text box and an “on drop” event would
> trigger a document capture method. This method will have to rename the
> document (the file-name will be created automatically within 4D without
> changing the extension), check that the relevant sub-directory exists on
> the server (and create it if it does not), and then save the renamed file
> to the server.
>
> If any of you have done something similar, I would really appreciate any
> feedback on my approach and would welcome any suggestions, pseudo-code, or
> code that you would be willing to share.
>
> Thanks much,
>
> Ken Geiger
> Dolores, CO
> kgeiger@gmail.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
> **
**
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: Document capture

2018-01-26 Thread Kirk Brooks via 4D_Tech
Arnaud,
On Fri, Jan 26, 2018 at 7:34 AM, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:
>
> > Le 26 janv. 2018 à 15:55, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> > Even if you use the 'store outside of datafile' option the backups still
> include the physical files.
>
>  Some field options would make it better:
> • don't load with record (something like a command 'External field load')
>
​My understanding is this is the way it works already.
​Have you seen otherwise? ​

​


> • exclude from backup (very easy IMHO)
> ​
>
​I thought about this too and concluded it's probably not a good idea. The
reason being it creates two 'classes' of data and that's not good. If
something is part of the datafile then it's a full citizen and treated
accordingly. To create this second class of data, which may or may not be
backed up and therefore may or may not be accurate introduces a lot of
complexity to the idea of a 'backup' and makes it impossible to guarantee a
restore is accurate.

​I think the 'store outside the datafile' option is mis-used ​
​
​if you don't want it backed up. So the sorts of solutions we are
discussing really are the better approach. ​

​I don't recall where but at some point I was part of conversation with
someone from 4D talking about this external storage option and the idea for
it was all about improving query speed - which is why I say I believe the
external data are not returned with the record unless you reference that
field directly. It's not about storage optimization but query optimization.
​
Kirk Brooks
San Francisco, CA
===

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

Re: Document capture

2018-01-26 Thread Kirk Brooks via 4D_Tech
Arnaud,

On Fri, Jan 26, 2018 at 10:28 AM, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 26 janv. 2018 à 18:49, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > Arnaud,
> > On Fri, Jan 26, 2018 at 7:34 AM, Arnaud de Montard via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >>
> >> Some field options would make it better:
> >> • don't load with record (something like a command 'External field
> load')
> >>
> > ​My understanding is this is the way it works already.
> > ​Have you seen otherwise? ​
>
> Things may have changed, but last time I tried, LOAD RECORD would grab the
> whole stuff (and I suppose it could be considered as a bug if not).


​Hmm, that's what I would expect from LOAD RECORD. The file/data is part of
the record, after all. But it wouldn't be the case if I were simply
referencing a field in that record from a linked record. For instance let's
say there is a table name [Photo] where the image file is stored. If I have
a form that displays a record in [Photographer] which links to [Photo]Title
it's my understanding simply referencing Title wouldn't load the entire
record.

I believe queries are optimized to only load the data stored in the record.


Kirk Brooks
San Francisco, CA
===

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

  1   2   3   4   5   6   7   8   >