Re: Running v15 Server as a Service in Windows Server 2016

2020-08-03 Thread Peter Jakobsson via 4D_Tech
Thanks Pat !

I will use OPEN ADMINISTRATION WINDOW in that case.

Peter

> On 3 Aug 2020, at 14:38, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Yes, you will need to access it rhough the client.
> 
> Pat

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

Re: Running v15 Server as a Service in Windows Server 2016

2020-08-03 Thread Peter Jakobsson via 4D_Tech

> On 3 Aug 2020, at 13:46, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> did you start the app as administrator?

That was it ! It works now, thanks Miyako (also I forgot about the new forum - 
will check it out. Old habits etc…still referring to “Layout Procedures").


> On 3 Aug 2020, at 13:44, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Did you restart it?

Yes Pat, but I was missing the “run as admin” bit. Now I just need to figure 
out how to access the server console as it doesn’t display. Do I need to access 
it through the client ?

Regards + thanks for the tips.

Peter

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

Running v15 Server as a Service in Windows Server 2016

2020-08-03 Thread Peter Jakobsson via 4D_Tech
Hi

Have been running a 4D Server as an application for a long time on this 
platform but need to change to a service so the admin people can set Windows 
updates to “automatic”.

However when I “Register as a Service” (from the File menu in 4D Server) it 
doesn’t seem to appear in the services list in server manager.

Are there any tricks I am missing ?

Regards

Peter

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

Re: Old 4D Transporter (ResTransporter) or Equivalent

2020-07-05 Thread Peter Jakobsson via 4D_Tech
Hi Folks

Many thanks for all the tips - much appreciated.

I managed to solve my problem with Spencer’s suggestion to write my own 
Transporter in 4D using DOCUMENT TO BLOB(file;*) to split the resource fork 
away and save it as a data fork.

That let me transfer to Windows.
My old structure and data now work fine in my Windows 7 VM with 4D 2004 server.

Many thanks again for the useful responses !

Regards

Peter

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

Re: Old 4D Transporter (ResTransporter) or Equivalent

2020-07-04 Thread Peter Jakobsson via 4D_Tech


> On 4 Jul 2020, at 17:59, Spencer Hinsdale  wrote:
> Maybe you can do this with 4D?  There is a asterisk param for blob to 
> document, document to blob.  You just read in the res fork and write out as 
> non-res file with .rsr I would think.

Great idea Spencer. Thanks for the tip.

I can use v15 on High Sierra.

Regards

Peter

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

Old 4D Transporter (ResTransporter) or Equivalent

2020-07-04 Thread Peter Jakobsson via 4D_Tech
Hi

I was wondering if there’s a tool to split the 4D resource fork on a 4D 2004 
database so I can transport it from Mac to Windows. I haven’t done this for 
years and have lost access to my old “Snowleopard” machine that I used to use 
for this type of thing.

I need the “transporter” tool to run on a modern Mac OS.

Any tips ?

Regards

Peter

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

Re: [off-ish]VPNs - free is better

2020-06-01 Thread Peter Jakobsson via 4D_Tech
Hi Chip

What is the “recent legislation” you’re referring to ?

I don’t use a private VPN for accessing clients but do use a public one for all 
my internet use (NordVPN). It’s excellent, cheap and lets you switch between 
static and dynamic IPs according to need. (e.g. I have a client network I 
access via Windows RDP that whitelists only known IPs. When accessing I switch 
to the static IP I have reserved by the VPN service. For all other internet use 
and casually browsing I use a dynamic IP but still on the VPN).

Peter

> On 30 May 2020, at 08:42, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi all,
> anyone have an experience with any VPNs?
> as my title says, free is better :)
> 
> with the recent legislation passed in the US senate, and similar legislation 
> elsewhere around the world, it seems that this is a good idea.
> 
> One of my concerns is I have heard (rumors - do not know how much to trust 
> them) that some VPNs are run by goats, as well as poorly located/configured 
> 
> thought I would ask here.
> 
> Chip
> 
> 
> Hell is other people 
> Jean-Paul Sartre
> **
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Tip: Speed up/repair v15 Design Environment

2020-05-17 Thread Peter Jakobsson via 4D_Tech
Hi

I might be late to the party on this one but in case in might help someone in 
similar situation….

Over the last year or so, I’ve been working with a really sluggish design 
environment in v15 (Mac). I wasn’t actually aware it was sluggish until now. 
Symptoms like the method editor being so slow to reflect what I was typing that 
I was about 4 letters ahead of it before the characters appeared. “Tab” 
clairvoyance taking half a second to a second before detecting the command etc.

Then today the explorer went wonky - the bottom edge of the window went below 
the screen bottom and the more I tried to shrink the explorer window it just 
grew longer instead.

After digging around for a while I tried binning the “~/Library/Application 
Support/4D/4D Window Bounds v15” folder and……voila ! Everything is dead snappy 
again.

Regards

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

Re: ListBoxes and AreaList Pro again (was: Object notation replacement for use of Self in a script — v18)

2020-05-04 Thread Peter Jakobsson via 4D_Tech
This is always a no brainer for me. Arealist every time.

It’s just far more professional looking and performing IMO. I use listboxes a 
lot for testing - I really use them quite intensively for that, but then I go 
and do the production version with Arealist since I still find list boxes 
clunky and more like a big global variable with window panes than a high 
performance business tool that Arealist always has been.

Another reason I stick with Arealist is scaleability. Listboxes have struggled 
with this for decades which tells you something. Only now are they starting to 
get there but it’s been painful. Meanwhile Arealist could display a million 
records in a millisecond 20 years ago.

It just has the right performance model for a grid inside and out and since the 
object-property approach arrived is infinitely more flexible.

Finally I’ve seen some cool looking listbox based applications so both are 
clearly viable for professional deployments, but listboxes for ma are always 
playing catchup.

Regards

Peter

> On 5 May 2020, at 00:48, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> Referring to Philipp’s comments...
> 
>> It would be too bad (and very time consuming) to get rid of all your hard 
>> work instead of just following AreaList Pro's evolution.
> 
>   Actually I found the switch less painful than expected for all of these 
> plugins. I always wrap plugin commands as much as I can as soon as I get them 
>  so that replacing code is an orderly and centralized process. Also I never 
> touch the existing implantation of the plugin. I duplicate the methods and in 
> the case of AreaList make the AreaList areas invisible and place the listbox 
> on top of the ALPRo area. For other form objects that contain plugin code I 
> like to put the object's code inside a case statement with both the plugin's 
> code and the new 4D code in the same object. I don’t remove the plugin until 
> I am sure that the replacement works as expected.  A day or 2 of work at most.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D Summit Videos

2020-04-23 Thread Peter Jakobsson via 4D_Tech


> On 23 Apr 2020, at 16:25, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Notable, so far anyway, is nothing from JPR [purposely employing the secret
> Bat Signal] or Laurent Ribardiere.



I think those are being held back for the “finale”. The LR one is referred to 
though as “coming soon”.

Shame you can’t get glasses of champaign and scallop & chestnut Canapés at 
online summits though.

I’ll sure miss that bit.

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

4D Summit Videos

2020-04-23 Thread Peter Jakobsson via 4D_Tech
Hi

Has anybody seen any of the summit stuff yet ?

I watched Miyako’s and Laurent Esnault’s presentations yesterday. I thought it 
was pretty incredible - looks like in the league of 2004 to v11 league of 
technology leap.

I love the way classes have been implemented - it’s exactly how I hoped they 
would be with their own “category” in the design explorer etc. They seem dead 
easy to make & manage. I also watched Miyako’s version control presentation. 
That just looks awsome, specially the way everything is so seamless e.g. mixing 
components in binary mode and VC mode or using 4D server with a version control 
system.

Seems a quiet revolution. I haven’t even seen any of the other presentations 
yet - will be checking some more out today !

Peter

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

Re: Remote working with 4D networks - what are people using ?

2020-03-19 Thread Peter Jakobsson via 4D_Tech


> On 19 Mar 2020, at 12:39, Randy Kaempen via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have to disagree.  I use screen sharing to access remote Macs on many of my 
> clients’ systems.  It is fast and easy to use.  I can do whatever I want on 
> the remote machines.

What remote access tech do you use Randy ? Just the built in screen sharing in 
macOS ? (Doe the client side work through a browser in that case ?).

> I have a client who has a huge Windows Server machine and they run all 
> instances of 4D client on it.  Everyone connects via RDP to those clients and 
> it’s fast.


You mean server + multiple clients on the same machine ? How do screen sharers 
connect to a particular instance of a 4D Client in that case if they’re all on 
the same machine ?


Peter

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

Remote working with 4D networks - what are people using ?

2020-03-19 Thread Peter Jakobsson via 4D_Tech
Hi

Due to impending “lockdown” situations I have users asking me how they can work 
from home. I was wondering what solutions others were finding worked well.

The service provider that many of the key users have at home (Talk-Talk in the 
UK)  blanket blocks all screen sharing software so will probably have to look 
into some kind of cloud hosting solution. The question is, how to set up 
network in the cloud (only needs 2 clients for now). Their office network runs 
on Macs, including the 4D server.

Regards

Peter

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

Re: 4D Write Preview Fails on certain workstation (Windows)

2020-03-06 Thread Peter Jakobsson via 4D_Tech


> On 6 Mar 2020, at 18:21, Costas Manousakis via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We have not seen a blank preview but shrunk previews where it seemed like the 
> normal letter size page was printed, then reduced in size and then placed on 
> a letter size paper

Thanks for the reply Costas !

Actually I spent some time trying to debug it in interpreted mode on the 
workstation concerned and made some progress. It seems to be to do with 
embedded expressions and the document content. When I removed a certain 
expression (a 4D method I use to populate the document with ‘merge’ data) the 
document became visible so it might not be the preview at all.

It’s as if the logic that generates the content works differently on that 
client. Maybe it got coronavirus.

Peter

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

4D Write Preview Fails on certain workstation (Windows)

2020-03-06 Thread Peter Jakobsson via 4D_Tech
Hi

I was wondering if anybody had encountered this issue.

4D Write document preview (created using "WR Build Preview”)  displays a blank 
picture only on one workstation on the entire network (there are 8 
workstations). There is nothing obviously distinct about that workstation:

4D v15 (Client-server)
Windows 10 Pro
Intel Core i7-7700 3.6 GHz

I might try "myPicture:=myPicture|myPicture” to create a bitmap and try 
displaying that. The preview is transient - does not get stored anywhere. The 
funny thing is that one type of document displays ok. The other’s don’t so it 
may be some bad character embedded in the document, however they all display 
fine on all other workstations.

If anybody has seen this I’d appreciate any hints !

Regards

Peter

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

Re: Best "back to school" pathway for upgraders

2020-02-23 Thread Peter Jakobsson via 4D_Tech
Thanks Tom

All my PICTS were indeed converted “years ago”.

Peter

> On 21 Feb 2020, at 17:55, Tom Benedict via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I agree with Randy, unless you converted all your PICTs years ago when 4D 
> first started to warn us about them. If you haven’t converted them you’ll 
> need to do that in 32bit mode.

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

Best "back to school" pathway for upgraders

2020-02-21 Thread Peter Jakobsson via 4D_Tech
Hi

I’m collating resources for informing myself on new features and language for 
moving from v15 to v18. Plan to do it in one leap over a year at least. I don’t 
really see the point in hanging around in an intermediate version.

There is so much new stuff it’s getting overwhelming because now, on top of all 
the language revolution we have things like Git support, plugin 
specialisations, interoperability technologies etc. Where to start ?

Best place to learn ORDA for example, is it the v17/18 language reference ? 
That’s where I’d usually start (or in fact with the “upgrade manual” but v18 
doesn’t have one). Objects - “New Object” command, object notation, new way of 
using forms (with object instead of global variables).

What’s the difference between a “Database” and a “Database Project” ? Is that 
"Design Reference" material ? I haven’t read a 4D Design Reference since the 
80’s. Has anybody been through all this stuff from to finish ? What would be 
the recommended starting point ?

Waiting on new technologies from 4D is like waiting on a bus. None come for 
eons and then they all arrive at once. I’m trying not to get run over !

Peter

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

Re: What constitutes high-perf. hardware for 4D server these days ?

2020-02-21 Thread Peter Jakobsson via 4D_Tech
Hi Tom

Many thanks for your useful observations. I’m not quite sure of the priorities 
given to 4D in the VM but the support guy said he needed some kind of IP packet 
specification details which 4D used to give it “full priority”. I think that 
was so that other bandwidth demands (such as large file sharing data transfers 
and stuff) didn’t hog the bandwidth. I wasn’t able to give him this.

I’ll see what he can do with CPU and RAM as you suggest.

Thanks again !

Peter

> On 19 Feb 2020, at 22:41, Tom Benedict  wrote:
> 
> 
> It’s been a few years (3-4) since I had a 4D Server running a VM, but at that 
> time the best way we had to optimize the hardware was to have the VM 
> “Priority” for your app be set as high as possible and to dedicate CPU and 
> RAM to it. VM’s are inherently ‘smart’ and will change the performance level 
> of a given app based on how busy it is. If it doesn’t look like it needs RAM 
> its allocation will be reduced. Likewise for CPU. And the opposite if 
> resources are in demand, the VM will give you app more RAM and CPU. However, 
> it takes time for a VM to react and there is overhead in moving/allocating, 
> so it can effect your apps performance. We found that we needed to set the VM 
> to dedicate RAM and CPU and never reduce it. I don’t recall what the feature 
> was call that does the VM management.

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

What constitutes high-perf. hardware for 4D server these days ?

2020-02-19 Thread Peter Jakobsson via 4D_Tech
…that is the question !

I have a site that I just launched - usual moderate-trauma of initial days  but 
basically holding up so far and improving by the day.

I now need to try and optimise it a bit as it’s still slightly sluggish and was 
wondering what people were running in terms of hardware. Everything at this 
place is on VM - nothing I can do about it as it’s contractor managed. (In fact 
they seem to be able to change the “hardware" without me even taking the server 
down - that’s something I never thought I’d see and am too old now to bother 
speculating how they do it :-) !).

I have quite a lot of trigger-code for doing journal posting and so on so I 
suppose that does a fair bit of “slowing” running in the co-operative thread. 
(The support guy at the contractor noticed it remotely…”hey your DB is all 
crammed into a single core !”. )

Specs are:

4D Server v15.
8 users.

Intel (R) Xeon (R) CPU, E5 2620 v4, 2.1 GHz
SSDs (Quite fast ones but not sure of the exact spec)
Windows 10 Server 64 Bit

Would increasing the CPU speed help with the trigger execution or is it all 
bandwith ?

I’m also going to do some logging-mode execution as I’m sure there are 
sequential searches going on in a few places as I usually try to keep indexes 
light to start with and wait till I see where I need them. I have a parallel 
server running on another machine with my partner license so I can try stuff 
out there.

Any tips and/or experiences appreciated !

Regards

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

Re: v18 and 4D Write Classic - does it work ?

2020-02-06 Thread Peter Jakobsson via 4D_Tech
Many thanks for that comprehensive and extensive commentary Tim !

Looks like I have my work cut out. All the 4D Write code I have is in a 
component and the component makes around 30 calls or so to 4D Write. There’s no 
raw host calls anywhere. Hopefully it will be do-able but will take your advice 
and read the manuals in depth.

Thanks again !

Regards

Peter

> On 5 Feb 2020, at 16:07, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Warning: You may not going like what I have to say below

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

v18 and 4D Write Classic - does it work ?

2020-02-05 Thread Peter Jakobsson via 4D_Tech
Hi

I’m going to be making the leap from v15 to v18. I think the biggest transition 
will be moving to 4D Write Pro as I have quite a lot of legacy 4D Write code to 
deal with.

In the meantime, does anybody have experience of migrating big 4D Write 
codebases ? What are the major gotchas ?

Will legacy 4D Write work in v18 in the meantime or do we need to migrate to 4D 
Write Pro to even run it ? (When I try it it invokes license privilege errors 
everywhere).

Many thanks for any tips

Peter

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

Re: O/S Replication and Backup interaction with 4D (2004, v15)

2019-12-04 Thread Peter Jakobsson via 4D_Tech
Hi Timothy

That post was very useful. Many thanks.

Regards

Peter

> On 4 Dec 2019, at 20:15, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> It sounds like you're dealing with a VM environment, possibly either Hyper-V 
> or VMWare ESxi

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

O/S Replication and Backup interaction with 4D (2004, v15)

2019-12-04 Thread Peter Jakobsson via 4D_Tech
Hi

I have a legacy 4D server which appears to be getting trashed by the backup 
services in Windows 10 server.

The platform contractor cannot turn off any of the backup stuff and I can’t 
upgrade to v17 for several weeks due to…..reasons, so need to find a way round 
this. (There are 2 virtual machines running inside the host. One of these runs 
a 4D 2004 server, the other runs a 4D v15 server).

One thing the contractor said is that there are 2 levels of backup - the “Host 
replication” which runs every 15 minutes - and the guest backup (which I 
presume is Windows Shadow Copy Service) which runs once per evening.

Am I right in thinking that legacy 4D servers should be ok with the host 
replication but not with the guest backup (which causes file locking conflicts 
with 4D I imagine) ?

If that’s the case I’m thinking of finding a shell script to take the 4D server 
down in the evenings and put it back up early morning.

Regards

Peter

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

Re: Trapping the 'return' key in list forms

2019-12-04 Thread Peter Jakobsson via 4D_Tech
Hi Jeremy

In fact, with this approach there’s not even any need for the invisible buttons 
- just associate the [Return] key with the visible default button and the 
script can decide whether to execute the query or the default “Accept” action.

Regards

Peter

> On 4 Dec 2019, at 09:40, Jeremy Roussak  wrote:
> 
> Glad to have helped! FWIW, I don’t use invisible buttons; there’s no need. If 
> your form is sized relative to a bounding rectangle of some kind, you can 
> place the buttons outside that rectangle area and set their “Resizing 
> options" to "move". Makes them much easier to edit. Something like this: 

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

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Peter Jakobsson via 4D_Tech

> On 3 Dec 2019, at 21:47, Peter Bozek  wrote:

> But doing it again, I would go for something simpler.

…and that “something simpler” turns out to be Jeremy Roussak’s tip of removing 
the “Focusable” property from the default button on the form.

This is the key to everything, including:

1. The “Focus Object” function returns the object you’re interested in, not the 
one currently executing the script
2. No need for clumsy “On Getting Focus”, “On Losing Focus” tracking flags
3. The filter field’s behviour can be decoupled from the host form as users 
expect. It now has its own “Return” key without the host form disappearing from 
view in front of their faces
4. Any other common “hotkey” actions (such as opening the currently highlighted 
row in a list) having a “return” key shortcut can continue to work as normal 
wrapped with a generic exception testing function that works in any form
5. All object’s events can continue to be used as normal without form-specific 
exceptions

Superb ! And the forms all suddenly feel great to use. As intuitive as Google !

Peter

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

Re: Trapping the 'return' key in list forms

2019-12-03 Thread Peter Jakobsson via 4D_Tech
Hi Chip

Thanks for the reply. I’ve seen that approach on some web based systems.

Could be good, could be bad. I see some users loving it and others hating it. 
The machine trying to “second guess” that the user has typed enough into the 
filter field sometimes makes it feel flaky because it’s not immediately 
apparent what invoked the sudden query unless you happen to know about the 
“timed action". At least with “type-ahead” the user knows that the keystroke 
will invoke a filter at every character.

Having said that, I watched a user show me their product lookup on a 
manufacturer’s booking site the other day - it had a timer just like the one 
you described. He really liked it. But he also wanted the filter to be invoked 
with the return key.

Regards

Peter


> On 3 Dec 2019, at 15:12, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> have you considered using a timer to auto search for the user?
> 
> i.e. user types: "App" 
> and after a brief delay the searches auto executed using the user 
> entered information?  I use 120 ticks.
> 
> then they do not have to hit return at all
> 
> 
> On Tue, 3 Dec 2019 00:26:24 +, Peter Jakobsson via 4D_Tech wrote:
>> Many thanks Kirk, and to those who responded to this thread.
>> 
>> I’ve tried a variety of approaches in a virgin structure. The 
>> simplest appears to be one that was first suggested by Jeremy Rusak 
>> but others also alluded to: simply remove the “Focusable” property 
>> from the default button (or a button with the Return key shortcut 
>> attached).
>> 
>> That allows the “Focus Object” functions to return the last object 
>> instead of the current one. Hurrah !!
>> 
>> By the way, the reason this is coming up is because users tend to 
>> regard the “Search” widget as a form in its own right. So they 
>> expect to be able to hit the return key to execute a query, then use 
>> tab to move between form object in the host form (which contains both 
>> the list and the search widget), then use the return key again to 
>> accept the form…..IF the cursor is not in the search widget, in 
>> which case they expect “return” to execute the query again and not 
>> accept the form.
>> 
>> Regards
>> 
>> Peter
>> 
>> 
>> 
>>> On 2 Dec 2019, at 15:58, Kirk Brooks via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> Hey Peter,
>>> I was just reading through your question and the answers and I noticed the
>>> solutions get sort of complicated. I think the reason is the task you're
>>> describing a little unusual. Having one keystroke, the return key, perform
>>> two very different actions can result in a non-intuitive UI. Consider, on a
>>> web page hitting the return key NEVER closes the page. In fact it open a
>>> new one.
>>> 
>>> I've inadvertently set up this sort of thing on forms of my own and it's
>>> really annoying. When I want to use the Return or Enter key for anything
>>> besides accepting the form (eg. initiating a query, moving around on a
>>> listbox, etc. ) I put an invisible button on the form to trap the keystroke
>>> and then post an event, typically a TAB. This way I can still trap in the
>>> current object. For adding a CR to a text field I enable the After
>>> keystroke form event and trap the keystroke there.
>>> 
>>> With this setup you will still handle the query stuff in the context of the
>>> relevant object. I think someone else mentioned using the loosing focus
>>> form event. That's good because some users will probably get used to using
>>> the TAB key to move around. There's nothing to stop your code from
>>> reselecting the search input object when it looses focus. The user won't
>>> know the difference. But if you do that how does the user get out of the
>>> field?
>>> 
>>> For closing forms, not alerts, confirms or requests, with a given key I
>>> like to decide on some consistent action and stick to it on every form. You
>>> could use Shift key + Enter. Whatever you choose matters less, I think,
>>> than applying it consistently throughout the database.
>>> 
>>> On Fri, Nov 29, 2019 at 1:44 PM Peter Jakobsson via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
>>> 
>>>> This is so that users can hit the return key to execute a query (like
>>>> Google style). But if the cursor is not in the filter field but
>>>> highlighting a row in the list then th

Re: Doing a GOTO (widget) in the On Load event - stumped

2019-12-02 Thread Peter Jakobsson via 4D_Tech


> On 3 Dec 2019, at 00:58, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Thanks Canon

…sorry, I mean “Cannon” of course ;)
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Doing a GOTO (widget) in the On Load event - stumped

2019-12-02 Thread Peter Jakobsson via 4D_Tech
Works a dream.

Thanks Canon. I had forgotten about SET TIMER. Suddenly these query forms are 
perfectly user-intuitive. Start off in filter. Execute query with Return, 
accept form with return also.

Could not be better…thanks for all the tips on here !

Peter

> On 3 Dec 2019, at 00:47, Cannon Smith  wrote:
> 
> Depending on how the subform is set up, it may not be loaded by then. But it 
> should work if you use SET TIMER(-1) and then call EXECUTE IN 
> SUBFORM($subform;”ACTION”) in the timer.

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

Doing a GOTO (widget) in the On Load event - stumped

2019-12-02 Thread Peter Jakobsson via 4D_Tech
Hi !

Back again with a related issue to my previous theme of user interface 
behaviours.

To move the cursor into a widget (in fact a derivative of Miyako’s “search” 
widget) I usually use a button with CTRL-F shortcut to call “EXECUTE IN 
SUBFORM($subform;”ACTION”) and then have the “ACTION” call a GOTO OBJECT in the 
context of the subform.

This works fine once the form is loaded but never works in the “On Load” event 
of the widget’s host form. (Nor in the widget’s on load event which I tried by 
way of completeness).

Think I’ve run out of leads so if anyone has any hints as to how to get this to 
work I’d appreciate it !

Regards

Peter

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

Re: Trapping the 'return' key in list forms

2019-12-02 Thread Peter Jakobsson via 4D_Tech
Many thanks Kirk, and to those who responded to this thread.

I’ve tried a variety of approaches in a virgin structure. The simplest appears 
to be one that was first suggested by Jeremy Rusak but others also alluded to: 
simply remove the “Focusable” property from the default button (or a button 
with the Return key shortcut attached).

That allows the “Focus Object” functions to return the last object instead of 
the current one. Hurrah !!

By the way, the reason this is coming up is because users tend to regard the 
“Search” widget as a form in its own right. So they expect to be able to hit 
the return key to execute a query, then use tab to move between form object in 
the host form (which contains both the list and the search widget), then use 
the return key again to accept the form…..IF the cursor is not in the search 
widget, in which case they expect “return” to execute the query again and not 
accept the form.

Regards

Peter



> On 2 Dec 2019, at 15:58, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hey Peter,
> I was just reading through your question and the answers and I noticed the
> solutions get sort of complicated. I think the reason is the task you're
> describing a little unusual. Having one keystroke, the return key, perform
> two very different actions can result in a non-intuitive UI. Consider, on a
> web page hitting the return key NEVER closes the page. In fact it open a
> new one.
> 
> I've inadvertently set up this sort of thing on forms of my own and it's
> really annoying. When I want to use the Return or Enter key for anything
> besides accepting the form (eg. initiating a query, moving around on a
> listbox, etc. ) I put an invisible button on the form to trap the keystroke
> and then post an event, typically a TAB. This way I can still trap in the
> current object. For adding a CR to a text field I enable the After
> keystroke form event and trap the keystroke there.
> 
> With this setup you will still handle the query stuff in the context of the
> relevant object. I think someone else mentioned using the loosing focus
> form event. That's good because some users will probably get used to using
> the TAB key to move around. There's nothing to stop your code from
> reselecting the search input object when it looses focus. The user won't
> know the difference. But if you do that how does the user get out of the
> field?
> 
> For closing forms, not alerts, confirms or requests, with a given key I
> like to decide on some consistent action and stick to it on every form. You
> could use Shift key + Enter. Whatever you choose matters less, I think,
> than applying it consistently throughout the database.
> 
> On Fri, Nov 29, 2019 at 1:44 PM Peter Jakobsson via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> This is so that users can hit the return key to execute a query (like
>> Google style). But if the cursor is not in the filter field but
>> highlighting a row in the list then the return key should accept the form
>> (via regular default button action).
>> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> What can be said, can be said clearly,
> and what you can’t say, you should shut up about
> 
> *Wittgenstein and the Computer *
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: Trapping the 'return' key in list forms

2019-11-30 Thread Peter Jakobsson via 4D_Tech
Thanks for that input Chip.

However I don’t see how this can work. How can the invisible button script know 
which field the cursor was in last ? (Or which object last had the focus prior 
to its own script being executed ?)

Regards

Peter


> On 29 Nov 2019, at 22:13, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> invisible button with  as the activation key, which could then POST 
> KEY().
> or you know...
> User training  :)

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

Trapping the 'return' key in list forms

2019-11-29 Thread Peter Jakobsson via 4D_Tech
Hi

Could anyone kindly bring me up to date me how we trap the [Return] key on a 
form these days with a default button when some other action is to be taken 
rather than accepting the form, depending on the last object that had the focus 
prior to executing the Default Button script ?

In otherwords how can the default button script “know” that the cursor was in a 
“filter list” widget just prior to executing and in that case cancel the 
form-acceptance action in favour of executing the list query.

This is so that users can hit the return key to execute a query (like Google 
style). But if the cursor is not in the filter field but highlighting a row in 
the list then the return key should accept the form (via regular default button 
action).

many thanks

Peter

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

Re: Windows network - cannot open structure of database {BaseName}

2019-11-11 Thread Peter Jakobsson via 4D_Tech
Hi

Amazing how just typing the problem out catalyses your brain !

It wasn’t enough to allow just TCP protocol in the firewall. It had to allow 
UDP as well. (In fact I just changed it to “All Protocols”).

Sorry for the noise :-)


Peter

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

Windows network - cannot open structure of database {BaseName}

2019-11-11 Thread Peter Jakobsson via 4D_Tech
Hi

I’m slightly stumped by what appears to be a networking/firewall/permissions 
issue but I’m not really sure. (Ports are open).

A 4D Client connecting to 4D Server (v15) over a Windows LAN (Windows 10) 
connects but then dies while trying to download local resources. The error 
messages are:

1024 Can’t open structure of database ({BaseName})
1211 Cannot create connection
10035 Unknown error

The weird thing is that there is a perfectly serviceable version of exactly the 
same structure running on a different server which works fine (so it doesn’t 
seem to be an issue with permissions on the client side and 4D not being able 
to write to its local cache folder). Also, I have to connect to the failing 
server using the “Custom” tab as it doesn’t automatically show up in 
“Available” which the production server does.

I have opened the Windows firewall port 19813 on the server O/S, both inbound 
and outbound. Apart from that I can see no difference from the one that works 
(they are separately licensed).

Client O/S: Windows 10
Server O/S's (Both): Windows Server 2016 Standard

Server IPs:

192.168.0.249 (Works)
192.168.0.40 (Fails)

If anyone is familiar with this issue I’d appreciate any tips !

Regards

Peter

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

Re: Capturing barcodes without a 'text' field

2019-10-16 Thread Peter Jakobsson via 4D_Tech
Hi Dougie

This is in fact what we do at the moment. (In fact it’s so simple I just use 
the 4D “Request” function to capture the barcode).

The only thing that would make a marked improvement while not complicating 
things too much would be for the capture to auto-enter itself after the scan 
(i.e. execute a TAB or CR). That would save them reaching for the keyboard 
every time between scans. I think the best way to do this seems to be to have 
the scanner send enclosing control characters to invoke the TAB as some have 
suggested. 

Peter

> On 16 Oct 2019, at 10:13, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> My advice is try not to complicate it.  If there is a lot of things going on 
> in your screen make the user make a conscious choice to go into or come out 
> of scanning mode.

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

Re: Capturing barcodes without a 'text' field

2019-10-16 Thread Peter Jakobsson via 4D_Tech
Thanks Jeff. Very useful information.

I also checked out your even more detailed responses on last year’s thread 
about this which were very informative.

Regards

Peter

> On 16 Oct 2019, at 00:54, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> If you want to use a USB barcode scanner and still have complete control, you 
> can use ON EVENT CALL to manage this. You'll need to program a prefix 
> character and a suffix character into the barcode scanner,

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

Re: 4D Server Hosting - The Future ?

2019-10-10 Thread Peter Jakobsson via 4D_Tech


> On 10 Oct 2019, at 16:58, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> that all is great until the hardware running the 4,382,619 VMs crashes

According to “the guy”, that’s all taken care of. Even if the “metal” melts 
down, the VM’s just “seamlessly” migrate themselves onto other metal without 
the users even knowing !

Don’t ask me quite how that works but he kept saying it wasn't a problem.

-P

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

Re: 4D Server Hosting - The Future ?

2019-10-10 Thread Peter Jakobsson via 4D_Tech
Thanks for your post Kirk.

The guy I spoke to seemed to have it the other way around - the VM’s had 4-12 
cores and the “metal” about 32.

He also was of the categorical opinion that the only way to really keep 
applications “isolated” from each other (i.e. not bring everything else down 
when they crashed) was to give each mission critical application or service its 
own VM.

When I put to him “what about the natural O/S level multi-threading” he felt 
there were too many vulnerabilities and mentioned especially the “crypto 
viruses” and the Intel multi-threading bug. His approach was basically - if 
your VM needs ore resources then we can simply allocated more. He wasn’t really 
bothered by the idea of applications that were multi-threaded internally 
because it’s all the one big bucket and if something inside the bucket needs 
more power then just make the bucket bigger.

Peter


> On 10 Oct 2019, at 16:09, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
> The other thing about VM vs metal is the whole pre-emptive process
> benefit basically goes away. Thomas Maul has shown this at the Summit.
> Having n+ virtual cores doesn't do anything to actually increase processing
> speed because the VM is running on whatever is allocated to it.
> Theoretically you could have a VM with 4 cores running an instance with 32
> cores

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

4D Server Hosting - The Future ?

2019-10-10 Thread Peter Jakobsson via 4D_Tech
Hi !

I just finished a 1.5 hour phonecall with a support services manager at the 
technical services company who supply one of my customers with all their 
hardware/software/maintenance services.

He basically brought me up to date on “how things work” today which is 
essentially that everything to do with platforms is now virtualised to allow 
them to ‘tune’ resources to demand in realtime and provide seamless, no 
downtime backup. Basically, my 4d Server is now a “cloud service” without me 
even being aware of it, it’s just that the hardware involved happens to be 
located on the preises.

In particular we discussed backup configurations for 4D server and this was 
interesting because, while I requested independent drives for logfile 
(“journal”) and datafile purposes, he essentially told me to just stick 
everything on the same drive because it was virtual anyway and had multiple 
redundancy protection via raid, 15-minute snapshotting etc. He offered to 
“create” a C: and a D: drive to make me feel better, but pointed out that 
they’re not much more independent than 2 folders would have been.

CONCLUSON
I now realise that the “WAN” / “LAN” distinction is disappearing. He said the 
only reason the “cloud” solution wasn’t hosted off-site was that they had 
measured the bandwidth that the customer used and calculated that the cost 
would be astronomical if it was on AWS or something like that, but in all other 
respects it was a cloud solution.

I was wondering, how do other major 4D server deployers optimise their 
deployment strategies to take advantage of this ? It seems a great thing that 
we are being “floated out to the cloud” without actually having to do extra 
significant work, but what about things like the backup strategy ? I don’t 
really like the idea that the log file has the same redundancy system as the 
main datafile because the whole idea is that the corruption doesn’t get 
replicated (which is what a RAID system does) and it’s independent at the 
logical level.

We seem one step away from being able to supply server solutions where “our” 
customer doesn’t have to host the database server on premises. Is anybody doing 
this at an advanced level ? (e.g. connecting with 4D client native to a 4D 
server that’s 3rd-party hosted).

Regards

Peter

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

Windows OS level backup trashing 4D

2019-09-23 Thread Peter Jakobsson via 4D_Tech
Hi

I’m sure this is an age old issue but I thought I’d solicit some opinions on 
addressing it in case anyone cares to post their experiences.

The OS level backup is saving the operating system (which nobody cares about) 
and trashing 4D (which everybody cares about).

The site runs a mission critical 4D Server under 4D 2004 (it should be getting 
retired/replaced with a new 4D system in a month or two) which is under 3rd 
party contractural support that includes twice daily backups at OS level. Every 
week the server crashes when nobody is using it and I’m cure it’s because of 
the Windows backup process conflicting with 4D which has the datafile open. I 
think it’s one of these that freezes everything while it backs up and then 
“unfreezes” it.

It would be good to have 4D write its own backup to an external drive and than 
have the OS backup run on that one instead. But the contractor then feels 
exposed contracturally for not backing up the main OS so it’s like talking to a 
brick wall.

How do others address this ?

Regards

Peter

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

Re: More on 4D Objects and 'Inheritance'

2019-09-16 Thread Peter Jakobsson via 4D_Tech
rofl !  That was a very inspiring post.

Ok I think thats pushed me over the edge. OO 4D here I come.

> On 16 Sep 2019, at 22:23, Aparajita Fishman via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> Well my recommendation is not to use New formula ever.
> 
> Translation: “I’m not sure I can use them properly, therefore no one should.” 
>  
> 
> 
>> Even with properly
>> encapsulated code structured in a way that makes sense, it's still
>> impossible to get the context, source, or whether or not the method call
>> even exists in the object.
> 
> Not my experience at all.
> 
> 
>> It's basically just a dangerous feature at this
>> point just waiting to explode when your ".get()" isn't the same ".get()" as
>> you were expecting.
> 
> Not my experience at all.
> 
> 
>> 4D needs to add actual class structures for it to be
>> 1) Easy to document and lookup the source, or see the actual function
>> documentation like now when we mouseover a method call.
> 
> True, but I have found the benefits far outweigh those minor inconveniences. 
> Looking up the source is trivial if you use a good naming convention.
> 
> 
>> Right now there would be a lot of
>> overhead to design an object correctly so that New formula use doesn't
>> spiral out of control
> 
> Not my experience at all. I ported https://github.com/expressjs/express 
>  to 4D.
> 
> 
>> , and even then, time consuming to maintain.
> 
> Not my experience at all.
> 
> 
>> I tried applying it in another case
>> where there was no UI and a lot of processing in loops. It was slow.
> 
> Not my experience at all. I see no measurable slowdown.
> 
> - Aparajita
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: More on 4D Objects and 'Inheritance'

2019-09-16 Thread Peter Jakobsson via 4D_Tech
Fascinating stuff Kirk.

Thanks for posting.

Peter

> On 16 Sep 2019, at 17:10, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Not everyone is a fan and there are some good arguments to be made

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

More on 4D Objects and 'Inheritance'

2019-09-16 Thread Peter Jakobsson via 4D_Tech
Hi

Just expanding on that last thread, (“Why does this not work") there do appear 
to be some real object orientation aspects to the new 4D commands - at least 
from the point of view of what’s needed and useful in a high level environment 
like 4D.

The key is the new “This” self-referencing function because it now lets you 
create an active object as a class. I realise OO purists may not regard it as a 
class, but it’s as much of a class as I’ve ever used in OOP languages and I 
don’t see what else we’d want or need. It can contain both encapsulated 
properties AND methods. Also, we don’t need to keep passing it an object 
reference from an external call to execute those methods using the “internal” 
properties and we can create new instances of objects from that class using the 
OB Copy command (which basically does the same job as “New”).

Immense !

For example, try this (needs v17 R3 or greater):

C_OBJECT($animal;$dog;$cat;$pet)

// 1. Define a class

$animal:=New object("sound";"";"talk";Formula(ALERT(This.sound)))

// 2. Instantiate new objects from the class which inherit its properties and 
behaviours

$dog:=OB Copy($animal)
$cat:=OB Copy($animal)

// 3. Customise the objects

$dog.sound:="wooff"
$cat.sound:="meow"

// 4. Do stuff using the encapsulated object reference defined in the class

$pet:=$dog
$pet.talk()

$pet:=$cat
$pet.talk()

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

Re: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
That was a very inspiring post.


> On 15 Sep 2019, at 21:44, Aparajita Fishman via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> ORDA looks really interesting too but I haven't played with it yet, but I'm 
>> looking forward to experimenting with it soon.
> 
> It’s more than interesting, it’s bringing 4D into the 21st century. It’s the 
> way DB access has been on other platforms for a long time, and it's just way, 
> way superior to the legacy 4D way. Don’t ask me why, just start using it and 
> you’ll see why.
> 
> 
>> New formula (that you mentioned) has arrived with 17 R3.
> 
> This is probably the most significant addition to the language after objects. 
> Coming from a world outside 4D where functions are first class objects, 
> formulas *finally* let me do stuff that was easy to do in other languages but 
> was impossible to do in 4D. Don’t ask me how. Better to learn Javascript and 
> then see how techniques there can be applied to 4D.
> 
> 
>> File management with Path to object and Object to path are really great 
>> commands to finally have. 
> 
> Those are old school. Upgrade to R5 and use File and Folder.
> 
> 
>> Of course, what we still need is the ability to create OOP-like Classes in 
>> 4D with the associated capabilities like member variables and methods, 
>> object instantiation (may be even class reflection), etc.
> 
> I’m already doing everything you just mentioned. In fact, I’ve been able to 
> port several npm packages (including expressjs) to 4D. Don’t ask me how. If 
> you have a firm understanding of object oriented languages, just start 
> exploring the possibilities given by objects + formulas.
> 
> - Aparajita
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech

> On 15 Sep 2019, at 14:32, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Don't try to fit a square peg into a round hole just yet

Fair enough, Jeff. I won’t, and your advice is of course wise re. “the real 
thing is coming”.

But it’s still interesting to explore the potential evolution in approach. For 
example even though a pure object oriented approach isn’t possible, an object 
based one is since we can create stateful data structures that at least mimic 
the behaviour of real class based ones and are therefore easier to manage in 
terms of documenting and auditing their behaviour.

Peter

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

Re: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi Narinder

Thanks for posting your commentary. Very interesting.

Regards

Peter

> On 15 Sep 2019, at 13:58, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think our coding style will need to undergo an evolution rather than 
> revolution

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

Re: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Thanks Narinder.

Doesn’t this imply we need to change our entire style and approach to coding ? 
Language data structures, forms, the lot ?

Have you found you needed to do this ? (At least in terms of new code and 
optimal approaches).

Having attended the last couple of summits and various classes etc I’ve been 
aware of this looming in the background but the dot notation really is the 
breakthrough for me that warrants taking the leap across the “discontinuity 
gap” from old to new. It reminds me of working in Visual Basic years ago which 
used all this object oriented approach. 4D even lets you create a kind of 
“active object” now with “New Formula”.

Doesn’t this mean a complete revision of how we code form the ground up ? 
Finding new “best practice” approaches to absolutely everything ? (As we even 
have “collections” now so even the most fundamental aspect of 4D - current 
selections - is out of the window).

I might need to take a month off and read the whole manual again for the first 
time since 1988 !

Peter

> On 15 Sep 2019, at 12:52, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> Yes, for legacy structures that are converted to v17 you have to explicitly 
> enable Unicode support and also enable the "Use object notation..." setting 
> under Compatibility
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi Narinder

So it does. I created a brand new structure and it now works.

I did that example in a legacy upgraded structure so maybe there’s some 
compatibility setting that I needed to change to fully support the new object 
syntax.

Many thanks for taking the time to check it and respond !

Peter

> On 15 Sep 2019, at 12:41, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I just tested your code exactly as-is and all the variables have the expected 
> values. I used 17.2 on Mac

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

Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi

Using the v17 dot notation I was unable to get one object to inherit another’s 
properties using the assignment operator. Also when I inspect $dog in the 
debugger after assigning the first property, it appears empty.

Code is:

C_OBJECT($animal;$dog;$cat)

$dog:=New object
$cat:=New object

$dog.sound:="bark"
$cat.sound:="meow"

$animal:=$dog
$getSound:=$animal.sound

Running this in the debugger, $dog and $cat return “{}”, yet hovering over 
$dog.sound with the cursor does display the property value. $animal.sound 
returns undefined.

Why does this not work ?

Regards

Peter

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

Web area fail on accessing secure area

2019-06-01 Thread Peter Jakobsson via 4D_Tech
Hi

I’m slightly poking around in the dark here looking for a handle.

In a 4D Web Area, the a login “submit" button has no effect when submitting 
username and password to a secure area. The site concerned is the gov.uk (UK 
Government services).

i.e. we start here: https://www.gov.uk/log-in-register-hmrc-online-services
Then click the “Sign In” button which takes the user to the logon page. After 
that the subsequent submit action fails if done through a 4D Web Area on 
Windows (works fin on Mac). The perplexing thing is that a test version of this 
page works - even on Windows. (I am subscribed to the gov.uk HMRC Developer Hub 
which provides “sandbox” environments. The logon works fine in the sandbox with 
the 4D web area). By the way, I of course tested it with a regular browser and 
it works fine.

I don’t expect any instant solutions but if anyone has any bright ideas for 
further investigation I’d appreciate hearing them !

Specs are:

4D v15
Plain form with WebArea ("Use Internal Web Kit”=True)
No 4D methods involved except WA OPEN URL(web are;url)
Windows 7, Windows 10 tested

Best Regards

Peter

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

Re: Miyako Excel Component

2019-05-24 Thread Peter Jakobsson via 4D_Tech


> On 24 May 2019, at 19:48, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> There are many xl things in Miyako's shop (I only know the freeXL one, it 
> reads .xls):
>  >
> 
> I'd use Rob Lavaux's XL plugin, the demo mode is enough for your need (and 
> it's worth it):
>  >

Thanks Arnaud !

Very helpful.

Peter

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

Miyako Excel Component

2019-05-24 Thread Peter Jakobsson via 4D_Tech
Hi

I have a one-off need to create 2 very small (about 9 rows each, 2 columns) 
spreadsheets from 4D in native Excel format.

Is Miyako’s component still available anywhere ? The sources.4d.com site seems 
to have gone away. (Or maybe I’m just not accessing it correctly…is it FTP ?)

Thanks

Peter

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

Re: Capturing workstation timezone from the OS

2019-05-06 Thread Peter Jakobsson via 4D_Tech
Hi John

Many thanks. Nearly a decade old ! Should be well trodden.

Peter

> On 6 May 2019, at 18:03, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> This gives the number of seconds offset from GMT.
> 
> John DeSoi, Ph.D.

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

Capturing workstation timezone from the OS

2019-05-06 Thread Peter Jakobsson via 4D_Tech
Hi

I’ve been looking into capturing the OS timezone (i.e. GMT +01 etc) from the 4D 
language but have drawn a blank. I thought there might be some fancy footwork 
with String(?00:00:00?;ISO GMT) or something trick like that possible but I’ve 
been unsuccessful.

Has anyone done this without resorting to LAUNCH EXTERNAL PROCESS shell scripts 
and so on ?

Regards

Peter

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

Unexpected authentication window appears in web area

2019-04-25 Thread Peter Jakobsson via 4D_Tech
Hi

I have a very simple web area embedded in a 4D form for logging into an 
authenticated domain. I’m observing different behaviours in Mac and Windows:

Mac:
works fine. You enter user and password, click the web page submit button and 
authentication is successful. Next web page appears

Windows:
On clicking the submit button a small OS type window opens over the form with 
“User Name” and “Password” fields. It’s in French which makes me think it’s 
coming from the 4D web area plugin itself

Even if the correct user name and password are entered (for a second time) into 
this “secondary” authentication window, authentication fails.

See here for screenshot:

https://imgur.com/fQdtNYu

Anyone seen this or have any idea as to why this appears ?

Regards

Peter

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

Re: Formatter that only shows decimals

2019-04-08 Thread Peter Jakobsson via 4D_Tech


> On 8 Apr 2019, at 00:19, Mark Katz via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Maybe (likely) I’m missing something but couldn’t you display the actual 
> value x 100 instead of the actual value?

Hi Mark

Yes, I could do that. I was just wondering if the formatter could do it because 
it would ideally be desire-able to not reprocess the original data in this 
case. (i.e. I just want to display the number of pence/cents that’s there not 
calculate them).

Peter

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

Formatter that only shows decimals

2019-04-06 Thread Peter Jakobsson via 4D_Tech
Hi

Does anyone know how to do a formatter that only shows (currency) decimals but 
that hides the decimal point ?

I have used ".00;-.00;00” which works ok except that the decimal point itself 
displays. I’d like to only display the numerics without the point if poss.

Thanks in advance for any tips.

Peter

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

Re: OAuth

2019-03-15 Thread Peter Jakobsson via 4D_Tech


> On 10 Mar 2019, at 09:51, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>  The server I’m hoping to talk to is the Value Added Tax server at HMRC in 
> England (in a couple of months’ time, entering figures for VAT returns will 
> have to be done by software rather than online, by hand, at present).

Hi Jeremy

I am also doing this. I have a couple of sites using the same 4D application 
that I need to make MTD compliant by next month for VAT return filing.

I’ve done quite a bit of API work before but am just at the HMRC “hello world” 
stage just now.

Will post my approaches here when I know what I’m doing !

Regards

Peter Jakobsson

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

Re: 4D Developer Available

2019-02-26 Thread Peter Jakobsson via 4D_Tech
That is a stellar curriculum I must say.

Good luck with your new phase !

Peter

> On 26 Feb 2019, at 17:52, Tom Benedict via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have recently left my long time employer and begun free-lance 4D 
> development work. 
> 
> I have 24+ years of experience scaling a 4D solution from a departmental 
> application into a full enterprise system.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Epoch time in milliseconds

2019-02-20 Thread Peter Jakobsson via 4D_Tech
Thanks Arnaud !

Very useful indeed. Bruno has been very productive in this area.

> On 20 Feb 2019, at 22:19, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 
> You may be interested by 2 methods from Bruno Legay about epoch in the code 
> sharing zone:
>  >
>  >

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

Re: Epoch time in milliseconds

2019-02-20 Thread Peter Jakobsson via 4D_Tech


> On 20 Feb 2019, at 01:29, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> $P_timeString:=String(Current date(*);ISO date GMT;Current time(*))
> 
> does this not invoke 2 calls to the server in C/S mode?

Good point Miyako. (I stopped worrying about optimising for performance years 
ago).

Must try and upgrade to v17 - I keep coming up against increasing amounts of 
features which I need that it has.

Peter

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

Re: Epoch time in milliseconds

2019-02-19 Thread Peter Jakobsson via 4D_Tech

Actually I just realised this may be a timezone issue rather than a precision 
issue.

I’ve done it this way:

*** 1. Get UTC Time ***

$P_timeString:=String(Current date(*);ISO date GMT;Current time(*))

$P_timeString:=Replace string($P_timeString;"Z";””). <— Prevent it from 
reverting back to local time

$P_date:=Date($P_timeString)
$P_time:=time($P_timeString)


2. convert to Posix *

$P_baseDATE:=!01/01/1970! 

$P_countDAYS:=($P_date-$P_baseDATE)  // Gets the whole number od days 
elapsed
$P_countSECONDS:=($P_time +0)

$P_posixTIME:=(($P_countDAYS*86400)+$P_countSECONDS)

$0:=Int($P_posixTIME)*1000



> On 19 Feb 2019, at 23:25, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The problem is that if I convert Current Date and Current Time to 
> milliseconds there’s a precision error of up to a second and the API server’s 
> I’m using think I’m out of sync

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

Epoch time in milliseconds

2019-02-19 Thread Peter Jakobsson via 4D_Tech
Hi

Does anyone have an idea how to get the epoch time in milliseconds in native 4D 
?

The problem is that if I convert Current Date and Current Time to milliseconds 
there’s a precision error of up to a second and the API server’s I’m using 
think I’m out of sync. Is it another job for PHP ?

Regards

Peter

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

Re: HMAC SHA512 Signing - solved

2019-02-16 Thread Peter Jakobsson via 4D_Tech

The answer was hiding in plain sight !!

$isOk:=PHP 
Execute("";"hash_hmac";$P_dataSignature;"sha512";$P_dataRequestRaw;$P_apiSecret)

…and it works.

> On 16 Feb 2019, at 20:35, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I’ve spent about half a day researching this so far so thought I’d give the 
> NUG a try. Is anyone familiar with a way to do HMAC SHA512 signing in 4D ?
> 

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

HMAC SHA512 Signing

2019-02-16 Thread Peter Jakobsson via 4D_Tech
Hi

I’ve spent about half a day researching this so far so thought I’d give the NUG 
a try. Is anyone familiar with a way to do HMAC SHA512 signing in 4D ?

v17 now supports SHA512 in the Generate Digest command but that doesn’t do 
signing. I also tried NTK’s "NTK HMAC Text” (with the “SHA512” argument) and do 
get a result but it doesn’t work and when I compare the output with a reference 
site I’m using it’s completely different. (This is the reference site I’m using 
https://www.freeformatter.com/hmac-generator.html#ad-output).

I thought maybe someone might know of a “LAUNCH EXTERNAL PROCESS” solution or 
similar.

Regards

Peter

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

Caching URLs. Hashed or unhashed ?

2019-02-15 Thread Peter Jakobsson via 4D_Tech
Hi

I am caching the responses from a commercial API services to save costs. (i.e. 
the code does a lookup on a 4D table on the exact URL of the API call to see if 
we already have that response in the cache).

What is people’s opinion on best practice for storing and querying on URL’s ? 
Should we hash them (say with MD5 Digest or something) in case the URL has 
dodgy characters like back-slashes or @ that might screw up 4D's query algo and 
then search on the hash instead ?

Best Regards

Peter

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

Re: Subject: Re: Amazon EDIFACT/X12 Gateway

2019-01-09 Thread Peter Jakobsson via 4D_Tech
Hello Jim

I just saw this message. Thanks for replying - interesting case.

Regards

Peter

> On 7 Jan 2019, at 16:45, Jim Medlen via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> We have an account with OpenText an EDI VAN (Value Added Network)
> We use their software to Send and receive EDI documents.

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

Amazon EDIFACT/X12 Gateway

2019-01-04 Thread Peter Jakobsson via 4D_Tech
Hi

A very happy new year everybody.

I have an ERP running at a customer site who is a big Amazon suppler (i.e. they 
sell products/services TO Amazon). Amazon want them to submit sales invoices 
via their EDIFACT (or X12) gateway.

I’m a bit out of my depth here as I haven’t done any EDI stuff before, although 
I have quite a lot of experience with interfaces in general - ftp, http, etc. 
Where to start !? Does anyone have experience of this that could point out the 
basics or direct me to some useful docs ?

The comms protocol is AS2 so it would seem that the actual connection is done 
over http. I presume it’s then a case of formatting the documents and sending 
them as an http attachment, but that’s as far as I’ve got so far.

Any tips welcome.

Best Regards

Peter

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

Re: Backing up a VM - is it dangerous ?

2018-11-05 Thread Peter Jakobsson via 4D_Tech
Many thanks for the useful replies.

I’ve contacted the IT contractor to try to negotiate a new backup strategy.

Hopefully it will be less of a sweat than the China trade talks :-)

Peter

> On 5 Nov 2018, at 13:36, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Definitely not safe prior to v17.

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

Backing up a VM - is it dangerous ?

2018-11-05 Thread Peter Jakobsson via 4D_Tech
Hi

One of my sites contracts out their server maintenance, procurement and general 
support to an IT contractor. The contractor is fairly adaptable and I have good 
professional relations with them, however I still have to work within certain 
“overall parameters”.

One of these is that their 5-user 4D accounts server runs on a VM (Virtual 
Machine). When I asked them about an external drive to hold the 4D backups, 
they replied “don’t worry, the whole VM gets backed up once per day and the 
backup is held on external drives”.

What are the implications of backing up the VM while 4D server is still running 
? On the old days this would have been a complete no-no because of un-flushed 
caches, locked datafiles and all sorts of issues. Is anybody running this 
particular configuration ?

Though I hopefully won’t be visiting the dentist anytime soon, Laurence 
Olivier's words to Dustin Hoffman spring to mind…..”is it safe !?”  ;)

regards

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

Re: Longing IDs or UUIDs as primary key?

2018-10-24 Thread Peter Jakobsson via 4D_Tech
> On 24 Oct 2018, at 16:52, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> The process seems quite cumbersome: to start, I need to remove the ‘primary 
> key’ flag from all the ID fields

Rudy -

Just to add to the many useful contributions made so far, I found a way to do 
this in a few seconds which makes the process almost painless. (Courtesy of the 
late but much celebrated Ortwin Zilgen).

The approach is:

1: run the code below to add keys to all tables. (This will keep 4D backup 
happy and let you do your replication)
2: carry on as usual using your IDs as “logical keys” or “business keys” as I 
call them, and remain blissfully ignorant of the UUID layer

Ortwin’s code that he sent me is posted below.

Best Regards

Peter

** Generate Primary Keys for All Tables **
`
`.By Ortwin Zilgen
***

C_LONGINT($i;$P_SIZE)
C_TEXT($tableName_t)

$fieldName:="pkUUID"

$P_SIZE:=Get last table number

For ($i;1;$P_SIZE)
If (Is table number valid($i))

$tableName_t:=Table name($i)
$statement_t:="ALTER TABLE ["+$tableName_t+"] ADD "+$fieldName+" UUID 
AUTO_GENERATE PRIMARY KEY;"

Begin SQL
EXECUTE IMMEDIATE:$statement_t;
End SQL

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

Re: Defining and documenting Objects

2018-10-11 Thread Peter Jakobsson via 4D_Tech


> On 11 Oct 2018, at 12:02, Bernd Fröhlich via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> All true, but with globals you can have hard to find side effects.
> E.g. i have a lot of buttons and other variables on a lot of forms use 
> "standard" global variables (bOK, bCancel, bSave, bPrint, bWhetever) so that 
> I don´t have to define new globals for each form.
> 
> Now and then it happened, that one form changed one of those variables that 
> was also used by another form. Good luck with finding those bugs because they 
> only happen now and then and are seldom reproducable.
> Using only dynamic variables in my forms saves me from those headaches.

Ok, thanks for that clarification - I can see your reasoning.

But just as a bit of philosophical fun, imagine if things were the other way 
around. Since v1 we had always been using objects and you needed to use 
accessor commands to do absolutely anything with either data or active form 
objects. Then one day 4D, after 25 years, 4D came along with this great new 
feature - a built in wrapper for the object accessors (called a “global 
variable") that sported a host of great productivity advantages:

 - maintains state for you without any coding (no laborious “sets” and “gets” 
anymore)
 - a single point of reference for the property instead of tens or hundreds of 
local variables capturing the same property, all with potentially different 
names and contexts
 - compiler support for typing to detect bugs “ahead of time”
 - design time find, replace and rename support - again with a single point of 
reference

I think I might happily pay the price of recreating the variable table for 
every process (since I never noticed any adverse effect of that) and use naming 
conventions to avoid conflicts to get those features ! ;)

The original selling point of 4D was that it was stateful and that 
statefullness is what gave us massive productivity gains. Lower level languages 
like the Microsoft developer platforms, Delphi and even Javascript/Python type 
environments had the versatility but you had to pay the price in coding 
according to the classic, stateless styles. 4D is now allowing us to do stuff 
you could do in these languages but there’s a great big banana skin potentially 
associated with that transition which is productivity. For example when I 
started building widgets in 4D, they could be “very nice” but my productivity 
absolutely plummeted since you need to spend most of the time on designing 
plumbing systems, event models and custom data structures instead of solving 
business problems which have traditionally been the 4D developer’s domain.

Just a thought.

Sometimes it’s difficult to tell novelty value and practical value apart. (Well 
it is for me at least :-) )

Regards

Peter

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

Re: Defining and documenting Objects

2018-10-11 Thread Peter Jakobsson via 4D_Tech


> On 11 Oct 2018, at 08:49, Bernd Fröhlich via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> there are no globals required for menus (I assume here that you are talking 
> about popup menus in the form).
> Just give them an objectname, get a pointer in the "on load" phase with 
> Object Get Pointer and define the array using that pointer.

Hi Bernd

Thanks for that tip. I will experiment with your approach.

Out of interest, what advantages does this give you over using a global ? The 
advantage of a global to me is that it preserves state throughout the life of 
the form without any coding. (For example you don’t need to keep using Object 
get Pointer(“myPopUp”) all over the place to re-create the state). Also, using 
globals lets you do a lot of type-based debugging at compile time.

If we take this to its logical conclusion won’t we just end up with Delphi, 
.NET or Python instead of 4D ? (i.e. a low level environment that’s extremely 
versatile but far less productive).

Regards

Peter

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

Re: Defining and documenting Objects

2018-10-10 Thread Peter Jakobsson via 4D_Tech
Hi

This is a good point made by Paul...

> On 5 Oct 2018, at 09:15, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> With tables and records and the structure it's relatively
> straightforward to track through the code and work out what's going on. I
> can see this being a real problem with objects. There just doesn't seem to
> be any visibility. The data could be buried many layers down in an object
> let alone all the quotes, dots and semi colons involved


I also agree with Kirk’s last post about unncecessary redundancy when you have 
a perfectly working programming paradigm already - and they do indeed take some 
documenting (at least in the code) - and you can get yourself tied in knots, 
especially when you go even one level of object hierarchy.

Despite that, I have recently taken the leap to using objects as arguments in 
methods and passing parameters “by name” rather than using $1..$N.

I did this because Laurent Ribardierre and JPR recommended this approach so 
categorically at the last advanced developers class. Also, when they demoed the 
new features of v17 and I saw the roadmap I can kind of see why - 4D want to 
drastically loosen the coupling between the forms layer, the code and the 
database engine. So what I’m doing now is just using a single object to hold 
all form properties that I’d previously used globals for. Then just use globals 
where required for active objects like menus.

You can preserve some of the formality of the old “$1…$2” approach by writing 
wrappers to “receive” the object properties and simultaneously “define” the 
form parameters - so that an error can be thrown is something’s missing from 
the mandatory argument list for example. But one of the advantages of this new 
approach I’ve noticed is massive flexibility when it comes to initialising the 
form. It’s much easier to refactor or add/remove parameters. (Say you had a 
function that opened the form and that function took some initial states as 
$1…$n. Just passing a single object instead saves having to support the 
argument list right up and down the call chain.

Also, I’m still on v15 but at the end of the day the new dot notation 
referenced object properties will not be much different from the old global 
variable approach.

Peter

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

Re: 4D Write (v15) Images Slanted

2018-09-12 Thread Peter Jakobsson via 4D_Tech
Hi

It appears I’ve solved this - it needed to be a JPEG. But I presume this won’t 
print too well.


> On 12 Sep 2018, at 22:05, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> appears slanted at a 30 degree angle

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

4D Write (v15) Images Slanted

2018-09-12 Thread Peter Jakobsson via 4D_Tech
Hi

I looked back in the archive for an answer to this one and found some useful 
posts regarding DPI etc. However when I paste an image into 4D Write (legacy 
version), the image appears slanted at a 30 degree angle (roughly). Have tried 
forcing the image into both 300 dpi and 600 dpi in Photoshop but still get the 
same result.

It’s a company logo for a document header, so no more than 1990’s feature set 
required.

Has anyone seen this phenomenon that can point me at what the cause is ?

Regards

Peter

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

Re: PDF generation on Windows - Latest Thinking

2018-09-12 Thread Peter Jakobsson via 4D_Tech


> On 12 Sep 2018, at 21:22, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> PDF Creator 1.7 works just fine on Windows 10. No problems. And it has many 
> more configuration options than the built in Window 10 PDF driver. And it 
> does not have a nuisance bug the Windows 10 driver has (see below). Now you 
> have a choice. 

Very interesting and useful post - thanks !

The 4D code is configured to use PDF Creator 1.7 at the moment. It would be 
good if I could just install PDF Creator on Windows 10 and have it work as 
before without any code modifications. I think I will try this.

Peter

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

Re: PDF generation on Windows - Latest Thinking

2018-09-12 Thread Peter Jakobsson via 4D_Tech
Many thanks for the replies.

I’ll attempt to go with the native PDF engine.

Regards

Peter

> On 12 Sep 2018, at 15:19, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think it does run on windows 10

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

PDF generation on Windows - Latest Thinking

2018-09-12 Thread Peter Jakobsson via 4D_Tech
Hi

For years I used PDF creator to generate PDFs from 4D on Windows 7 - mainly 
because you didn’t have to type in a document title for every single page in a 
print run and this could be done from code. My customer has now upgraded to 
Windows 10 and it’s using the default PDF writer as I didn’t install creator. 
It works but it asks her to enter a title for each document instead of sending 
them all to disk directly.

Is PDF Creator still the preferred option on Windows 10 ?

Just wanted to see what people were using as their preferred choice.

Many thanks in advance !

Peter

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

Re: Roy (Suzi) McGregor Paterson R.I.P

2018-09-10 Thread Peter Jakobsson via 4D_Tech
I am very sorry and taken aback to hear of this. I can only imagine that he was 
subject to illness as it seems premature.

I always chatted to Roy at meetups going right back to the 1992 summit in the 
Meridien Montparnasse at the launch of 4D server when I remember him telling me 
he was starting to "get his head around pointers”.

My condolences to those who were close to him.

Peter

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

Re: Time Machine error -8003 when restoring 4D structures

2018-06-18 Thread Peter Jakobsson via 4D_Tech
Ah !

Good idea. That’s the kind of thing I’d think of for my clients but never 
myself ;)

Thanks for the tip Charles.

Regards

Peter

> On 18 Jun 2018, at 23:01, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> It does. How about using 4d backup and then backing that up.You could run it 
> every hour on your structure only.

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

Time Machine error -8003 when restoring 4D structures

2018-06-17 Thread Peter Jakobsson via 4D_Tech
Hi

MacOS 13.13.5, High Sierra on a recent Macbook Pro.

I’m getting this error when attempting to restore 4D structures from a Time 
Machine archive. It’s not just one - several of the archives have it but it 
only seems to apply to 4D structures. If I try to restore other things - like 
text docs - it works ok.

It has the appearance of a permissions type error because the structure file 
copies ok from the backup drive (i.e. the little watch icon “fills up”) but 
just when it gets to the end there’s a delay and eventually the -8003 error 
pops up, like it can’t let go of the file or something.

I’m wondering if it could be due to Time Machine backing up while I have the 
structure open in 4D. It’s not been a problem in previous years.

Can anyone else shed light on this phenomenon ?

Regards

Peter

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

Re: 4D Summit 2018 Comments

2018-04-09 Thread Peter Jakobsson via 4D_Tech

> On 9 Apr 2018, at 21:25, Richard Wright via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I’ll be interested in learning how this differs from Views, not necessarily 
> 4D’s rather simplistic implementation, but something like Oracle’s, along 
> with their very powerful SQL implementation.


Hi Richard -

Isn’t the difference that 4D’s object model is seamless ? It extends from the 
language and continues into to structure and database engine in a way that SQL 
based technologies can only emulate. (i.e. you always have a discontinuity at 
some point where the SQL query has to “wrapped” to create the illusion of an 
active data object).

This is consistent with 4D’s legacy approach (which IMO was also a generation 
downstream from SQL) where we are able to use data structure objects directly 
in the language without having to “map” them to text-based query statements 
that we just cross our fingers and “hope” the DBMS understands.

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

Re: [SAD NEWS] legendary developer and 4D base-rock Ortwin Zillgen

2018-02-28 Thread Peter Jakobsson via 4D_Tech
Hi Alexander

Thank you for passing on this news and I’d like to add my condolences and 
deeply felt sadness at the departure of such a creative and appreciated 
contributor to the 4D community.

I had occasion to liaise with Ortwin on a couple of projects and his input was 
always spirited, engaging and of course highly professional. He’s also left a 
huge legacy of techniques and tools, most of which he made freely available to 
the community on his website.

I’m truly sorry to hear of this and wish his family and close friends every 
comfort at what appears to be a very unexpected loss.

Regards

Peter Jakobsson


> On 27 Feb 2018, at 12:22, Herr Alexander Heintz via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Fellow 4D developers,
> 
> it is with great sadness, that I have to inform you, that Ortwin Zillgen has 
> passed away end of last week.
> Suddenly, unexpectedly and far to early at the young age of 64.

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

Re: Docs about "twinned" process and pre-emptive mode

2018-01-19 Thread Peter Jakobsson via 4D_Tech
Ok, I dug out an old laptop which had a lot of interesting discussion on this 
from 2011. What I’m wondering is if triggers can now run pre-emptively (if they 
are compliant code-ways: no IP variables etc).

In 2011, David Dancy said that any regular 4D code whatsoever would force the 
method to run co-operatively. But then in 2016 there is a discussion that 
appears to imply that triggers can run preemptively IF they don’t run any 
non-complient code.

By the way, I found the documentation I was looking for: 
http://doc.4d.com/4D-Language-Reference-16.3/Processes/Preemptive-4D-processes.300-3651705.en.html
 


That seems to endorse the idea that triggers can run preemptively if they are 
compliant. I wonder when that feature arrived ?

Regards

Peter

> On 19 Jan 2018, at 04:10, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> you will see a P (for preemptive) or C (for cooperative) indicated for each 
> network request.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Docs about "twinned" process and pre-emptive mode

2018-01-19 Thread Peter Jakobsson via 4D_Tech


> On 19 Jan 2018, at 04:10, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> are you familiar with the request log file?
> 
> you will see a P (for preemptive) or C (for cooperative) indicated for each 
> network request.

The log file seems to do this for everything *except* the SQL statements (which 
are the ones I’m interested in)…

https://s18.postimg.org/719e5wjjt/sql_Screenshot.png

Peter

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

Re: Docs about "twinned" process and pre-emptive mode

2018-01-18 Thread Peter Jakobsson via 4D_Tech
Thanks Miyako. That’s useful.

I basically was wanting to know if inline SQL used the “twinned” pre-emptive 
thread or not.

Peter

> On 19 Jan 2018, at 04:10, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> are you familiar with the request log file?
> 
> you will see a P (for preemptive) or C (for cooperative) indicated for each 
> network request.

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

Docs about "twinned" process and pre-emptive mode

2018-01-18 Thread Peter Jakobsson via 4D_Tech
Hi

I’ve been raking through the online documentation trying to find where the 
querying modes pre-emptive / co-operative are documented but have been 
unsuccessful.

What I’m specifically looking for is more background on what conditions SQL 
queries use the twinned pre-emptive process for example.

Can anybody point me to a link ?

Many thanks !

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

Re: Saving an object array to disk

2017-12-06 Thread Peter Jakobsson via 4D_Tech

> On 5 Dec 2017, at 20:45, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The docs say: "WARNING: This command does not support array variables. Use 
> the new BLOB commands instead."

Thanks Tim

Didn’t see that.
> 
> Why don't you just use SQL EXPORT SELECTION and SQL EXECUTE SCRIPT?


That’s an interesting approach. I will mentally bookmark it for future use

At the moment I’m using “Selection to JSON” to dump the data into a text 
variable and then SAVE VARIABLES to out it to disk. This is an absolutely 
awsome way to do it I’ve discovered if you’re migrating between heterogeneous 
table structures because you basically have the table at the other end in an 
object array where each source record is accessible at field level by name 
without requiring a temporary table to dump it do.

Cheers for the replies !

Peter

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

Re: Saving an object array to disk

2017-12-05 Thread Peter Jakobsson via 4D_Tech


> On 5 Dec 2017, at 16:18, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> (I’m trying to migrate an entire table for processing selectively in another 
> structure. I packed each record into respective elements of an object array 
> then wrot eit to disk with SAVE VARIABLES. No I’m reading it back in with 
> LOAD VARIABLES but it crashes).

Ok, I think I can use "Selection to JSON" and "JSON PARSE ARRAY" at the other 
end for this.

Peter

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

Saving an object array to disk

2017-12-05 Thread Peter Jakobsson via 4D_Tech
Hi

Has anyone used the SAVE VARIABLES command with an object array ? I am getting 
crashing when I try to read it back in with LOAD VARIABLES.

The test data is tiny so it isn’t size that’s the problem. Just wondering if 
anyone’s tried it.

(I’m trying to migrate an entire table for processing selectively in another 
structure. I packed each record into respective elements of an object array 
then wrot eit to disk with SAVE VARIABLES. No I’m reading it back in with LOAD 
VARIABLES but it crashes).

SAVE VARIABLE(docpath;arrObjects)

Thanks in advance for any tips.

regards

Peter

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

Re: Tip: Exporting to a target folder in a package

2017-10-24 Thread Peter Jakobsson via 4D_Tech

> On 24 Oct 2017, at 12:39, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Have you tried Select document? It lets you navigate inside of packages.


> On 24 Oct 2017, at 12:48, Koen Van Hooreweghe via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Select folder allows you to navigate into a package if you add the Package 
> open constant as ‘options’, third parameter.
> Same for Select document fourth parameter.

Ah. That’s the answer. More manual reading required. Many thanks !


> On 24 Oct 2017, at 15:57, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Why would you let users put stuff in resources folder

Chuck & Kirk -

It’s a developer utility so the “user” concerned isn’t an “end user” but a 
developer user (that would be myself ;) ).

Cheers

Peter

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

Tip: Exporting to a target folder in a package

2017-10-24 Thread Peter Jakobsson via 4D_Tech
Hi

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).

The only way I could do it was:

1. open the package in the MacOS desktop using the right-click contextual “Open 
Package” command
2. drag the resources folder to the sidebar shortcuts list
3. then use the sidebar shortcut as the target for the export path

This seems to work. The question is, is it a feature or a bug ? Will 4D patch 
this up once they discover it so that I can no longer use this workaround ?

Any comments, feel free !

Regards

Peter

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

Re: oh sweet

2017-10-06 Thread Peter Jakobsson via 4D_Tech

> On 6 Oct 2017, at 17:54, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> How long have i wanted this….

+1 Nigel !


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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-06 Thread Peter Jakobsson via 4D_Tech

> On 5 Oct 2017, at 21:15, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We have a lot of 4D developers working here, but I'm on the only who 
> participates actively in the list. Also, 4D has a lot fewer "issues" these 
> days than in the old days.

I’m probably in this category on both counts.

I hardly ever post on the list, yet I work in 4D every day.

Peter

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

Re: Use of Objects vs Global Variables (Was 'Arrays vs Objects...)

2017-07-21 Thread Peter Jakobsson via 4D_Tech

On 21 Jul 2017, at 16:48, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote:

> * No. You do not need classes. Modules do not require OOP, OO came out of
> earlier work and embraced modules and extended them. I'm just talking about
> module-level scope and data hiding, not OO

Ok, you could be onto something there. 4D often find ways to implement greater 
degrees of articulation in a unique “4D way” that doesn’t come with a whole lot 
of productivity baggage. I’ll suspend judgement till I see the killer feature - 
I might like it ;)

> Don't really know what you mean by 3G and 4G languages


Basically: statefull vs stateless, high level vs low level, integrated 
(language/DB/UI) vs dis-integrated.

Regards

Peter

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

Re: Use of Objects vs Global Variables (Was 'Arrays vs Objects...)

2017-07-21 Thread Peter Jakobsson via 4D_Tech

Well, I’m afraid I’ll have to take the pariah role here and politely disagree 
with you all :-)) - or at least present an alternative perspective in which 
“globals” play a very powerful and unique part.

Lets think this all through for a moment. As is relevant to this topic, we can 
notionally consider the data that an application ‘consumes’ in 2 distinct 
aspects:

 • persistent data structures
 • non-persistent data structures

The first of these are basically represented by pre-prepared classes which we 
call “tables". We can instantiate an instance of that class and manipulate that 
instance implicitly using commands like CREATE RECORD, QUERY and SAVE RECORD. 
The second are represented - on the one hand - by a library of pre-prepared 
classes that the ID gives us like forms, form controls, etc and on the other 
hand by the data oriented language elements, i.e. locals, interprocess globals 
and process globals (of which 4D data objects are a subset of each).

Now, if 4D gave us the facility to scope a process level global variable to an 
arbitrary set of methods (or even forced us to do so) then it would have 
effectively have re-invented the concept of the language class as appears in OO 
languages. You’d have to formally define the class, formally define its 
properties and methods, formally instantiate it and maintain a reference to the 
particular instance you’re using at a given moment. You would not be able to 
support user interface elements implicitly with the class’s data (as we can 
with native 4D), you’d have to either give your class its own UI and all the 
supporting methods it needed to drive it (which would only work from within 
that class) OR create the plumbing to connect an independent form class so that 
it can be driven by the data in your “tightly scoped” business logic module.

Remember, we already have ‘modules’ in 4D which have their own privately scoped 
variable space in the form of 4D components. So if - on top of that - 4D 
supported “components within components” I suggest we’d have an unmitigated 
architectural clutter who’s language structure became increasingly ambiguous 
and unwieldy. The “living hell” of globals being broadly scoped might actually 
seem like an attractive problem to have by comparison (for many of us anyway).

On 21 Jul 2017, at 14:32, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote:

> But, yeah, globals are bad. They make your life a living hell because
> someone changes something and now "unrelated" parts of the program break

David, I think you may be impacted by this ‘scoping issue’ disproportionately 
compared to many developers since you appear to do a lot of “Red Adair” type 
troubleshooting work where you’re parachuted into a crisis situation and have 
to start stabilising, refactoring and growing an existing codebase 'back to 
health’. (Just an observation from your posts - I may be completely wrong on 
that of course !). I can definitely see how a more formal modular environment 
would help in that situation. But how many of those databases would have 
existed in the first place if their original developers had been forced down 
the more formalised route ? In my own experience of visiting customer sites, 
not many. Also, I’d posit that your problem isn’t a lack of language support, 
it’s simply deficient design (by your predecessors) which would in fact have an 
even more adverse impact in an environment of the complexity you’re promoting.

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

> Most code i write now is ‘self contained’ -I attempt to set all values used 
> in the method is passed in to the code -either as parameters or an object or 
> a pointer to something so that i end up with something more like a javascript 
> function

Nigel - this would be an admirable objective for the most part if it weren’t 
for the one big elephant in the room that separates 4D’s “4GL” heritage from 
its 3GL contemporaries and that is its huge dependence on and leverage 
of……statefulness ! I urge people not to dismiss it because it’s where we get 
all our productivity from in the first place.

Having thought about this a great deal over the years, I came to the conclusion 
that we could split our entire codebase into 2 distinct types of method: 
stateless and stateful. In the case of the former, yes it is a good idea to do 
as you say and make the code as “self contained” as possible. However in the 
case of the latter, it’s positively counterproductive because we are dealing 
with an implicit non-persistent data structure and it’s more efficient just to 
make that data structure explicit to maintain state between methods. There are 
also other benefits:

 • the business logic more auditable because we’re decoupled the data from the 
code that manages it
 • we don’t need a myriad of parameters everywhere or random properties buried 
away in an object
 • the compiler sees it and can assist with formal 

Re: Arrays vs Object for Key/Value pair lookups

2017-07-20 Thread Peter Jakobsson via 4D_Tech

On 20 Jul 2017, at 11:39, JPR via 4D_Tech <4d_tech@lists.4d.com> wrote:

> In case of an object, the properties are 'indexed' by using an internal Hash 
> table, so the access to one particular Property doesn't need a sequential 
> parsing of the list of values, but an almost direct access. I confirm what 
> Justin says, that is to say that the bigger will be the array, the more 
> efficient will be associative arrays compared with classic parsing of arrays.


Many thanks for refreshing your advice JPR !

Very useful.

Regards

Peter

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

Re: Arrays vs Object for Key/Value pair lookups

2017-07-17 Thread Peter Jakobsson via 4D_Tech

On 17 Jul 2017, at 17:03, Herr Alexander Heintz via 4D_Tech 
<4d_tech@lists.4d.com> wrote:

> so I queried for the language I needed and then
> apply to selection([dict];ob set(<>Dict;[dict]WordKey;[dict]Word)

Ah !

So you just ‘hoover up’ into your dictionary object.

Like a hoover ?

Peter

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

Arrays vs Object for Key/Value pair lookups

2017-07-17 Thread Peter Jakobsson via 4D_Tech
Hi

I remember at last year’s summit, JPR was emphasising how objects were far more 
optimised than arrays for doing lookups over large numbers of key value pairs.

e.g. we usually do this:

$x:=find in array(myKEYS;”product_code_x”)

if($x>0)
  $0:=myPRICES{$x}
end if

How do people prefer to do this with objects ? Enumerate the keys in some 
systematic way and then populate the object like this >

For($i;1;$SIZE)

  $key:=string($i)
  $value:=myarrayVAL{$i}
  OB SET($object;$key;$value)

End For

Then for retreiving:

$key:=string($1)

$0:=OB Get($object;$key)

…or was JPR suggesting we use object arrays and do some kind of “find” over the 
object arrays ?

Best Regards

Peter

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

  1   2   >