Re: Calculate values of arrays...

2021-11-01 Thread Kirk Brooks via 4D_Tech
>> You do know what an ARRAY is?
Did you go look at the page?

On Mon, Nov 1, 2021 at 12:36 PM Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
>
> > On 02 /11 /2021, at 02:24, Joshua Hunter via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > You want the docs for 'On a Series'
> > https://doc.4d.com/4Dv19R2/4D/19-R2/On-a-Series.201-5493482.en.html <
> https://doc.4d.com/4Dv19R2/4D/19-R2/On-a-Series.201-5493482.en.html>
> And this works on an ARRAY how?
>
> You do know what an ARRAY is?
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: I'm puzzled...

2021-10-27 Thread Kirk Brooks via 4D_Tech
>> It is time for 4D to declare in detail what direction the kangaroo is
hoping to give people the chance to make the right decision on time.

That train left the station a long time ago. It's as done as the Power PC.
4D has clearly stated binary will be supported for the foreseeable future
but new features are only coming to Project mode.

So if your app runs in binary, primarily on windows machines and you don't
have any need of the shinny new tools and features you can rock on without
worry.

Otherwise you need to learn a new language. Could be ORDA and Project mode
or could be something else but either way you have to learn something new.

On Wed, Oct 27, 2021 at 5:59 AM Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> G’day,
>
> Having watched the "4D World Tour Live 2021”, downloaded the V19 material
> and checked it and browsed that 4D-Web-Forum, especially
> https://discuss.4d.com/t/adding-field-or-variable-not-working/20963 <
> https://discuss.4d.com/t/adding-field-or-variable-not-working/20963>
> started by Tom Dillon with the interesting remark from a responder about
> some “modern project format”…
>
> Those 4D still claims, in a marketing and/or reality capacity, to have an
> IDE (Integrated Development Environment)?
>
> To me it looks like that Xcode, MS-Visual-Studio and some additional
> Editors are mandatory now to create a working application with/in 4D if one
> mistakenly starts the development in project mode where so much “doesn’t
> really make sense anymore” according to a post on the mentioned forum.
>
> It is time for 4D to declare in detail what direction the kangaroo is
> hoping to give people the chance to make the right decision on time.
>
> Cheers
> Jörg
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Where is the trace/debug command?

2021-10-04 Thread Kirk Brooks via 4D_Tech
It's probably not a trace but an error. What's iLB_Hook? Sounds like
something there.

On Mon, Oct 4, 2021 at 10:59 AM Paul Chernoff via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am porting some 4D databases from v18.5 to v19.2. What is odd is that
> some iLB_Hook procedures are triggering tracing. But I look at the
> procedures and I do not see the Trace command nor the red circuit. And this
> never happened in version 18 or earlier. Is there now some invisible trace
> command?
>
> —Paul Chernoff
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Living past "End of support"

2021-09-30 Thread Kirk Brooks via 4D_Tech
rs 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Syntax Error in a Compiled Database

2021-09-10 Thread Kirk Brooks via 4D_Tech
Eric,
" In one case, I clicked the Continue button after each successive error
dialog. "
Did you note the method, line number and type of error? That's exactly the
information you need. And - was that on the server or on a client?

These sorts of problems are incredibly frustrating until you get a handle
on it. But if you are getting error messages there is information there
that will help you.

On Fri, Sep 10, 2021 at 12:27 PM Eric Asadoorian via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> At the moment, I added some additional logging code to the ON ERR CALL
> handler.  My first problem is that I don't have any idea what method is
> throwing the error.  Unfortunately, it is not occurring often enough.  I
> have been dealing with it for about 2 months.  Given that it only occurs
> roughly 12 days from a fresh application launch, I haven't experienced
> enough to get a sense of where it is happening.  Once the error appears it
> does not necessarily crash the application.  In one case, I clicked the
> Continue button after each successive error dialog.  The error code remains
> the same.  I assumed it was in a for loop, then it just crashed.  Another
> time, I kept clicking Continue and it never ended (after 70 times I gave up
> and hit Abort).  Therefore, in that instance it was likely in a repeat
> until and the until boolean never went True.  These are just guesses.  I am
> presently hoping that there will be more information available in a log
> file the next time it occurs.
>
> Thanks for your assistance.
>
> Eric
> On Sep 9, 2021, at 8:20 PM, Kirk Brooks via 4D_Tech wrote:
>
> > Eric,
> > Sounds like some sort of run time error. Most likely caused when some
> > unexpected data type is attempting to be read into an array (one of the
> > arrays managed by a pointer and gets the warning). Running interpreted 4D
> > is very robust as fixing these sort of data type errors but running
> > compiled it throws an error instead. This is why you won't catch it
> > interpreted.
> >
> > If it's consistently happening in a particular method then add more error
> > checking to that method until you figure out what's going on.
> >
> > If it's happening in different methods are these methods managing writing
> > to arrays directly? If so can you write a method to manage that write
> > operation and use this method in all the places the arrays are written
> to?
> > The idea is to get the code that's likely to throw the error in one
> place.
> >
> > Once you figure out what this edge case is you can decide the best way to
> > either protect against it or manage the incoming data to prevent it.
> >
> > On Thu, Sep 9, 2021 at 9:06 AM Eric Asadoorian via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Hello.
> >>
> >> Environment is v17.5 64-Bit in either OS X Sierra or Mojave (latest
> >> versions).  The database application does not experience much in the
> way of
> >> user interaction.  It is mainly responding to requests over TCP.  It
> runs
> >> 24/7.
> >>
> >> Compiler presents no errors, several warnings, but nothing new that
> hasn't
> >> been seen before in earlier versions (v16, v15, back to v13).  Warnings
> are
> >> mostly of the sort where pointers are used for arrays and it isn't
> clear if
> >> the data types will be correct at runtime.  These methods run often and
> >> have not presented a problem.
> >>
> >> Application can run for anywhere from 6 days to several weeks and no
> >> issues.  Then a runtime error will pop up citing Error 48 (I believe
> that
> >> it says Syntax Error when looking at detail in Application Process, but
> not
> >> sure, I will need to take a screenshot next time).
> >>
> >> This has occurred randomly without any real repeatable activity that I
> can
> >> surmise.  I decided to let the application run in interpreted mode
> hoping
> >> that the error will surface and I can identify the offending code in the
> >> debugger.  So far, nearly 2 weeks in and no error.  Therefore, I am
> >> reaching the conclusion that this error will likely only show up in a
> >> compiled database.
> >>
> >> I did not think a Syntax Error could occur in a compiled database.  I am
> >> guessing that it is related to a text value being passed to a 4D command
> >> that would not be known in advance.  However, I can't find anything
> that is
> >> in error.  I checked New Process, Execute on Server, and semaphore
> related
> >> commands thus far.
> >>
> >> W

Re: Syntax Error in a Compiled Database

2021-09-09 Thread Kirk Brooks via 4D_Tech
Eric,
Sounds like some sort of run time error. Most likely caused when some
unexpected data type is attempting to be read into an array (one of the
arrays managed by a pointer and gets the warning). Running interpreted 4D
is very robust as fixing these sort of data type errors but running
compiled it throws an error instead. This is why you won't catch it
interpreted.

If it's consistently happening in a particular method then add more error
checking to that method until you figure out what's going on.

If it's happening in different methods are these methods managing writing
to arrays directly? If so can you write a method to manage that write
operation and use this method in all the places the arrays are written to?
The idea is to get the code that's likely to throw the error in one place.

Once you figure out what this edge case is you can decide the best way to
either protect against it or manage the incoming data to prevent it.

On Thu, Sep 9, 2021 at 9:06 AM Eric Asadoorian via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hello.
>
> Environment is v17.5 64-Bit in either OS X Sierra or Mojave (latest
> versions).  The database application does not experience much in the way of
> user interaction.  It is mainly responding to requests over TCP.  It runs
> 24/7.
>
> Compiler presents no errors, several warnings, but nothing new that hasn't
> been seen before in earlier versions (v16, v15, back to v13).  Warnings are
> mostly of the sort where pointers are used for arrays and it isn't clear if
> the data types will be correct at runtime.  These methods run often and
> have not presented a problem.
>
> Application can run for anywhere from 6 days to several weeks and no
> issues.  Then a runtime error will pop up citing Error 48 (I believe that
> it says Syntax Error when looking at detail in Application Process, but not
> sure, I will need to take a screenshot next time).
>
> This has occurred randomly without any real repeatable activity that I can
> surmise.  I decided to let the application run in interpreted mode hoping
> that the error will surface and I can identify the offending code in the
> debugger.  So far, nearly 2 weeks in and no error.  Therefore, I am
> reaching the conclusion that this error will likely only show up in a
> compiled database.
>
> I did not think a Syntax Error could occur in a compiled database.  I am
> guessing that it is related to a text value being passed to a 4D command
> that would not be known in advance.  However, I can't find anything that is
> in error.  I checked New Process, Execute on Server, and semaphore related
> commands thus far.
>
> Where would be a good place to start looking?  Has anyone had such an
> experience before?  Is there a way to identify more clearly what code is
> executing when the error appears?
>
> Thank you,
> Eric Asadoorian
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: [EXTERNAL] Re: Run v15.4 in demo mode

2021-08-25 Thread Kirk Brooks via 4D_Tech
You should be able to open the uncompiled version using whatever version
you are using now. You may lose some plugins or components but if all you
need is access to data that won't really matter.

On Wed, Aug 25, 2021 at 1:56 PM Perkins, Bradley D via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Randy,
>
> I do have an both compiled and uncompiled structures. If I could find a
> v16 installer will that run on Catalina? Also do you know if there is still
> an ftp site that has older version downloads that isn't restricted to
> Partners?
>
> Thanks,
> Brad
>
> From: Randy Kaempen 
> Date: Wednesday, August 25, 2021 at 2:49 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Bradley Perkins 
> Subject: [EXTERNAL] Re: Run v15.4 in demo mode
>
> Brad,
>
>
> On Aug 25, 2021, at 3:44 PM, Perkins, Bradley D via 4D_Tech <
> 4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>> wrote:
>
> I've had a request to retrieve some data from a v15.4 database that was
> last used in early 2019. The customer still has the server with DB
> installed and a compatible client machine, but the machines are in storage
> and off-network. Given the current situation getting them online and
> remotely accessible isn't possible. I am working remotely. I have a copy of
> the DB on an older Macbook Pro, but it had been upgraded to Catalina and
> 15.4 will no longer open. I get a '4D.app' needs to be updated dialog when
> attempting to launch. I expect that is likely due to drop of 32-bit support
> in Catalina. My installed licenses on the MPB were also those granted
> annually through the partner program and have expired.
>
> If I could copy the 4D.app and the structure and data files back to an
> earlier MacOS Yosemite machine will I be able to temporarily run 4D v15.4
> in demo mode, or will 4D immediately request activation? I need less than
> 15 minutes to retrieve the requested data.
>
> Beyond that I may need to travel to their site and hook the client and
> server together with a crossover cable or maybe run a client from the
> server if one is installed. Their institutional IT policies would not allow
> them to place the machines on the network now (running very outdated OS
> versions, plus these were in a DMZ that they no longer have access to). I'd
> prefer to try off-site.
>
> My last 4D experience was with v15 and I understand that things have
> changed a lot. Could newer versions open the v15.4 DB in demo mode with
> minimal effort?
>
> Is the database compiled?  If not, a newer version will open it and
> convert it.  There are commands which are obsolete in the later versions,
> but you should still be able to work.  Picture fields will be an issue
> unless they are converted before going to 64 bit versions of 4D.
>
> If the database is compiled, later versions will not be able to open it.
>
> Randy Kaempen
> Intellex Corporation
>
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: v15 and any Mac OS newer then 10.13

2021-07-21 Thread Kirk Brooks via 4D_Tech
Hey Chip,
It will run on Mojave but not Catalina (10.15).

On Wed, Jul 21, 2021 at 10:22 AM nug via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Will v15 client run on Mac OS
> 10.14?
> 10.15?
> 11?
>
> Thanks
> Chip
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: why is a global boolean not changing

2021-07-14 Thread Kirk Brooks via 4D_Tech
The scope of an IP variable is the machine that it runs on. You are setting
the IP variable in a form on the client machine so it only exists on that
machine. On web connect runs on the server (most likely) so it doesn't
share the same IP vars as the client.

This is the same situation with triggers, BTW. The server IP vars are not
affected by anything a client does.

On Wed, Jul 14, 2021 at 9:22 PM eachilgers via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi All,
>
> 4D v17.5  server on windows 10, 2 clients running windows 10.
>
> I have a single boolean (global) value that is set or reset on an input
> form (in it’s own process) by a user.
> This global variable has to be inspected during the On_Web_connection
> process which it does.
>
> However when the user (client) changes this value using an input form, I
> can see the boolean change value (in the debugger) (true/false)
> when looking at it in the On_validate form event.
>
> If the boolean was initially true, in de debugger during the
> On_Web_connection this is viewed…
> and the user changes the value to false, then when the On_web_connection
> fires, that global variable is still “true” (but should be false in my
> book...).
>
> (note: in the debugger I can set the global boolean to false, but from
> then on it never changes that value)
>
> What is it that I am missing ?
>

-- 
Kirk Brooks
San Francisco, CA
==
**
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: PING of life...

2021-01-16 Thread Kirk Brooks via 4D_Tech
Arnaud - is that the one labeled: "Camus"?

On Sat, Jan 16, 2021 at 5:18 AM Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 15 janv. 2021 à 16:54, Neil Dennis via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > My last complaint, and it is minor is that I use dark mode on my
> computer.
>
> There is a dark mode setting in 4d discuss preferences.
>
> --
> Arnaud
>
>
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: MILLISECONDS

2020-11-08 Thread Kirk Brooks via 4D_Tech
Ferdinando,
 > Yes i've need of millesconds these logs is for check the instruments
communication.

Try this:

$ms:=Milliseconds
//  communicate with instruments
$ms:=Milliseconds - $ms


$ms is now the delta of when you started.

I'm sure you have thought about these things but _where_ you measure this
interval will matter. To get the cleanest measure of just the comms you
will want to insert this right before and after the SET CHANNEL commands, I
think.

On Sun, Nov 8, 2020 at 8:10 AM stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Randy,
>
> Yes i've need of millesconds these logs is for check the instruments
> communication.
>
> Thanks
>
> Ferdinando
>
>
> Il 08/11/20 14:57, Randy Kaempen ha scritto:
> > Fernando,
> >
> >> On Nov 7, 2020, at 11:44 AM, stardata.info <http://stardata.info> via
> >> 4D_Tech <4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>> wrote:
> >>
> >> I work with 4D V16 and V18 on windows.
> >>
> >> I've need to insert milliseconds into my log messages.
> >>
> >> I thik to use the command MILLISECONDS but the number is very great.
> >>
> >> Someone know a better mode?
> >
> > Do you need the accuracy of milliseconds?  If not, you could just log
> > seconds, which would be much smaller.  The standard Internet timestamp
> > is the number of seconds since 1/1/1970.  Of course, if your dates
> > don’t go back that far, you could use a more recent date and get
> > smaller numbers.
> >
> > For example:
> >
> > $TimeStamp:=((current date-!1/1/2000!)*86400)+current time
> >
> > That uses a start date of 1/1/2000.
> >
> >
> > Randy Kaempen
> > Intellex Corporation
> >
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: "Optimal" 4D Server hardware

2020-09-11 Thread Kirk Brooks via 4D_Tech
David,
I invite you to check out the new 4D forum at https://discuss.4d.com/
It's a huge improvement over the old forum and this list. Plus a lot more
people are active there.

But to your point Tom and Randy are both giving you solid advice. I will
add that my experience with 4D server is the one place I recommend a
Windows machine over Mac hands down. They are seriously faster. Just are.
And much more bang for the buck. You don't need an expensive Windows Server
license if it is only running 4D. Win 10 Pro will give you everything you
need.

It sounds like this is installed in an office and the Mac Mini is only
running 4D (8 gigs of RAM is not very much). You didn't say which version
of 4D which is important. Also whether you are using the web server which
increases the RAM you want.

64 bit requires roughly twice as much RAM as 32 bit on the machines and
within 4D. If your code has been updated and kept up all the calls to start
new processes are probably using 0 as the default stack size - which let's
4D set the stack size and adjusts for the operating environment. If not
it's using some number that was probably set before 64 bit was a thing and
it's way too small.

If you buy a new Mac you will get Catalina which means you WILL run 64 bit.
Apple is announcing something next week. Speaking as someone who bought one
of the new-cool touch bar MBPs in 2016 (and it's been a truly crappy
machine) you don't want to be one of the first to get a Mac Mini with the
new hardware for a business critical application like this. Plus, if you
need to continue to run 32 bit

Finally I see you have an SSD RAID. I'm curious about that. Typically I'll
use a mirrored SSD for the primary drive and have some large mirrored hard
disk to use for things like backups. I'm curious how you all decided to use
that much of a RAID on a Mac Mini?

On Fri, Sep 11, 2020 at 2:22 PM Tom Benedict via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi David,
>
> I think the answer really depends on number of things:
>
> - How much growth you expect, in terms of concurrent users/processes and
> data file size, over the next 3-5 years.
>
> - How is your application expected to change over then next 3 - 5 years.
>
> - What kind of IT support you have.
>
> - What does your application do? Is it all internal facing using 4D
> Client? Does it have Web Clients? Does it connect to other internal and
> external systems?
>
> If you have mostly MacOS IT support and experience, and you expect modest
> growth in your user base and application in the future, and your app is
> currently performing well, it’s an easy decision to get another Mac Mini
> (maybe with more RAM).
>
> If you expect to double (or more) your users and data and expand your
> applications capabilities, and your current system performance is mediocre,
> and you have some Windows IT support, you could consider getting a Windows
> server.
>
> I’m assuming your existing system has sufficient redundancy to meet the
> requirements of your corporate Disaster Recovery Plan.
>
> And one more thing. If you buy a new MacOS machine today you will likely
> have to run 64bit, which means your app needs to be 64bit compatible. If
> it’s not already 64bit compatible, that may be considerable work, depending
> on the nature of your app.
>
> HTH,
>
> Tom Benedict
>
>
> > On Sep 11, 2020, at 13:08, David Loeppky via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I'm ready to upgrade our 4D server machine and would welcome any insights
> > and recommendations.
> >
> > Some details:
> > - 40 Users (Mac and Windows)
> > - 4GB data file
> > - 120 tables
> > - The current server is a 2011 Mac Mini with 8GB and raid 4XSSD HD
> >
> > Questions about the new server:
> > - Windows or Mac?
> > - Recommended features.
> >
> > Many thanks for the input.
> >
> > --
> >
> > Regards,
> >
> > David Loeppky
> >
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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
**

iNug archives are available at the 4D Knowledgebase

2020-08-04 Thread Kirk Brooks via 4D_Tech
A lot of us have built our own database of postings here. My own is in this
gmail account and stretches back to 2006. However, you can also search even
further back at the KB;  https://kb.4d.com/

Note the sidebar on the right: Knowledge Base Articles/iNug Messages.

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Change list values in a listbow coloumn

2020-08-03 Thread Kirk Brooks via 4D_Tech
Ferdinando,
> a list when the mouse enter in every row

First, do you want:
a- the list to automatically popup when the user enters the row
b- the list to popup when the user right clicks on the row

'a' is going to be harder to do. Start with enabling the On mouse enter and
On mouse exit form events on the listbox. This will tell you when the user
is inside the listbox. To determine what row the mouse is over you will
need to determine by from the mouse position, listbox object coordinates,
listbox scroll position... this will be a bit of work but once you figure
it out will be fast enough.
'b' is easy - just test for Contextual Click in the listbox.

Now you need to make the list. I use popup menus for this sort of thing.
Either the Pop up menu command (for simple lists) or build a menu on the
fly and show with Dynamic pop up menu. Both are very fast and give you
complete control over what you display.

BTW - the Forum is a much better place for these sorts of questions these
days.


On Fri, Jul 31, 2020 at 6:14 AM stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> In one column of Listbox, I need to give a list of values to enter value
> of the column.
>
> The values contained in a list can be different for every row.
>
> How can I prepare a list when the mouse enters in every row?
>
> Thanks
> Ferdinando
>
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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
**

Hey nug - it's Happy Hour

2020-05-29 Thread Kirk Brooks via 4D_Tech
Anyone still around here?

If so, knock off for a bit and come hang out with us:
https://us02web.zoom.us/j/83731433887?pwd=T1B2UlErek1sRHRrNnYrV1lWYVF0QT09

Going on now

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Pluggers XL_Plugin Format Question

2020-05-27 Thread Kirk Brooks via 4D_Tech
Ken,
Don't hesitate to email Rob if you have a question. I have always found him
willing to answer questions. It may take a day but he always gets back to
me.

On Wed, May 27, 2020 at 7:54 PM Ken Eyring via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Thanks for responding Doug.
>
> I looked at the code but did not see anything that jumped out at me
> regarding formatting.
>
> I look forward to seeing your sample code when you have a chance!  Very
> much appreciated!
>
> Ken
>
>
>
> On 05/27/20 9:41 PM, Douglas von Roeder via 4D_Tech wrote:
> > Ken:
> >
> > I haven’t used that particular format but I suspect that it is used like
> > the other formats. If you haven’t created formats, check the code in the
> > demo. It’s not extensive but, if you hold your head just right, things
> will
> > make sense.
> >
> > At the moment, I’m away from a computer but I’ll post some code in the
> AM.
> >
> > On Wed, May 27, 2020 at 6:03 PM Ken Eyring via 4D_Tech <
> 4d_tech@lists.4d.com>
> > wrote:
> >
> >> I'm taking a look at buying the Pluggers XL_Plugin and most of my test
> >> went very quickly.  Looks like a spectacular plugin.
> >>
> >> It was real easy to open a spreadsheet and insert values into specific
> >> cells.
> >>
> >> I ran into some confusion though, when I tried to set a cell's format,
> >> e.g. to Locked, or change the font name or font size, etc...
> >>
> >> Here are the instructions for xlFormatSetLocked, but I'm not sure what
> >> to pass in:
> >>
> >> xlFormatSetLocked( format ; locked )
> >> → longint → integer
> >> Sets the locked protection property: 1 - true, 0 - false.
> >>
> >> I expected to define a sheet, row and column to identify the cell I
> >> wanted to set the format for - but I don't see how to define which cell
> >> I want to affect.
> >>
> >> If someone wouldn't mind sending a simple snippet of code that shows how
> >> to set a specific cell's format using this plugin I would really
> >> appreciate it.
> >>
> >> Thanks,
> >> Ken
> >>
> >> **
> >> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Generic code for entity selection projection

2020-05-11 Thread Kirk Brooks via 4D_Tech
Hi Steve,
A couple of things to consider. You mention working with an 'entity
selection' but then get into talking about collections. To create a
collection from an entity selection, or only some properties of it, take a
look at .toCollection().
https://doc.4d.com/4Dv18R3/4D/18-R3/entitySelectiontoCollection.305-4900500.en.html

This might give you want you want right there as you pass a comma delimited
string to the method.

The other approach is to simply do a query for what you need. These are
really fast in ORDA thanks to a lot of optimization built in and it's very
flexible.
https://doc.4d.com/4Dv18R3/4D/18-R3/dataClassquery.305-4900853.en.html

The old way of approaching these sorts of situations where you paid a big
performance hit for multiple searches isn't nearly so true now. But it
depends on your data. Try it and see.

On Mon, May 11, 2020 at 9:04 PM Steve Slanec via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm trying come up with generic code that produces a projection from an
> entity selection, and I think must be missing something obvious.  I’d like
> to perform the following statement:
>
> $collection:=$employees.company.country
>
> But as generic code. I want to be able to pass the ORDA path
> “company.country” as a text variable so that I can change it at runtime.
>
> Obviously, using square bracket notation doesn’t work because square
> brackets for entity selections are used for indexes:
>
> $collection:=$employees[“company.country”]  // Syntax error
>
> So how can I do this?
>
> I guess I could write a method that splits the ORDA path into tokens,
> examines each token individually, and traverses through relations if the
> token kind is a “relation" until we get to the last token, whose kind must
> be “storage".  But I’m hoping I’m just being ignorant - it seems like a lot
> of work for doing what object notation does so simply and elegantly.
>
> Using 4D v18, macOS 10.14
>
> Thanks for any advice!
>
> - Steve
>
>
>
> Steve Slanec
> Slanecon Digital
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: 4D Friday Happy Hour on ZOOM

2020-05-08 Thread Kirk Brooks via 4D_Tech
Hey Rudy,
We're doing it again this afternoon. Well, night for you but please stop in
for a few minutes if you care to stay up late. Details are here:
https://discuss.4d.com/t/4d-friday-happy-hour/13527


On Fri, May 8, 2020 at 4:15 AM Two Way Communications via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi guys,
>
> I saw it too late … but I think this is a great idea! when is the next
> Happy Hour?
>
>
> Regards,
>
> Rudy Mortier
> Two Way Communications bv
>
>
>
>
> > On 23 Apr 2020, at 21:53, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > I know. It is hard to plan a party in so many time zones.
> >
> > On Thu, Apr 23, 2020 at 12:41 PM Wayne Stewart via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> 8AM for me.
> >>
> >> “I exercise strong self control. *I never drink anything stronger than
> >> gin* before
> >> breakfast.”
> >>
> >> W. C. Fields
> >>
> >>
> >> On Fri, 24 Apr 2020 at 04:37, Kirk Brooks via 4D_Tech <
> >> 4d_tech@lists.4d.com>
> >> wrote:
> >>
> >>> Hey folks,
> >>>
> >>> I’m hosting a 4D Friday Happy Hour tomorrow on ZOOM:
> >>> https://zoom.us/j/91959066132
> >>>
> >>> Starts at 3PM PDT (7 EDT) and will go until I fall asleep or everyone
> >>> leaves.
> >>>
> >>> It’s not as good as hanging out together at the Summit but let’s share
> >> what
> >>> we’re drinking, say hello, laugh at some not-very-funny stories and
> enjoy
> >>> each other’s company.
> >>>
> >>> If it works we can figure out how to do it again.
> >>>
> >>> --
> >>> Kirk Brooks
> >>> San Francisco, CA
> >>> ==
> >>> **
> >>> 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
> >>> **
> >>
> >> --
> >>
> >> Regards,
> >>
> >> Wayne
> >> **
> >> 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
> >> **
> >
> >
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ==
> > ******
> > 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)
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: iNUG Messages ― Is it time for it to be more than just 'plain text' ???

2020-05-07 Thread Kirk Brooks via 4D_Tech
Paul,

On Thu, May 7, 2020 at 2:15 AM Paul Dennis via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> It would be really useful if 4D were able to archive this
> list plus the old 4D forum.


Check out the KB:  https://kb.4d.com/
In the sidebar on the right, top: "iNug Messages"

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Lahav,

On Fri, May 1, 2020 at 1:51 PM lists via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have one word that will do all of what we are after :   "This"
>
Damn - I wish I'd said that.


> Again, I don't think anyone on this thread is complaining, we are just
> trying to understand how to use the new functionality to do what we need to.
>
I don't either. I probably overthink things like this or project my own
experience on it too much with the focus on the conceptual stuff. But I
read a lot of posts here and on the Forum and the common thread, to me,
seems to be folks attempting to use ORDA like it's an extension of classic.
It was incredibly frustrating for me until I got past thinking about ORDA
from a classic perspective.

Cheers, will probably see you later today.....
>
Hope so.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Jim,

On Fri, May 1, 2020 at 11:53 AM James Crate via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Suppose you have a section on the form with labels/fields for payment
> info. You have a popup with payment type, and fields for credit card, ACH
> (bank name/acct number), check, cash. When you choose a payment type, you
> want to show the labels/fields for that payment type, and hide any other
> payment labels/fields. If you thought far enough ahead to name all your
> payment fields correctly, maybe you can make it work. But if your fields
> aren’t already prefixed properly so you can do this with wildcards, then
> you have a lot more messing around to do.
>

I have not had any great joy attempting to use pop-ups with object
references. Haven't tried in v18 so maybe it's improved. So, yeah - that
probably sucks. For these sorts of things I build a menu on the fly and
call it from a button or click event on the field. I really like being able
to easily set the placeholder text on fields like that. The problem with
pop ups/dropdowns is there is all sorts of implicit data binding that 4D
just handles in classic but isn't (at least wasn't) there for working with
Form and references.
But with respect to changing the names of a few form objects why is that a
deal? The form objects can be named anything - doesn't matter what the
field names are.

Unless you are trying to update an existing form. My experience here is to
put whatever I want to do in ORDA into a separate form and get it working
the way I want. Then put that on the existing form as a subform. If you
make the subform form object an object type (jeesh the nomenclature) it's a
pretty seamless addition.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Chris,

On Tue, Apr 28, 2020 at 10:53 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Generic programming of vars on a form is very complicated when one uses
> object attributes for the data source.
>
> For example, on screen you make a simple text input object named
> “enCompany”. It’s data source is Form.en_Company.Name (  i.e.
> [Company]Name  )
> In ‘classic 4d”, where the data source would be [Company]Name, one can
> code its script:
>
TRIM ( Self )

And TRIM would simply take a POINTER, and you can perform operations on the
> data that the user typed into that field. (Such as trim off leading &
> trailing spaces).
>
So what does Self actually point to? The object on the form the field is
displayed in or the actual field in the database?

The two are not the same thing. In classic 4D that distinction is never
really apparent to us. It didn't need to be and we didn't want to have to
deal with it. It was part of the how we perceived working with 4D: a field
on a form _was_ the data. It's also why 4D forms from ages past are so
overloaded with data processing being done on the form itself instead of
separated into more independent modules. IP and process vars enabled that
trend even more. This is a main reason opening up one of these old
databases in v18 and attempting to change something is so fraught. But I
digress. With modern 4D tools you just don't do things that way anymore.

Working with ORDA I rarely find a pointer a good solution to anything
except managing form objects like buttons. We are saddled with some
unfortunate nomenclature here because a 'form object' has nothing to do
with an object in Form. 'Form objects' are those named widgets on the form.
They _may_ be populated with data from something in Form, or a variable, or
a list box and so on.

A big conceptual difference between classic 4D and modern 4D is the
distinction between a form object and the data it presents is explicit. So
when I set the data source for an input object to be

Form.myEntity_o.Name

where myEntity_o is a reference to an entity in Company the actual data and
the form object are no longer implicitly the same thing like they are in
classic 4D. I have a reference to the entity and I have a form object. They
are two different things.

I can't get a pointer to the form object in this case. Why not?
First, what do I want to do with it? If I want to manage the form object
itself, visibility, enterability, etc., I don't need a pointer, I can just
use the object name.
If I want to do something with the data, as you do, the pointer won't work
because there are no pointers to object references. Why not? I'm sure there
are technical reasons but they don't matter to me because you don't need
it. You don't need it because you have a reference: myEntity_o. If you want
to change the data you do that with the reference - not through whatever
that data happens to be displayed in.

This is a fundamental, conceptual difference between using ORDA and classic
4D.

In classic 4D we have tables, records, fields and pointers to reference
them.
In ORDA we have datastores, dataclasses, entities, properties and we use
references.


In the example of the name field you can still put code in the form object
to react to On Data Change. And you can still pass data to a generic method
to manage it. Two ideas come to mind:
1) method takes an entity

// myMethod1 (entity)

// $1 is  a Company entity - check the name, address, etc. for proper
formatting

2) method is a function

Form.myEntity_o.Name:=myMethod2(Form.myEntity_o.Name)


Is the form you are working with an existing form or one you created from
scratch?
I find it much easier to use the new approaches on new forms. If not by
totally rewriting them then by separating out the new work into a subform.
That lets me design the form using a modern approach without having to do
too much to the old one.

I said this someplace else recently and it applies here: just because 4D
(still) provides some tools for doing things doesn't mean it's a good tool
to use. For instance, would anyone make a new form and use DRAG AND DROP
PROPERTIES? ORDA isn't an evolutionary step in 4D - it's a revolutionary
step. It really is like learning a new language. 18r3 is that way for sure.

I had time to begin updating my old 4D coding ideas starting a couple of
years ago. It wasn't easy and it made me feel old. But I kept at it. And it
became a lot easier and them fun. Now I'm amazed at things I can do simply
by setting up the data structure. Another big difference for me in this.
Taking time to get the structure right is time well spent.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Jim,

On Fri, May 1, 2020 at 11:14 AM James Crate via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The problem with this approach, as others have mentioned, is that you can
> no longer use object name prefixes to show/hide/enable/etc groups of form
> objects.
>

Why do you say that?

In v18R2 I'm using:

*OBJECT SET ENABLED*(*;"btn_setDoc";*Form*.files_LB.curItem#*Null*)  //  enable
when file is selected

*OBJECT SET VISIBLE*(*;"btn_setDoc";*Form*.files_LB.curItem#*Null*)


I added the set visible just to verify if works. It does. I also have an
input which displays an object named "Input2" and this works on it as well.
And I have forms using things like:

*OBJECT SET VISIBLE*(*;"btn_nav@";*Form*.files_LB.curItem#*Null*)


Am I missing something?

-- 
Kirk Brooks
San Francisco, CA
==
**
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 Friday Happy Hour on ZOOM - Again! May 1 @ 3:30 PM PDT / 6:30 PM EDT

2020-04-30 Thread Kirk Brooks via 4D_Tech
Hi folks,
Last week was fun so we're doing it again tomorrow.

>> Please note I pushed the start time back half an hour 'cause 3 is a
little early over here on the left coast. It is a work day, after all.

Topic: 4D Friday Happy Hour
Time: May 1, 2020 03:30 PM Pacific Time (US and Canada)

Join Zoom Meeting
https://us02web.zoom.us/j/83417515161?pwd=Zk1FSDVHQ3BWdHlSdi9TNU53SkpZdz09

Meeting ID: 834 1751 5161
Password: 4d4all   <<<

One tap mobile
+16699006833,,83417515161#,,1#,729196# US (San Jose)
+13462487799,,83417515161#,,1#,729196# US (Houston)

Hope you can join us.

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Multple windows within the same process

2020-04-29 Thread Kirk Brooks via 4D_Tech
Pat,
To expand a little on the other comments for you to be able to _keep_
windows open when you use the * they must be opened from an existing
window. Otherwise they pop open and then close again. Another difference is
when you call

DIALOG("myForm";*)

the method doesn't stop with DIALOG. It keep going. So you don't want to
use this for something where you want to wait for the user input.

This suggests a toolbar sort of approach to the UI where you open a window
that is intended to remain open. Or that these subsidiary windows be
thematically linked to the main window. For instance, I have a database
that allows 3 different windows to call a parser for importing data.
The parser opens in the process shared by those 3 windows.  When you close
the root window, or otherwise end the process, all windows open in that
process close as well.

The suggestion I've picked up is to look at defining a single process as
the UI process and opening most, or all, the windows users interact with in
that process. In this context a process variable becomes like an IP var has
been - available to all the windows. But with CALL FORM you don't even need
to think about it that way.

Where workers come in is to do, well - work. All the heavy processing be it
lookups, calculations, whatever can be done by workers and just the results
are pass back to the form that initiated them. It's a really different way
of thinking about building your forms.

On Wed, Apr 29, 2020 at 4:17 PM Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Maybe it was in a dream ... but I'm sure I recall reading something about a
> new feature (v17) that allows more than one window to be open within a
> process. But now I can't find that info. Did I imagine it?
> Pat
>
> --
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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 Friday Happy Hour on ZOOM

2020-04-24 Thread Kirk Brooks via 4D_Tech
Lo!
I was thinking about you the other day - recalling you stopping by in '16.

On Fri, Apr 24, 2020 at 7:37 AM Lo via 4D_Tech <4d_tech@lists.4d.com> wrote:

> Hi Kirk
>
> Yes, some people are just born one beer below normal.
> Plenty of time to get that sorted...
>
> Love and kisses
> Lo
>
> > Damn - it's that off-by-one problem again...
>
>
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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 v18 — Need methodology to

2020-04-24 Thread Kirk Brooks via 4D_Tech
Hi Chris,

On Fri, Apr 24, 2020 at 1:54 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> • Loading a system document into a BLOB, then using BASE64 ENCODE to store
> it in a TEXT field;

Out of curiosity why not simply blob the document into a blob field? Even
if it's a temporary record just for this purpose. The advantage is the
blobing action takes place on the client and when the record is saved the
data actually moves to the server. Then the operation of saving the blob to
disk can be put into a different method and executed on the server. I found
this gave better reliability (this was happening with 4D connected over the
internet) because I could check where the data actually was at each step
along the way and better resiliency because I could continue a long
operation if it was interrupted.

• the TRIGGER method (running on 4D server) unpacks it and creates /
> updates the files in its ‘Library’ directory on disk.
>
Following from above doing that much heavy processing in a trigger seemed
fragile.


> Now I need to be able to retrieve the contents of these files for 4D
> [Client].
> I can display the files in a Web Area

** But I am looking for a simple way to get 4D Server to ’send’ the data to
> the CLIENT (4D) upon request.
>
So do you want to initiate the transfer from the web page or from the
Client?
From the Client it's pretty straightforward :

Select the doc and fire some method that executes on the server

This server-side method gets the document and a blob and returns it to the
Client as $0

Back on the client you manage saving it to the selected location on disk


Depending on the size and number of the documents I would think about using
temp records: blob into the record on the server and return a list of said
records to the client. The client gets them, writes the blob to disk and
deletes them. Better ability to resume/continue of dropped connections are
an issue.

 Do I have to use Workers, or Stored Procedures, or something?
>
Maybe. If lots of users are doing this a lot of the time it might be
beneficial. But that's more of a tactical question. Whatever code they
would be running is going to involve the decisions you make on the above
tasks. I have used stored methods for this sort of thing (workers didn't
exist yet). The stored methods work well when you put the documents in
records.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 Friday Happy Hour on ZOOM

2020-04-24 Thread Kirk Brooks via 4D_Tech
Damn - it's that off-by-one problem again...

On Thu, Apr 23, 2020 at 10:03 PM Aparajita Fishman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I may be missing something, but isn’t 3 PM PDT = 6 PM EDT?
>
> All the best,
>
>   - Aparajita
>
> > On Apr 23, 2020, at 7:33 PM, 4d_tech-requ...@lists.4d.com  4d_tech-requ...@lists.4d.com> wrote:
> >
>
> > I’m hosting a 4D Friday Happy Hour tomorrow on ZOOM:
> > https://zoom.us/j/91959066132 <https://zoom.us/j/91959066132>
> >
> > Starts at 3PM PDT (7 EDT) and will go until I fall asleep or everyone
> > leaves.
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: 28 character file name limit for binhex encode SMTP_attachments?

2020-04-23 Thread Kirk Brooks via 4D_Tech
Um - ooops!
The place on Miyako's youTube I was referring to is at 21:49.

Sorry.

On Thu, Apr 23, 2020 at 12:02 PM Kirk Brooks  wrote:

> If you haven't already take a look at Miyako's presentation:
> https://www.youtube.com/watch?v=uEtkh8ePDj0
> Specifically he talks about the new transporter starting at 27:30
>
> On Thu, Apr 23, 2020 at 11:56 AM Randy Jaynes via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> Yes.
>>
>> This is a long-standing problem with 4D internet commands. It goes back
>> to at least v6. I know it’s still present in v13 for sure, and you are
>> confirming it’s in v16.4R4.
>>
>> If I remember, I think it may also be limited to 256 total characters in
>> the full path on Windows (maybe Mac too), so you have to be careful of
>> files that are buried several folders deep.
>>
>> This is one of the issues I’m hoping the SMTP Transporter in v18 does not
>> have a problem with.
>>
>> Randy
>>
>> --
>> Randy Jaynes
>> Senior Programmer and Customer Support
>>
>> http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane
>> • Palisades, NY 10964
>> Please send all email contacts to supp...@printpoint.com
>>
>>
>>
>> > On Apr 23, 2020, at 2:41 PM, Joe Dombroski via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>> >
>> > I have been having occasional -43 protocol not supported errors when I
>> > attach files to an email. I finally dug in and found that I must keep
>> the
>> > file name under 29 characters.  Anyone else notice this? I am on 16.4r4.
>> >
>> > Joe Dombroski
>> > Brandywine Electronics, LTD
>>
>> **
>> 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
>> **
>
>
>
> --
> Kirk Brooks
> San Francisco, CA
> ==
>


-- 
Kirk Brooks
San Francisco, CA
==
**
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 Friday Happy Hour on ZOOM

2020-04-23 Thread Kirk Brooks via 4D_Tech
I know. It is hard to plan a party in so many time zones.

On Thu, Apr 23, 2020 at 12:41 PM Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 8AM for me.
>
> “I exercise strong self control. *I never drink anything stronger than
> gin* before
> breakfast.”
>
> W. C. Fields
>
>
> On Fri, 24 Apr 2020 at 04:37, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com>
> wrote:
>
> > Hey folks,
> >
> > I’m hosting a 4D Friday Happy Hour tomorrow on ZOOM:
> > https://zoom.us/j/91959066132
> >
> > Starts at 3PM PDT (7 EDT) and will go until I fall asleep or everyone
> > leaves.
> >
> > It’s not as good as hanging out together at the Summit but let’s share
> what
> > we’re drinking, say hello, laugh at some not-very-funny stories and enjoy
> > each other’s company.
> >
> > If it works we can figure out how to do it again.
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ==
> > **
> > 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
> > **
>
> --
>
> Regards,
>
> Wayne
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: 28 character file name limit for binhex encode SMTP_attachments?

2020-04-23 Thread Kirk Brooks via 4D_Tech
If you haven't already take a look at Miyako's presentation:
https://www.youtube.com/watch?v=uEtkh8ePDj0
Specifically he talks about the new transporter starting at 27:30

On Thu, Apr 23, 2020 at 11:56 AM Randy Jaynes via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Yes.
>
> This is a long-standing problem with 4D internet commands. It goes back to
> at least v6. I know it’s still present in v13 for sure, and you are
> confirming it’s in v16.4R4.
>
> If I remember, I think it may also be limited to 256 total characters in
> the full path on Windows (maybe Mac too), so you have to be careful of
> files that are buried several folders deep.
>
> This is one of the issues I’m hoping the SMTP Transporter in v18 does not
> have a problem with.
>
> Randy
>
> --
> Randy Jaynes
> Senior Programmer and Customer Support
>
> http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane •
> Palisades, NY 10964
> Please send all email contacts to supp...@printpoint.com
>
>
>
> > On Apr 23, 2020, at 2:41 PM, Joe Dombroski via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I have been having occasional -43 protocol not supported errors when I
> > attach files to an email. I finally dug in and found that I must keep the
> > file name under 29 characters.  Anyone else notice this? I am on 16.4r4.
> >
> > Joe Dombroski
> > Brandywine Electronics, LTD
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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 Friday Happy Hour on ZOOM

2020-04-23 Thread Kirk Brooks via 4D_Tech
Hey folks,

I’m hosting a 4D Friday Happy Hour tomorrow on ZOOM:
https://zoom.us/j/91959066132

Starts at 3PM PDT (7 EDT) and will go until I fall asleep or everyone
leaves.

It’s not as good as hanging out together at the Summit but let’s share what
we’re drinking, say hello, laugh at some not-very-funny stories and enjoy
each other’s company.

If it works we can figure out how to do it again.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 Kirk Brooks via 4D_Tech
I have watched a number of them.

The introduction of actual classes that Laurent Ensault discusses are in
v18 beta (or v18r3, I think) and they haven't got the new beta situation
sorted out yet. A lot of folks have asked. Very exciting new directions
though much (most / all?) of these revolutionary new features require you
to work in Project mode. And classes is one of those.

Another presentation I found really interesting as someone who ran an
installation that was accessed via WAN for 15 years is this one
<https://www.youtube.com/watch?v=Ro6RyiPYGIg=1318s> by Marie-Sophie. She
goes into details of how ORDA selections are optimized for working in
client-server situations. I recommend it for anyone with these deployments
especially for deployments over WAN or TCP/IP.

Intissar's overview of table level encryption is also worth a watch.
Especially for any of us using a cloud-based disk to store backup files...

The encrypted table stuff is available in v18 now. Pretty much everything
else is I mentioned here seems to be in the beta.

I encourage you all to try the new Forum. They have opted to use a company
that does this for a living (Discuss) rather than write their own. It
doesn't use 4D as I think the old one did. So it doesn't have that
nostalgic feel of a 4D form form the '90s. It's a different approach so
getting everything emailed to you is probably not going to be very
enjoyable. If you can get over those two big issues I think it's pretty
good. A couple of other forums I participate on use Discuss as well so it
may be familiar. There is no Translate button, however.

If you happen to use Chrome you probably already know you can translate a
page on the fly with a right click. If you don't use Chrome you might
consider installing it just for reading the Forum. The translations are
readable and I have yet to have anyone complain about offering an English
response on a post started in another language.

Notable, so far anyway, is nothing from JPR [purposely employing the secret
Bat Signal] or Laurent Ribardiere.

On Thu, Apr 23, 2020 at 2:44 AM Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Has anybody seen any of the summit stuff yet ?
>
-- 
Kirk Brooks
San Francisco, CA
==
**
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: Anyone used Twilio SMS?

2020-04-17 Thread Kirk Brooks via 4D_Tech
Hey Joshua,
Thanks for the real life feedback. I got Twilio up and running with the
help from another friend and it looks great. We will be deploying it in a
couple of weeks.

On Fri, Apr 17, 2020 at 2:27 PM Joshua Hunter via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I've used Twilio since about 2015, but not from 4D. I've found their
> support to be friendly and helpful. Their pricing is transparent and they
> offer good logging and let you control your maximum spend. I highly
> recommend them. I haven't had an outage that I noticed and it costs me less
> per message now than it did when I started.
>
> Joshua Hunter
> jos...@dwdev.com
> (425)673-1974
> www.dwdev.com
> Dataworks Development, Inc.
> Providing secure and configurable data management solutions for research
> and clinical labs since 1987.
>
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk
> Brooks via 4D_Tech
> Sent: Wednesday, April 15, 2020 8:12 AM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Kirk Brooks 
> Subject: Anyone used Twilio SMS?
>
> I'm looking for some feedback and any code you are willing to share.
>
> Thanks
>
> --
> Kirk Brooks
> San Francisco, CA
> ==
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Long running reports to disk intermittently disrupted and fail

2020-04-16 Thread Kirk Brooks via 4D_Tech
John,
On Thu, Apr 16, 2020 at 1:39 PM John J Foster via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Right now there’s a specific computer where these reports are run from at
> the end of each month. And yes they need to run at the end of the last day
> of the month and before any new data has been added due to the nature of
> the required field and printed reports.
>

You can always write the report to a temp file somewhere on the server.
Create a directory in the database folder, for example. Once the file is
created you can blob it up and move it back to the client. It will still be
faster I bet.

Or considering the fact it's so time sensitive and can't be recreated
saving a copy on the server might be an actual good idea.

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Long running reports to disk intermittently disrupted and fail

2020-04-16 Thread Kirk Brooks via 4D_Tech
John,
I agree with Jim: separate the creation of the file from moving the file to
the network. A lot has changed in the last 20 years or so with the way
network access is managed and old code like this that looks at a network
address as equivalent to a local disk are problematic. We ran into this on
another project where the 4D app is doing a lot of file manipulation on a
networked drive.

Better yet - re-write the file generation to run on the server. In my
experience when a report like that takes so long to run it's due to moving
lots of data back and forth. Move the code that actually creates the file
to a method that can execute on the server.

On Wed, Apr 15, 2020 at 10:10 AM John J Foster via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hey All,
>
> When it rains it pours…
>
> 4D v17.2 64bit Windows
> Windows 10 Pro
>
> We have some reports that are run in a batch overnight. Have to because
> they take that long to run all of them. Anyway, since we’ve upgraded from
> Windows 7 to Windows 10 there have been I’m guessing timeouts on some of
> these larger reports.
>
> The report is running along and then we get the error: "executing the
> method “EXP_CumulativeClaims” at the lilne number 63. The .txt document
> cannot be written. File not found.”
>
> This is line #63:
> SEND PACKET($fileRef;$packet)
>
> It varies when it quits. It’s usually saved to a network drive and IT says
> nothing is happening to disrupt the connection. And there are other reports
> where this happens as well.
>
> The text file report size - when it works - is large:
>
> Reserve file: 831,801kb
> Claims file: 26,959kb
>
> So these reports were created way back in 2004. The number of records has
> grown dramatically over the years. Reserves is up beyond 2.3 million
> records.
>
> Is it possible that this is a client-server timeout issue? If so, how to
> fix?
>
> Clients IT claims the network drive is always available. Is there a way to
> “know” for sure and test each time?
>
> Is there a way to capture debug info which might reveal the cause? Would
> logging using 4D’s component help?
>
> Would it be helpful and speedier to redesign the reports so they are not
> sending out each row but maybe save each row to a text variable, say 100 or
> 1000 rows and then send packet?
>
> We are open to all ideas.
>
> Appreciate,
> John…
>
>
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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
**

Anyone used Twilio SMS?

2020-04-15 Thread Kirk Brooks via 4D_Tech
I'm looking for some feedback and any code you are willing to share.

Thanks

-- 
Kirk Brooks
San Francisco, CA
==
**
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 v18.1LTS - Startup Takes 10-15 Minutes

2020-04-10 Thread Kirk Brooks via 4D_Tech
Tim,
This is great info. Thanks for testing it out.

On Fri, Apr 10, 2020 at 10:57 AM Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I also tested editing the text of a method with TextEdit while the Project
> was open on 4D Server. The method was not open with 4D Remote. In fact no
> 4D Remote was even connected to 4D Server. I could change the method text
> and save it. No errors from TextEdit. Opened the method file again and the
> changes I made were there.
>
> But when I started 4D Remote, connected to 4D Server, went to Design and
> opened that method, my change was not there. It was still in the method
> text file, but the changes didn’t show up in the 4D Method Editor.
>
Take a look in the local resources folder for the client. This sounds like
the client gets its own cache of files from the server and 'runs' those.

I would like for the to support 4D Team Developer using Project mode. There
> are times when this is a good solution. Example, doing 4D Server testing of
> parts of an application. Be nice to be able to test it running on 4D Server
> and fix problems. And be nice to continue to have all the advantages of 4D
> Team Developer in addition to version control advantages that Project mode
> provides.
>
I agree. I would like for support to be more familiar with the new stuff in
general.

-- 
Kirk Brooks
San Francisco, CA
==
**
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 v18.1LTS - Startup Takes 10-15 Minutes

2020-04-10 Thread Kirk Brooks via 4D_Tech
This is what I found also. Thinking about it you can see how it makes sense
- a Project is simply a collection of text files. They can be edited by 4D
Method Editor or a text editor at the same time. On your local machine
that's manageable, desirable, but on the server it would be a nightmare. I
haven't tested this but I suspect you can edit files directly on the server
with a text editor. And you could also simply add or remove files. So you
could add or remove large amounts of functionality on the fly if you have
access to the physical disk. That could be great or could be terrible. The
important part is those changes are all taking place outside of 4D itself
and 4D Server has no control over them.

In a development setting this could be pretty dynamic and useful. Fun, I
dare say. But I would be hesitant to deploy such a setup to a
production setting.

On Fri, Apr 10, 2020 at 8:50 AM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> But it appears that right now an uncompiled Project database is basically
> in read only mode in terms of the Design environment.
>

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Longitude Index: B-Tree or Cluster

2020-04-10 Thread Kirk Brooks via 4D_Tech
John,
If absolute raw speed is what you are looking for I would break each value
into whole numbers - the integer and the decimal and store them separately
as longints. Index the integer with a b-tree and the decimal with a
cluster. You sacrifice space (maybe - haven't really done the math on 2
longs vs 1 real) but space is cheap and you want speed.

On Thu, Apr 9, 2020 at 8:53 PM John J Foster via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> I have a GEO database of almost 5 million cities. They include various
> data and latitude and longitude.
>
> I need to use the Longitude file in searches. To speed it up I need to
> index. Many of the values are similar like 141.235 or 141 3.23 and so on.
> So for those who might know would a Cluster index be better suited or a
> B-Tree?
>
> Thanks,
> John…
>
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Where Are All The Steppers And Spinners?

2020-04-02 Thread Kirk Brooks via 4D_Tech
On Wed, Apr 1, 2020 at 8:36 PM Tom Benedict via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> For some reason I was under the impression that using project mode was
> optional.
>

You know it's actually a little more involved. There are some real trade
offs to think about.

There are a number of things you can't do in Project mode:

Paste in something you copied from a binary database. So no copying a form
from that v14 database and pasting it into v18 project. Same with dragging
methods from an old database.

Can't edit it on 4D server. So no team development on a central data
structure. No tweaking and developing directly on the server.

And a number of other things I don't recall at the moment because they
aren't as important to me.


For places that run their 4D server interpreted I think it's a matter of
practice. The good part is you can still simply update the files the
database runs on on-the-fly which is just like logging in and changing
code. On the other hand anyone poking around on the server could a) totally
hose it by moving/deleting a file and b) see hard coded sensitive
information or business logic. The security of the 4D code is the security
of the server.

The benefits of Project are version control, git integration and being able
to use a real text editor. This point is really pretty huge for me. I
really like being able to see and edit the whole database - including the
web folders - in my text editor. This makes changing a field name much
easier than relying on Find in design. Plus it means that when I change the
methods I can also look for the same fields in any web pages that reference
them too.

It also makes it easy to move large bits of common code into a project -
methods and forms.
I like CSS so I like being able to use it instead of the old style sheets -
but it's a big difference.

My preference is to use a Project for new work. But it depends and I'm not
at all opposed to using binary when there's a good reason. In my opinion 4D
is really putting their focus on ORDA and Project mode development and I
won't be surprised to see some of these limitations or distinctions go away
in the next few versions. But that's a ways off at the moment.

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Text Editor Which Knows 4D Tags?

2020-03-26 Thread Kirk Brooks via 4D_Tech
Tom,
VS Code is pretty good too. And there's an add on for 4D. It won't give you
the the intelligence of the method editor (eg. linking to another method)
but it will show the code blocks like you describe. Plus it's just a more
full featured text editor.

On Thu, Mar 26, 2020 at 2:22 PM Tom Benedict via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I’m very new to 4D Web programming and I’m trying to get comfortable with
> the tools. One thing that I’m challenged by is debugging HTML.
>
> For example, I’m getting an error on a web page that says “4DENDIF
> expected”, so I’ve traced the html in Chrome using the Developer Tools and
> I have identified the suspect html file. Now I am poring over that file in
> my text editor, matching the 4DIF to the 4DENDIF tags. This works, but it
> is tedious and time consuming and error prone. It would nice to have a tool
> that could format it automatically.
>
> I don’t know much about text editors, but I think what may be needed is a
> custom lexer. I use NotePad++, which seems to support adding lexers, but
> would be willing to consider changing to something else, if it could learn
> about 4D Tags. Is there an Text Editor which knows about 4D Tags? Does
> anyone know how to write a lexer for 4D Tags?
>
> Or maybe I’m making this too difficult?
>
> Tom Benedict
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Programmatically change the number format?

2020-03-15 Thread Kirk Brooks via 4D_Tech
You treat each of the column objects separately. So let's say your columns
are named "col_1", "col_2" and so on. (This is the object name.)
Use OBJECT SET FORMAT to manage the formatting from there.
https://doc.4d.com/4Dv17/4D/17.4/OBJECT-SET-FORMAT.301-4882942.en.html

On Sun, Mar 15, 2020 at 12:09 PM wangel--- via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> In a listbox with a selection of records I have some columns with numbers.
> They have the number format 0.00. Not all the cells have numbers greater
> than 0, so is it possible to programmatically change the format to #.## in
> cell where the number is 0?
>
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: Query peculiarity in v17? Or normal?

2020-03-14 Thread Kirk Brooks via 4D_Tech
Yes, that's correct. Keep in mind that

QUERY([Table2]; [ Table2] Link_T1_ID =[ Table1] T1_ID)

evaluates [Table1]t1_id when the line is executed. If there is no current
record for Table1 it evaluates to zero so the query is looking for Table2
link fields with a value of zero.

On Sat, Mar 14, 2020 at 8:05 AM wangel--- via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have a Table1 with a field T1_ID, and a Table2 with a field Link_T1_ID.
>
> All Table1 records have T1_ID values greater than 0. In Table2 several
> records may have [ Table2] Link_T1_ID :=0.
>
> I query Table1 with Table2 where [ Table2] Link_T1_ID :=0: QUERY([Table1];[
> Table1] T1_ID =[ Table2] Link_T1_ID)
>
> And I get 0 records, as expected.
>
> I then query Table2 with Table1 where [ Table2] Link_T1_ID equals 0:
> QUERY([Table2]; [ Table2] Link_T1_ID =[ Table1] T1_ID)
>
> And I get all the Table2 records where [ Table2] Link_T1_ID :=0 ( in other
> word more records than 0 records).
>
> Is this as expected when there is no Table1 records where [ Table1]
> T1_ID:=0
> ?
>
>
>
> **
> 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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: How can one REDRAW a SUBFORM that uses a OBJECT as its 'variable or expression'?

2020-03-10 Thread Kirk Brooks via 4D_Tech
Hi Chris,
What's going on in the subform that's not updating?

On Tue, Mar 10, 2020 at 12:05 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 4D continues to NOT QUITE truly and fully support its object notation, and
> the inability to get a pointer to an object attribute continues to confound.
>
> The latest issue involves an attempt to use REDRAW( ) to redraw a subform
> that is named, but whose ‘variable or expression’ as an OBJECT (not a
> variable).
>
> Because REDRAW( ) does not support a common 4D command structure:  i.e.
> REDRAW ( * ; ObjectName ) in addition to REDRAW ( Variable ), then it is
> impossible to use REDRAW on a subform that uses an OBJECT.
>
> Does anyone have a method of getting a subform REDRAW accomplished, when
> its ‘variable’ is an OBJECT?
>
> Thanks,
> Chris
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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: JSON File To Object

2020-03-07 Thread Kirk Brooks via 4D_Tech
Steve,
$text:=Document to text()
$obj:=JSON Parse($text)

On Sat, Mar 7, 2020 at 1:43 PM Stephen J. Orth via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm having a brain-fart and looking for the fastest way to get a JSON
> formatted document imported and put into an object.
>
> Any insight would be appreciated!
>
> Best,
>
>
> Steve
>
> *
>   Stephen J. Orth
>   The Aquila Group, Inc.  Office:  (608) 834-9213
>   P.O. Box 690   Mobile:  (608) 347-6447
>   Sun Prairie, WI 53590
>
>   E-Mail:  s.o...@the-aquila-group.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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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: 64-Bit Quick Report related fields

2020-03-05 Thread Kirk Brooks via 4D_Tech
Doug,
This just in:
https://kb.4d.com/assetid=78424

I've heard it said Catalina is the Vista of MacOS.  And I am a Mac guy,
btw.

Having said that I don't see anything in the Tech Tip that relates to the
Quick Report Editor.

On Thu, Mar 5, 2020 at 12:03 PM Doug Hall via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> A few weeks ago, we switched to 4D v17 (64-Bit) so that our users could run
> Catalina. Today, a user showed me that you can't dig more than one table
> away from the current table, in the new 64-bit Quick Report Editor. Are we
> missing something, or is there a way around this?
>
> Thanks!
> **
> 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
> ******



-- 
Kirk Brooks
San Francisco, CA
==
**
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
**

Anyone have experience working with EdExpress?

2020-02-18 Thread Kirk Brooks via 4D_Tech
I have a project with a small private college that needs to interface with
EdExpress. If anyone has experience I would very much appreciate hearing
from you. I have none at the moment so even a little suggestion about how
to get started will be appreciated.

Either here or off list.

Thanks!

-- 
Kirk Brooks
San Francisco, CA
==
**
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: Entity Selection Listbox with Image

2020-02-14 Thread Kirk Brooks via 4D_Tech
Hi Doug,
I did exactly this with a listbox recently. In my case the pictures
involved are thumbnails of students represented in the listbox. The
thumbnails are stored in a table related to the Student table.

At first I thought I'd have to do something tricky to make it work but they
simply appear as desired. The largest number of records displayed is about
10k or so and this hasn't caused any performance issues.

On Wed, Feb 12, 2020 at 4:03 AM Douglas Cryer via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Folks,
>
> We have been working on moving our generic listing over to using ORDA.  To
> do this we realise that we would need to use entity selections with list
> boxes.
>
> This has gone really well but we have now hit a very road bump and I need
> some advice on how to overcome it.
>
> Two of our tables have picture fields containing thumbnails that can be
> added to a listing view.  In classic list box using selection this works
> really well to display the thumbnail so the user knows visually what the
> line is.  The data loads quickly and scrolls smoothly.  However, when a
> picture is put into a list box with an entity selection it appears to kill
> performance.
> - The data takes ages to load (15 seconds with 4K records) even when all
> picture fields are empty!
> - The scroll is jerky and makes the view unusable.
>
> I feel I must be missing something.  Is there some new trick to displaying
> pictures in list boxes that are using entity selections.
>
> We are using the new v18 LTS release so I am concerned that our dreams of
> an ORDA future have just been put on hold.
>
> Regards,  Dougie
> 
>
> telekinetix Limited- J. Douglas Cryer
> Phone : 01234 761759  Mobile : 07973 675 218
> 2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
> Email : jdcr...@telekinetix.com  Web : http://www.telekinetix.com <
> http://www.telekinetix.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
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
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 is equivalent to SELF when a form object's "variable or expression" is an object attribute?

2020-02-04 Thread Kirk Brooks via 4D_Tech
Chris,

On Tue, Feb 4, 2020 at 12:58 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> // The ‘field’ that needed to be updated with the KEY of the selected
> option would be something like: //
> Form.en_edit.contact   // which, say, translates to [Company]contact in
> classic 4D
>
> When I had done something similar in classic 4D, I could key a pointer to
> [Company]contact and update it with something like:   CompanyContact->:=
> $value
> But with the key being stored in Form.en_edit.contact, there was no way to
> do something similar.
>
I must not be following you. Why wouldn't

Form.en_edit.contact:=$value

work?

-- 
Kirk Brooks
San Francisco, CA
===
**
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 is equivalent to SELF when a form object's "variable or expression" is an object attribute?

2020-02-04 Thread Kirk Brooks via 4D_Tech
Chris,
For a listbox the equivalent of 'self' is the Current Item Datasource.
Let's say that is Form.LB.currentItem in keeping with your example. (It
could be something else just as well.) This is the object that corresponds
to the listbox row generally speaking. So you could have a method that
validates and formats the whole object that you pass that object to.

If it's a big object and this would take noticeable time or you need to do
something more elaborate like lookups you can know still use the row and
column (LISTBOX GET CELL POSITION) to work out what's changed.

The object script has access to This. So you could use
This.FirstName:=Uppercase(This.FirstName) in the column script.

When using ORDA on a form keep in mind changing the data is what we want to
do. The display will update itself if you are using Expressions.

Let's say I have an Input I want to capitalize instead of a listbox column.
Let's say Form.myInput is the expression and the input object is named
InputObject. When the user changes the data I have options:

1) Self->:= Uppercase(Self->)

2) Object get pointer(Object named;"InputObject")->:=Uppercase(Object get
pointer(Object named;"InputObject")->)

3) Form.myInput:=Uppercase(Form.myInput)

#1 is the old-school approach. Simple but opaque (what exactly is Self
pointing at?)
#2 is the newer-school approach taking advantage of dynamic variables.
Better sense of what is being operated on.
#3 simply updates the property value directly. Completely transparent about
what we are acting on.

#1 and #2 are manipulating the input object which then updates Form.myInput
whereas #3 simply updates Form.myInput directly and then the form input
updates itself to reflect that.

Hope this helps.


On Mon, Feb 3, 2020 at 7:35 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> What a weird ’subject’ for this question. Sorry. Seems quite confusing.
>
> 
>
> Say that the “variable or expression” for a on-screen object is
>  Form.LB.Browser.en_edit.FirstName
> This is entirely reasonable, as 4D’s ORDA has taught us to use such
> ‘expressions’ for the fields
>
> BUT in the script for this, there is no way to use Self (as there would be
> if it was a 4D variable) because it is an ATTRIBUTE of an object.
>
> This is stupid.
> It makes it impossible to write a script as simple as:
>
> Self->:= Uppercase(Self->)
>
> Because Self returns a nil pointer.
>
> So how on earth do we retrieve and set the value under these
> circumstances? [GENERICALLY; I do not want to use the object’s “expression”
> in the script]
>
> There is no such 4D method as   OBJECT Get Value( ) OBJECT SET VALUE( )
> If there were, we could write:
>
> OBJECT SET VALUE(*; OBJECT Get Name; Uppercase( OBJECT Get Value(Object
> Get Name) ) )  // really cumbersome, but is hypothetical because there is
> no ‘OBJECT GET / SET VALUE’ command.
>
>
> **
> 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
> **



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

Re: SDI or MDI

2020-01-31 Thread Kirk Brooks via 4D_Tech
Paul,

On Thu, Jan 30, 2020 at 12:40 PM Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If you are a Windows user that has multiple monitors and you like to use
> all of your monitors for any window you want, then MDI is a severely
> limiting user interface. You are limited to only using 1 monitor for all
> the windows of a single application.
>
If you have the option of using SDI take it.
If you are using a version of 4D that doesn't support SDI you can use
multiple monitors - it's just crude. A user can stretch the MDI across more
than one monitor. It's less awful if the monitors are identical. And it's
still the MDI but it's a hack some folks use.

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

Re: Reading and writing large arrays to disk

2020-01-06 Thread Kirk Brooks via 4D_Tech
Peter,
I agree with Chuck here - writing a line at a time is slow. It's very
secure though. So it's good if you may crash - whatever has already been
written stays written to disk. But otherwise better to buffer some and then
write.

After looking at the link Arnaud posted it looks like concatenating about 1
- 2k worth of data is optimal.

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

Re: gitignore for projects

2020-01-06 Thread Kirk Brooks via 4D_Tech
Mike,
To your original question about which files to ignore I drop all the MacOS
specific files (obviously).

The RESOURCES folder is placed outside the Project folder. Data, Components
and Plugins are too. So the actual folder I make the git repo is the
database folder. Project folder is really the alternative to the
binary files. So inside of this folder I exclude the Preferences,
userPreferences and Logs. Here's a recent one:

# Untracked files and directories:
dataFile/
Logs/

Preferences/

userPreferences.*/

# OS generated files #
##
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db



On Mon, Jan 6, 2020 at 6:49 AM Mike Kerner via 4D_Tech <4d_tech@lists.4d.com>
wrote:

>  method comments are gone - does that mean that they aren't even
> exported when the project is created?
>
It's that way now. I haven't heard anything concrete regarding what the
future plans are.
I was starting to get agitated about this but when i thought about it the
'method' is a text file now. Where are these comments going to go? Either
they are added as a field to the JSON in the file header (not preferable to
me) or they are maintained in some sort of separate structure. Like another
directory of text files. Nice - but more complexity.

So, what are Comments good for? Obviously comments in code are crucial but
these are a) more decorative and b) require a separate, specific action to
access. The most useful thing for me is that they are the help tips for
methods in components. You can't search on them, you can't easily update or
export them en masse. I don't think their value is worth the effort to
replicate in Project mode. I do think there is a need for improving the
documentation in a Project, but the old Comments aren't it.

Additionally, recent versions of v18 have a tendency to loose the block
comments. It seems like they simply aren't shown, not actually removed. I
reverted to an earlier version of v18 (244065) until they fix it.

https://forums.4d.com/Post/EN/33167019/1/33167020

Product name 4D - 4D Server [  Previous topic  |  Next topic  ]
Build 246179
Platform MacOSX
Full Name Kirk BROOKS
Bug number ACI0100382 (In Progress)
Severity UI/Usability
Bitness 64-bit
Submited 12/29/2019 - 16:32
CONTEXT:
Systems or/and 4D versions or/and hardware where the bug happens:
- 4D single user
-
Systems or/and 4D versions or/and hardware where the bug doesn't happen:
-
-

SUMMARY:
This build, and some recent previous ones, do not display block comments.
This applies to block comments created in a previous version, 244065 for
instance, as well as block comments entered in 246179.
This seems to be a display problem. The space the comments occupy is shown
but it's blank in 246179. The comments are there, however, Opening the same
database in 244065 and looking at the same method I see them.

STEPS TO REPRODUCE THE BUG:
1. open a method
2. create a block comment and type something. Comments are visible until
the method is closed.
3. close and re-open the method

ACTUAL RESULT: comments are not visible

EXPECTED RESULT: comments are visible


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

Re: Reading and writing large arrays to disk

2020-01-05 Thread Kirk Brooks via 4D_Tech
Miyako,
Nice explanation.

More or less - where do you think the inflection point is where simple text
concatenation becomes less efficient than adding the text to a BLOB?

On Sun, Jan 5, 2020 at 8:20 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> concatenation of text is intuitive, but inefficient.
>
> every time you add text to another, a new buffer is created and the whole
> text is copied there.
> as the text gets larger, the allocation of memory and copying of data will
> become slower.
>
> variable to blob is fast as it simply packs the variable.
> I imagine you mainly use basic ASCII, compression would be really
> effective.
> I would not spend much time looking for the best compression algorithm or
> level.
> 200,000 elements / 2MB is too small to notice any difference.
>
> 2020/01/06 13:09、Mitchell Shiller via 4D_Tech <4d_tech@lists.4d.com
> <mailto:4d_tech@lists.4d.com>>のメール:
>
> Obviously using the reverse commands to read from disk.
> Option one seems by far the slowest.
>
> Anyone know if 2 or 3 is faster?
> Does the COMPRESS BLOB help? The resultant file is about 2 MB in size
> without compression.
> If yes to COMPRESS BLOB , Any différence from native 4D vs. GZIP
> compression?
>
>
>
> **
> 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
> **



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

Random normal distribution values

2019-12-24 Thread Kirk Brooks via 4D_Tech
Who doesn't like an(other) discussion about random numbers?

I reading an article on Monte Carlo simulations and came across a method
for getting a random value from a standard normal distribution. (The
standard normal distribution is the familiar bell curve where the mean is 0
and the standard deviation is 1.) Typically I might pull out the old 4D
Math database and get the complicated formula from there and work out
something. But there is a really easy way to accomplish this using the
baked in Random function.

C_REAL($0)
$0:=((Random+Random+Random+Random+Random+Random+Random+Random+Random+Random+Random+Random)-(32767*6))/32767


The original idea is based on a Rand() function that returns a value
between 0 and 1. So you add up 12 of these random values and subtract 6. 6
is the expected mean of 12 selections from a standard random distribution
so the subtraction adjusts the mean to 0 without changing the standard
deviation. The result is not technically a standard distribution but a
reflection about the mean of zero with a standard deviation of 1 - which
the most of what defines a standard deviation.

We can do that too:

$0:=((Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767)+(Random/32767))-6


Dividing Random by 32767 gives that same value since Random returns a value
between 0 and 32767.

It turns out to be slightly faster to avoid all those division operations
and so the version I gave first. Apparently this approach is well known in
some areas but I had never seen it before.

Playing with this in v18 I notice the distributions become quite normal
when they get large ( ~5000 iterations). It is fast with iterations of 100k
averaging about 870ms uncompiled. To look at resulting distributions I made
a simple form with a picture variable and a button and borrowed the code
from the Graph document page for the button method.


*ARRAY LONGINT*($aY;19)

*ARRAY TEXT*($aX;19)

$aX{1}:="5.0"

$aX{2}:="4.5"

$aX{3}:="4.0"

$aX{4}:="3.5"

$aX{5}:="3.0"

$aX{6}:="2.5"

$aX{7}:="2.0"

$aX{8}:="1.5"

$aX{9}:="0.5"

$aX{10}:="0.0"

$aX{11}:="0.5"

$aX{12}:="1.5"

$aX{13}:="2.0"

$aX{14}:="2.5"

$aX{15}:="3.5"

$aX{16}:="4.0"

$aX{17}:="3.0"

$aX{18}:="4.5"

$aX{19}:="5.0"


*For* ($i;1;100)

$j:=10+*Round*(*rand_z*/0.5;0)

$ay{$j}:=$aY{$j}+1

*End for*


*C_OBJECT*($obj)  //Initialize graph settings

*OB SET*($obj;Graph type;1)

*GRAPH*(vGraph;$obj;$aX;$aY)  //Draw the graph


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

Re: 4D Write Pro Table Printing

2019-12-16 Thread Kirk Brooks via 4D_Tech
David,
Have a look here:
https://blog.4d.com/table-pagination-in-4d-write-pro/

The good news is it sounds like the pagination stuff is available but (bad
news) it's 17r2+.

However, we've found 17r6 to be very stable. So it may be the solution you
need.

On Mon, Dec 16, 2019 at 7:08 AM BTB-David via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hello everyone,
>
> I’m using 4D v17.3 with 4D Write Pro.  When I create a Write Pro Table and
> populate it and go to print it, it does not handle page breaks.  If the
> whole table doesn’t fit on the remainder of the page, a page break is
> automatically done.  On the new page, the contents of the table are printed
> but it only prints as much as it can fit - even printing over the footer.
>
> Has anyone cracked the nut on printing out 4D Write Pro tables so that
> page breaks are done automatically within a table?
>
> Much Thanks!
>
> David Conley
> By The Book, Inc.
> Office: 815-234-7530
> http://www.bythebook.com
>
>
>
>
>
>
>
>
>
>
>
> This email was sent to 4d_tech@lists.4D.com (mailto:4d_tech@lists.4D.com)
> unsubscribe from this list (
> http://emailclicks.bythebook.com/track/unsub.php?u=30055319=163ac5564c314a08861d97aed10b3849.NlszJIRS%2FTUDQjLGi3RBQPkkK%2Bw%3D=https%3A%2F%2Fmandrillapp.com%2Funsub%3Fmd_email%3D4d_tech%2540lists.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
> **



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

Re: 4D v17 To QuickBooks Using Miyako's QBO.4DB

2019-12-13 Thread Kirk Brooks via 4D_Tech
Hi Ken,
Reading through your messages you don't mention if you are accessing QBO
(quickbooks online) or the desktop version. As I recall Myle's product only
accessed the desktop version - but that a really old memory.

On Fri, Dec 13, 2019 at 2:34 PM Ken Eyring via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Thanks for responding Miyako.
>
> I'm not familiar at all with OAuth.  Can you point me in the right
> direction where I can learn how to use an OAuth session for QB?
>
> Thanks again,
> Ken
>
>
>
>
>
> On 12/13/19 16:58 PM, Keisuke Miyako via 4D_Tech wrote:
> > the component is an OAuth example.
> >
> > it simply illustrates how to manage an OAuth session for QB.
> >
> > everything else is generic XML/HTTP, not specific to OAuth,
> > so none of it is implement in the component.
> >
> > QuickBooks is not used in my country,
> > I have no customers using it.
> >
> >> 2019/12/14 4:47、Ken Eyring のメール:
> >> Is there any documentation or examples for Miyako's plugin that anyone
> is aware of and would be willing to share?
> >
> >
> >
> >
> > **
> > 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
> **



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

Re: Constants in code.

2019-12-09 Thread Kirk Brooks via 4D_Tech
Eric,
I'll add a vote for Cannon's code for creating constant XLIF files. I
really like being able to add comments to what the constants are for in the
code. You just can't do that with the 4DPOP component.

On Mon, Dec 9, 2019 at 9:55 AM Eric Naujock via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thanks I downloaded the document. Reading into it. Hopefully it still
> works for the new 4D Projects system. I am looking forward to being able to
> use GIT to manage my 4D projects. Versioning.
>
> > On Dec 9, 2019, at 11:40 AM, Cannon Smith <
> can...@synergyfarmsolutions.com> wrote:
> >
> > Hi Eric,
> >
> > There is also a way to create constants in your code if you want. There
> is a tech note about it here:
> >
> >   <https://kb.4d.com/assetid=77806>
> >
> > HTH.
> >
> > —
> > Cannon.Smith
> > Synergy Farm Solutions Inc.
> > Aetna, AB Canada
> > 
> > 
> >
> >
> >> On Dec 9, 2019, at 8:09 AM, Eric Naujock via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >>
> >> Can you define your own Constants? I would like to define constants in
> my database to cover various groups for permissions. But what I am finding
> in the docs for v17r6 says they are listed in the constants window. But
> there does not seem to be anything that tells you how to create your own.
> Obviously there must be a way to do so since there are constants for
> plugins.
> >
>
> **
> 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
> **



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

Re: ORDA RELATE MANY SELECTION

2019-12-06 Thread Kirk Brooks via 4D_Tech
Keith,
Neil is dead on in the case of RELATE MANY - you can access this directly
from the entity via the name of the relation. But you are asking about
RELATE MANY SELECTION where you have a selection of one-records and you
want a selection of all the many-records.

Your example works fine - though you don't need the step of converting to
and from the array:

$clients:=ds.Client.query("Name = :1";"@"+Self->+"@")
$col:=$clients.distinct("PriKey")
EntSel:=ds.Contract.query("to_Client IN :1";$col)

By definition the PriKey should be distinct already but there's no downside
to the command and it will also work for non-distinct values so it's a good
habit to develop.

I would shorten it to a single query line:

$col:=ds.Client.query("Name = :1";"@"+Self->+"@") .distinct("PriKey")
EntSel:=ds.Contract.query("to_Client IN :1";$col)


This doesn't throw an error if the query is empty. And it's two lines of
code to replace 7.

I infer you are retro fitting this ORDA code into an existing form because
of using Self and a process var for EntSel. My experience so far is this is
the less optimal way to implement ORDA. First, classic 4D is probably doing
just fine for this chore so carry on with what you've got. Introducing ORDA
in cases like that usually don't work out great. Your example sort of makes
this point - if you start thinking the way to solve an ORDA problem is to
start converting back and forth between arrays you are probably missing
something new you should be using.

For UI stuff like this that means the object referenced by Self will
ultimately be better handled if you begin using Form. I like to start from
scratch when  convert a form: make a new blank form. Copy in the most basic
elements of it and learn to set it up using Form. You will know you're
doing it right when you stop needing to rely on pointers (especially Self)
and process variables to manage forms. I stress "rely on" here. Self is
useful but if you are using ORDA it's the last resort, never the first.
Process vars have a place but rarely - very rarely - for managing a modern
4D form. Learn to use Form instead.

Once you have the basics working, (opening, closing, moving around,
populating static or semi static objects) start adding in the other
functionality. As you do that think about what you trying to accomplish -
what is goal and purpose of the list, listbox, subform, etc. you are adding
in. And how do you accomplish that with ORDA. This is important because
whatever that task is accomplishing it with ORDA will nearly always be a
completely different workflow from accomplishing it in classic 4D. If you
simply paste in what you've been doing it's not going to really change
anything. And if you don't want to really change anything what's the point
of converting to ORDA?

By putting this into a brand new form you eventually get to a point where
you can compare your new approach to the old head to head. And this also
makes it easier to swap out the new form for the old in your code.

Hope this helps.

On Thu, Dec 5, 2019 at 12:00 PM kculotta via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hello,
>
> RELATE MANY SELECTION is a convenient way to get a set of related many
> records.
> Is there a more succinct or efficient ORDA method than the following to do
> the same thing?
>
>   // get Contracts for a group of Clients
> ARRAY TEXT($array;0)
> C_COLLECTION($col)
>
> $clients:=ds.Client.query("Name = :1";"@"+Self->+"@")  // get the clients
> $col:=$clients.toCollection("PriKey")  // make a Collection of Client
> Primary Keys ("PriKey";"..Value..";"PriKey...)
> COLLECTION TO ARRAY($col;$array;"PriKey")  // make it an array of Primary
> Keys
> ARRAY TO COLLECTION($col;$array)  // back to a Collection of Text
> ("..Value..";"..Value..")
> EntSel:=ds.Contract.query("to_Client IN :1";$col)  // search in the
> Collection
>
> Thanks - Keith CDI
> ******
> 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
> **



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

Re: Trapping the 'return' key in list forms

2019-12-02 Thread Kirk Brooks via 4D_Tech
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
**

Re: Subform get record info when click on row

2019-11-23 Thread Kirk Brooks via 4D_Tech
Gary,
v17 is great.

So, the first thing I would suggest is to think about using a listbox
instead of output subform. Unless you have some really complicated
implementation of an output subform (like here
https://forums.4d.com/Post/EN/32395457/1/32395458) I doubt there's much to
be gained using that approach now.

And if you can use ORDA in this case the opportunities are much more
robust.

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

Re: Subform get record info when click on row

2019-11-23 Thread Kirk Brooks via 4D_Tech
Gary,
What version are you working on?

On Sat, Nov 23, 2019 at 3:57 PM Garri Ogata via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Greetings,
>
> I have an output subform (list, selection mode none, enterable in list),
> that I want to get the record clicked on when a user clicks in a field
> (cell) in the subform. Is there a way to do this?
>
> I have the on clicked event set and when I trace it does not show the
> record info? Is there a way to know the selected record?
>
> Thanks in advance.
>
> Garri Ogata
> **
> 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
> ******



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

Re: CURL SFTP issues with SSH

2019-11-21 Thread Kirk Brooks via 4D_Tech
Hey Peter,
I can't give you the specific answer but if you haven't already I'd
recommend installing Postman <https://www.getpostman.com/>.
How that may help you is you can look at exactly what is being sent and
received from the destination. The first thing I'd do is capture the
traffic with FileZilla and compare it to the traffic between 4D. That will
at least show you what's different between the two.

Hope this helps

On Thu, Nov 21, 2019 at 12:44 PM Peter Hay via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi,
>
> I'm using Miyako's CURL-FTP plugin to try and connect to an SFTP site using
> SSH keys, but I keep getting an error 67.  I've tried the same settings
> using CURL from the command line, and get the same error.  I've also tried
> the same thing using FileZilla and it works perfectly, so I know the SSH
> Keys files are in good shape.
>
> When I run CURL form the command line in verbose mode, here's what I get;
>
> curl -u THEUSER: --key "C:\SSH_Private.ppk" --pass "ThePassword" --pubkey
> "C:\SSH_Public.key" sftp://ftp.thesite.com/OUT/ -v -k
> *   Trying 123.456.789.0 :22...
> * TCP_NODELAY set
> * Connected to ftp.thesite.com (123.456.789.0) port 22 (#0)
> * SSH MD5 fingerprint: 4dc2acee06bdaa70fc67412187362428
> * SSH authentication methods available:
> publickey,password,keyboard-interactive
> * Using SSH public key file 'C:\SSH_Public.key'
> * Using SSH private key file 'C:\SSH_Private.ppk'
> * SSH public key authentication failed: Invalid key data, not base64
> encoded
> * Failure connecting to agent
> * Authentication failure
> * Closing connection 0
> curl: (67) Authentication failure
>
>
> I've obfuscated some of the details, but you get the idea.
>
> The main problem seems to be that CURL thinks the Public Key should be
> Base64 encoded.  I'm pretty sure that it is.  It looks like this;
>
>  BEGIN SSH2 PUBLIC KEY 
> B3NzaC1yc2EAAA  ...   4QvuPGkd+ocvyWQ==
>  END SSH2 PUBLIC KEY 
>
>
> As I said, FileZilla works fine with all of this.
>
> Does anyone have any idea what the issue may be?
>
> --
> Pete Hay
> Managing Director
> Foreground Software Limited
> New Zealand
> **
> 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
> **



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

Re: Sheets on Windows

2019-11-19 Thread Kirk Brooks via 4D_Tech
Hey John,
This might help. You pass an object with the various params and it will
open a new window within the bounds of whatever window you call it in.
You can futz with the padding at the top to get it lined up the way you
want.
And looking at it it could be freshened up to dot notation...

//%attributes = {}
  // [ WIN_open_inCurrentWinByObj ]
  // Written (OS): Kirk Brooks  Created: 11/16/12, 15:41:56
  // --
  // Method: WIN_open_inCurrentWinByObj (c-obj) -> longint
  // $1 is c-obj of params:
  //  { window: 0, `default is FrontMost
  //width: 0, ` default is 3/4 window
  //height: 0, `default is 3/4 window
  //type: 0, `  default is Modal form dialog box
  //padTop, padLeft:  pix spaced from top or left border
  //title: "", `window title
  //closeBox: "", ` method to set for closebox
  // Purpose:  open a window within a window.
  //

C_OBJECT:C1216($1;$obj)
C_LONGINT:C283($0)
C_LONGINT:C283($left;$top;$right;$bottom;$height;$width;$type;$padTop;$padLeft;$window)
C_TEXT:C284($title;$closeBox)

$obj:=OB_New
$obj:=$1

  // 
If (OB Is defined:C1231($obj;"window"))
   $window:=OB Get:C1224($obj;"window";Is longint:K8:6)
Else
   $window:=Frontmost window:C447
End if

GET WINDOW RECT:C443($left;$top;$right;$bottom;$window)

  // 
$width:=OB Get:C1224($obj;"width";Is longint:K8:6)
If ($width=0)
   $width:=($right-$left)*0.75
End if

$height:=OB Get:C1224($obj;"height";Is longint:K8:6)
If ($height=0)
   $height:=($bottom-$top)*0.75
End if

If (OB Is defined:C1231($obj;"type"))
   $type:=OB Get:C1224($obj;"type";Is longint:K8:6)
Else
   $type:=Modal form dialog box:K39:7
End if


$padTop:=OB Get:C1224($obj;"padTop";Is longint:K8:6)
$padLeft:=OB Get:C1224($obj;"padLeft";Is longint:K8:6)

If (OB Is defined:C1231($obj;"title"))
   $title:=OB Get:C1224($obj;"title";Is text:K8:3)
End if

If (OB Is defined:C1231($obj;"closeBox"))
   $closeBox:=OB Get:C1224($obj;"closeBox";Is text:K8:3)
End if

  // 
$top:=$top+$padTop
$left:=$left+$padLeft

$right:=$left+$width
$bottom:=$top+$height

  // 

Case of
   : ($type=Modal dialog:K27:2) | ($type=Modal dialog box:K34:2) |
($type=Modal form dialog box:K39:7) | (($closeBox="") & ($title=""))
  $0:=Open window:C153($left;$top;$right;$bottom;$type)
   : ($closeBox="")
  $0:=Open window:C153($left;$top;$right;$bottom;$type;$title)
   Else
  $0:=Open window:C153($left;$top;$right;$bottom;$type;$title;$closeBox)
End case


On Tue, Nov 19, 2019 at 9:20 AM John J Foster via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> 4D v17R5 Mac and Windows (running as engined app)
>
> I love how Mac OS handles windows as sheets. But on windows the same
> window opens centered (I think) in the screen. I’d like to get as close to
> similar behavior as possible.
>
> Before I spend time doing this I am wondering …
>
> Has anyone developed routines (they’d wouldn’t kind sharing) to create a
> similar look and feel on windows? I don’t think we can emulate the
> animation but:
>
> window type - I guess modal without a titlebar
> Top - Placement right below the titlebar
> Centered with top window
> Note: Making sure that other possible sheet windows open above each other,
> etc.
>
> Anyone tried to do this?
>
> Thanks,
> John…
>
> **
> 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
> **



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

Re: Selection Based ListBox - How do I extract and apply values to a single cell?

2019-11-13 Thread Kirk Brooks via 4D_Tech
Hi Bob,

On Wed, Nov 13, 2019 at 9:59 AM Bob Miller via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> The example in the docs doesn't help me understand what you mean about
> using Form with a listbox.
> Can you step through a little example of how Form would help in this case,
> to control a listbox?
>
Happy to try to help.
I recently posted a suggestion for replacing a pretty complex list form,
not a listbox, with a listbox and detail subform. It even has a picture.
https://forums.4d.com/Post/FR/32395457/1/32403208#32403208

I got a lot of useful ideas from the blog:
https://blog.4d.com/display-an-entity-selection-in-a-list-box/
https://blog.4d.com/display-a-collection-in-a-listbox/

A couple of tips I'll pass along that have emerged as being really helpful
for me:

- Think about whatever is in the listbox in terms of the actual data - not
in terms of rows and columns. When you want to select or edit something you
do it in the data and the listbox displays the results. This is almost
completely opposite the way you have done it for years.

- Whatever you are going to display in the listbox if you want to query,
hide, select some of the elements create two references to the data
(collection or entity selection). Something like:

Form.sourceCollection  //  this is the actual data

Form.listboxDisplay//  this is what's displayed in the listbox

You set it up initially by assigning the source to the display:

Form.listboxDisplay:=Form.sourceCollection


Why is this a useful? Let's say I have a big list of names and I include a
search widget. I want to have the listbox show only the elements that match
the search condition. The collection.query() is wonderfully easy. It
returns either a collection (if you query a collection) or an entity
selection (if you query that). So
Form.listboxDisplay:=Form.sourceCollection.query(" name = :1 "; Get edited
text)
puts the result of the query in the listbox.

But this is memory inefficient - you may think. It's not because
Form.sourceCollection and Form.listboxDisplay are references to the data.
Totally different from arrays or selections. Creating multiple references
doesn't significantly increase the memory usage.

BTW - if you allow the user to make changes in the listbox using this
scheme because you are using a reference the changes in the listbox 'flow'
through to the sourceCollection. If you using an entity selection the
changes are made to the entity.


The bottom line is Form and ORDA represent a fundamentally different
approach to presenting data to the user. It's worth spending the time to
learn it. I can do things now with a few lines of code that used to require
multiple methods and dozens (hundreds) of lines of code to accomplish the
same effect.

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

Re: Selection Based ListBox - How do I extract and apply values to a single cell?

2019-11-12 Thread Kirk Brooks via 4D_Tech
Hi Kirk,
What version are you using?

If it's v16 or less think of the tasks you trying to accomplish in terms of
the selection in the listbox instead of the cells.
For the fill down example from the listbox you determine what field
(column) you are working with then apply the changes to that field of the
selection.
To select a record within the selection you use GOTO SELECTED RECORD.
https://doc.4d.com/4Dv18/4D/18/GOTO-SELECTED-RECORD.301-4504918.en.html
To make some change to a subset of the selection you use the set named in
the listbox config, make the edit and then restore the selection.
And so on.

If you are using v17+ I would strongly encourage you to start a brand new
form and use Form and an entity selection for the listbox instead. From
your question I can tell you are working with an unfamiliar mode of listbox
use. If you haven't started learning ORDA and its accompanying new
capabilities this sounds like an excellent application for them. The time
you spend learning to use ORDA will pay dividends moving forward. Learning
about selection based listboxes is only useful if you are working on an old
project that requires them.

On Tue, Nov 12, 2019 at 12:22 AM rooftop99--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All
>
> I feel like a rookie, but here is the deal...
>
> I have used array Listboxes many times with success.  A current project
> requires the use of a Selection based listbox. How do I execute Cell level
> logic?  For example:  Let’s say I want to create a simple “fill down"
> function.  The user highlights several rows and right-clicks a one of the
> cells on the top row, then chooses “Fill down” from the menu presented
> using the command “Pop Up Menu”.  "ListBox Get Cell Position” command gives
> me the row and column plus a pointer to the field clicked on.  With all
> that information how do I get the value of the clicked on Cell (field) so I
> can stuff it in a variable and how do I walk down every row (record) in the
> highlighted selection and apply this value.  In an array Listbox it would
> be simple.  I am missing something in a Selection based Listbox...
>
> I am sure I will slap my forehead and mutter the words, “that is so
> simple, why didn’t I think of it!!” when I hear the answer, but how do I
> reference a single cell (record/field) in a selection based listbox to
> either read values or to write values?
>
> Thanks in advance for your help.
>
> Kirk
>
> **
> 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
> **



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

Re: ListBox - Possible to set choice list programmatically?

2019-11-11 Thread Kirk Brooks via 4D_Tech
Hi Kirk,
I like to create menus the user invokes with a right click for this sort of
thing.

Enable the On click event in the listbox to catch it anywhere in the column
(let's you create a menu with content specific to the cell, column or row
clicked on) or use the On header click event to open the menu on the
header.

With this in place I trap the Contextual click and then draw the menu. For
simple menus I use Pop up menu (
https://doc.4d.com/4Dv18/4D/18/Pop-up-menu.301-4504659.en.html)

For more involved or hierarchical ones I just create, display and release a
menu using the menu commands.

Building even fairly complex menus is amazingly fast. It's easy to write a
method to build and display the menu then return the result to the calling
method.


On Mon, Nov 11, 2019 at 12:43 AM rooftop99--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> When creating a ListBox in the 4D form editor it is possible to select a
> single column and then set attributes for Choice List, Required List, and
> Excluded list.  This creates drop-down menus in each cell of that column.
> When creating a Listbox column programmatically I don’t see a way to set
> these attributes.  Is it possible?  The command “Listbox set Property”
> sets other attributes, but not those three.
>
> Bottomline:  I am looking for a way through code to create an ad hoc
> choice dropdown in a given column of a Listbox object.  How are you folks
> doing this now?
>
> Thanks in advance for your help!
>
> Kirk
> **
> 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
> ******



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

Re: Web Area not visible

2019-11-07 Thread Kirk Brooks via 4D_Tech
Mitch,
Well I confirm that if you enable the web kit and don't have a url the area
is blank.

But if I set and load a url the are appears as expected. And in this
configuration looks exactly the same as running without.

On Thu, Nov 7, 2019 at 12:06 PM Mitchell Shiller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> I could run Chrome on it, but I need to access 4D methods and that
> requires the embedded engine.
>
> Anyone else notice this problem?
>
>  Takes 1 minute to recreate. New dB. Create a form. Put a web area on it.
> Select use embedded engine. Run form.
>
> Just want to know if it is particular to my setup or if it is A 4D bug?
>
> Thanks
> **
> 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
> ******



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

Re: Web Area not visible

2019-11-06 Thread Kirk Brooks via 4D_Tech
Mitch,
The web engine has been changed in 16r2 to Blink.
https://kb.4d.com/assetid=77745

Are you able to run Chrome on this Mac?


On Wed, Nov 6, 2019 at 12:03 PM Mitchell Shiller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> MacOs 12.6
> 4D v17R6
>
> Create a form.
> Put a Web Area on it.
> Open the form and the Web Area is visible.
>
> Same layout. Select “Use embedded Web rendering engine”.
> Open the form and the Web Area is not visible
>
> Any ideas? What am I missing?
>
> Thanks
>
> Mitch
> **
> 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
> ******



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

Re: Edit menu support in ListBoxes

2019-11-05 Thread Kirk Brooks via 4D_Tech
Peter,
I do this with the Contextual click which indicates the user right-clicked.
Catch the On click form event in the listbox and then test for Contextual
click. Then you can easily construct a menu with whatever items you want.
Here are some code snippets

// ($form_object="itemGrid_listbox")

Case of
: (Form event=On Double Clicked)

//  some stuff


: (Form event=On Clicked)

If (Contextual click)  //  popup menu

IG_POPUP

End if

End case

And the IG_POPUP code works like so:


$menu:=Create menu


APPEND MENU ITEM($menu;"Delete selected items")

SET MENU ITEM PARAMETER($menu;-1;"delete")

APPEND MENU ITEM($menu;"---")


$subMenu:=Create menu


APPEND MENU ITEM($subMenu;"Last receivers")

SET MENU ITEM PARAMETER($subMenu;-1;"rep_lastRcvd")


APPEND MENU ITEM($subMenu;"Last pick tickets")

SET MENU ITEM PARAMETER($subMenu;-1;"rep_lastShip")



APPEND MENU ITEM($menu;"Reports...";$subMenu)

RELEASE MENU($subMenu)


If (Not(Is compiled mode))

APPEND MENU ITEM($menu;"---")

APPEND MENU ITEM($Menu;"test")

SET MENU ITEM PARAMETER($menu;-1;"rep_test")

End if


  // 

  // .. user selection ..

  // 


$menu_choice:=Dynamic pop up menu($menu)

RELEASE MENU($menu)


//  handle the menu choice here...


IG_POP builds and displays the menu. The user selection is in $menu_choice
and it's empty for no selection. This is very fast.

For something simple like see:
https://doc.4d.com/4Dv15/4D/15.6/Dynamic-pop-up-menu.301-3818393.en.html


On Tue, Nov 5, 2019 at 10:05 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I would like to implement Edit menu functionality in ListBoxes, where user
> would be able to copy lines and paste it into different listbox. However,
> it seems that 4D handles enabling / disabling of edit menu and I have not
> find a way how it could be overridden.
>
> A workaround would be to do a separate menu bar with edit menu items that
> do not have automatic action associated, and switch it on getting / losing
> focus, but maybe there is a simpler way.
>
> --
>
> Peter Bozek
> **
> 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
> **



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

Re: A use case for C_VARIANT

2019-11-03 Thread Kirk Brooks via 4D_Tech
On Sun, Nov 3, 2019 at 2:21 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> finally, it would be more appropriate to discuss v18 features on the beta
> forums:
>
> https://forums.4d.com/List_Message/JP:0/0/2/1/1/1/14234613/0/0/1/-1/0/0/0/0/0/0
>
You are entirely correct. My bad.


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

A use case for C_VARIANT

2019-11-02 Thread Kirk Brooks via 4D_Tech
The v18 beta introduces a new variable type: variant. Not surprisingly
there is already discussion about what it could possibly be useful for and
why it doesn't have more capabilities. We are who we are.

I have come across a clear case where it's a perfect solution.

Consider a collection of text and null values. Like so:

$tuple_col:=New collection("a";"b";"c";null;null;null;"z")

I want to iterate through the collection and concatenate the values into a
string.

$str:=""
For each ($element;$tpl_col)

If ($element#Null)

$str:=$str+$element

End if

$str:=$str+$delim

End for each


If this code is interpreted and not typed things are fine. As soon as I
declare $element as TEXT it throws an error when I hit a Null. If I declare
it as an object it throws an error when it hits a text. But if I declare
$element as C_VARIANT it's all good.

I suspect something like this is the motivation behind the C_VARIANT data
type to begin with. Otherwise accomplishing this loop would get
complicated. So here in 4D land C_VARIANT solves the problem of how we deal
with a stream of different data types. Like a collection or object
properties.

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

Re: ORDA/Collections

2019-10-30 Thread Kirk Brooks via 4D_Tech
Justin,
The replace string approach is not what you want to do. Editing strings and
mapping data are not the same thing. You also want to avoid hard coding
such maps. Any little change and you have to change code.

A fairly easy way to manage what you need to do is save an entity as a
stringified JSON. Open or paste this into your text editor.
Change the values for each field to the name you need to map it to. Don't
worry about data types or any of that.
Save this file in RESOURCES. Let's call it 'entityMap.json'

To use it:

$map_obj:=JSON Parse(Document to text())

$export_obj:=New object

For each($property;$entity_obj)

If($map[$property]=Null)  //  not mapped

$export_obj[$property]:=$entity_obj[$property]  //  use the existing name

Else

$export_obj[$map_obj[$property]]:=$entity_obj[$property]  //  use the name
you mapped it to

End if

End for each


//   do something with the export object


In this example I'm assuming the entity is a single 'level'. If you have
object fields you need to map as well you would put the testing part in a
method that takes a map and entity object as params. Then you could test
for object fields and pass the object recursively.

The code will work with any table because you have the actual map values
stored in JSON files.

Looking at the example you provided you are going to need to recognize when
you are exporting related entities. The basic idea is the same. I would
make handle each of the related entities a sub loop of the parent. It will
be more robust than including the relations in your parent entity map.

On Wed, Oct 30, 2019 at 1:45 PM Justin Will via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I need a json object output in a particular format and 4D's new datastore
> and collections do this out of the box in 3 lines of code for me.  It's
> almost magical.
>
> $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID)
> $coll:=$oRecs.toCollection("ID, Name, Facilities.ID, Facilities.Name")
> $vtReturn:=JSON Stringify($coll)
>
> The problem I have is the Javascript libraries I'm using that requires the
> data needs the names of the JSON elements to be named in a particular way.
> Is there a way to tell my collection rename ID to key and Name to label etc?
>
> So 4D is currently outputting this.
>
> [
> {
> "ID": 901,
> "Name": "MP",
> "Facilities": [
> {
> "ID": 1159,
> "Name": "MP:North"
> },
> {
> "ID": 1160,
> "Name": "MP:South"
> }
> ]
> }
> ]
>
>
>
> But what I need is this.
>
> [
> {
> "key": 901,
> "label": "MP",
> "children": [
> {
> "key": 1159,
> "label": "MP:North"
> },
> {
> " key ": 1160,
> "label": "MP:South"
> }
> ]
> }
> ]
>
> I know I could just do a replace in string but this feels like the wrong
> way to go at this.
>
> Thanks
> Justin Will
> **
> 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
> **



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

Re: object searching vs Text

2019-10-22 Thread Kirk Brooks via 4D_Tech
Chip,
This might be useful:
https://developer.ibm.com/answers/questions/421044/how-to-write-regular-expression-for-nested-json-ev/

The sentiment in the last post, "...I don't know of a good way. Here is a
bad way that might be enough" is echoed in a lot of the responses to
similar questions I saw on StackOverflow.

It's probably an OK way to simply verify the property is there.

On Tue, Oct 22, 2019 at 8:42 AM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am just getting started playing/using objects.
>
> I wrote some routines to determine if a particular property/value
> exists either in an object, or in an object which is part of an object
> array.
>
> Given:
> - the object is complex, i.e. has 1 or more sub-objects included and/or
> an object array included
> - the only interest is does the property/value pair exist (true/false)
>
> It occurred to me last night, that this processes maybe significantly
> faster, and less complicated, by simply converting the complex object
> to text (JSON Stringify) and then use POSITION to locate the
> property/value pair.
>
> Has anyone looked at this? is using JSON faster? slower? no difference?
> or 'it depends'?
> other comments?
>
> Thanks
> Chip
> We have done so much, with so little, for so long;
> We are now qualified to anything with nothing 
>   - unknown
> **
> 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
> **



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

Re: Determining object content types

2019-10-21 Thread Kirk Brooks via 4D_Tech
Chip,
If you are using v15 OB SET ARRAY can set the native 4D arrays except for
pointers, I think. So if you set a text array you can get a text array
back. But the object property type is not concerned with the array type. As
far as OB GET TYPE is concerned any array is an object array.

In v17 it's treated like a collection. I really never used v16 a lot so I'm
not as familiar with what happens there.

In v17 you should really use collections. The OB SET ARRAY and OB GET ARRAY
methods are really for compatibility at this point. Collections offer so
much more flexibility since each element of a collection can be any type of
data. v15 will handle that but only very deep inside itself. By that I mean
you can import a JSON with a collection of mixed data types and 4D will
handle it but at the program level you can't manipulate or change anything.
In v17 you can.

Having worked with a lot of object arrays in v15 I agree with John that if
you need to search in the array and deal with different data types you will
want to build an object for each element. Something like: { name: "xyz",
value: } is good. This way you can have mixed data
types in the same object array.

Then you can us OB GET TYPE on the object:  OB GET TYPE($obj;"value") ->
whatever the type is.
The only way to search the array is by looping through it.

It's clunky compared to what you can do in v17 but the best approach I
found for v15.

You know I've seen a lot of JS code on other platforms where they tend to
treat anything in a JSON as a text value and type it when it's accessed.
It's not a bad approach.

On Mon, Oct 21, 2019 at 11:00 AM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> John,
> thanks
>
> I was typing a reply, and realized I had not tested something.
> OB GET ARRAY(Object;Property;Object_Array) when the 'object array' is
> not an object array.
>
> if the array in the object is NOT an actual object array, then
> Object_Array is set to the size of the array inside the object, BUT all
> elements are 'undefined'.
>
> so..
> if I find an array, I can extract it into an object array, and if
> element 1 is undefined it is NOT an actual object array, and if element
> 1 is defined then it is an abject array and I can recursively call my
> new find in object array method!
>
> Chip
> On Mon, 21 Oct 2019 12:14:21 -0500, John DeSoi via 4D_Tech wrote:
> > You can't determine the type of the array. I think you can load any
> > type into a text array, but then you would have to convert it. The
> > best option for internal use is to include a property that indicates
> > the type, i.e. use "type" and "value" pairs.
> >
> > John DeSoi, Ph.D.
> >
> >
> >
> >> On Oct 21, 2019, at 11:27 AM, Chip Scheide via 4D_Tech
> >> <4d_tech@lists.4d.com> wrote:
> >>
> >> However, a longint array is NOT an object array, and vise verse.
> >> So how do you determine the type of an array inside an object?
> >
> > **
> > 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
> > **
> We have done so much, with so little, for so long;
> We are now qualified to anything with nothing 
>   - unknown
> **
> 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
> **



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

Re: How one does RELATE MANY with ORDA

2019-10-21 Thread Kirk Brooks via 4D_Tech
Hi Peter,

On Mon, Oct 21, 2019 at 12:32 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am plying with ORDA and LB displaying related records and run into one
> problem: When I delete related record with drop(), entity selection
> accessed through link does not change (probably because documentation says
> that entity stays in memory and is just deleted from disk.)
> I would need to reinitialise linked records by something like RELATED MANY
> commands, but do not see such command in ORDA.
>
and
On Mon, Oct 21, 2019 at 2:55 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> On Mon, Oct 21, 2019 at 9:39 AM Christian Sakowski <
> christian.sakow...@heubach-media.de> wrote:
>
> > Normally, just call entity.reload() to refresh an entity and its
> related selections.
> That would work, but  wanted to avoid that as I would loose changes done to
> the edited record, or loose the record when it is new.


A couple of thoughts. It sounds like you have a situation where you have
something like an old-school input form: form is displaying a single record
with a listbox showing some child records. When the user deletes a child
record you want the listbox to refresh to show the updated selection. And
the reason you don't want to use entity.reload() is because this would
compel saving changes to the parent/new record. Have I got that right?

My first thought is why would you allow the user to delete a child record
and NOT save the parent? Just wondering what makes that a problem. (And -
yes I did just ask the equivalent of "why would you want to do that?")

Next, you could wrap the editing process in a transaction. I haven't tried
to see if .reload() respects the state of the transaction but I expect it
to. This isn't my preferred way of handling this sort of thing but it's an
option.

Another thought is to manage the selection of child records manually. It's
trivial to set up and would accommodate the situation of saving/deleting
child records independently of what happens on the parent. There's no rule
that says you _have_ to use the relation in the entity and no penalty for
not using it. You could move the related selection to a collection for
editing/display too.

Yet another thought is to abstract the editing to the equivalent of a
variable and edit the variable. You can use the .toObject() method to
change the contents of a record to an object. This gives you total
flexibility without the overhead of a transaction. Your edit form could
have Form.displayRecord which is this object. For a new record you can use
entity.FromObject(Form.displayRecord). If you use UUIDs for the primary key
you can assign it to the object and then use it as the actual PK. To update
an existing object you will need to loop through the properties. It's an
extra step but gives you very fine control over what gets saved when.

Just some thoughts. ORDA makes it incredibly easy to put data on the screen
in any number of ways.

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

Re: Compiling for Windows and Mac

2019-10-18 Thread Kirk Brooks via 4D_Tech
Chuck,
Nope. Compiled is compiled for either platform. As Miyako said you could
indicate if you wanted 64 bit and there is the question of the variable
definitions but aside from that 4D is wonderfully agnostic with regard to
platform - at least at this level.

On Fri, Oct 18, 2019 at 2:47 AM Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am confused when you are running on a windows server.  I thought you had
> to co pile on windows. I know that if you are building server and clients
> that is true. What is also true is that you have to build the first Mac
> client on a Mac and the first windows client on a pc. Once you have done.
> That you can include both in your built server and allow for automatic
> updates
>
> Regards
> Chuck
>
> On Fri, Oct 18, 2019 at 1:51 AM Paul Lovejoy via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Thanks!
> >
> > Paul
> >
> > > On 18 Oct 2019, at 06:17, Keisuke Miyako via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >
> > > that's basically right,
> > >
> > > v11 was the last version that supported i386 and ppc.
> > > the label back then was "Compile for PPC and Intel processors (Mac
> Intel
> > and Windows)"
> > >
> > > http://library.4d-japan.com/REFERENCE/v11/4D_v11_Design_Ref.pdf
> > >
> > > ---
> > >
> > > stating with v12, we have the option to "also compile for 64-bit"
> > > for a while we could compile for 64-bit in addition to 32-bit (no
> option
> > to drop 32-bit, since Windows clients and Mac are 32-bit)
> > > at the time, 64-bit implicitly meant Server, Windows.
> > >
> > > starting with v15 we have 64-bit version for Mac.
> > > this time the compiler was updated to generate code that could work for
> > 64-bit on both platforms,
> > > so there was no need to mention the platform for compilation.
> > >
> > > and then, finally with 17R5 we no longer have 32-bit support.
> > >
> > >> 2019/10/18 12:44、Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com>のメール:
> > >> I can no longer find the option to compile for both platforms. Is this
> > no longer necessary or am I missing something. Is it the same object code
> > regardless of OS, since they’re both Intel processors?
> > >
> > >
> > >
> > >
> > > **
> > > 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
> > **
>
> --
>
> -
>  Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
>  Informed Solutions, Inc.
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D, Sybase & SQL Server connectivity
>   https://www.informed-solutions.com
>
> -
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption from
> disclosure as to this communication.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



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

Re: 4D Server Hosting - The Future ?

2019-10-12 Thread Kirk Brooks via 4D_Tech
Hey Rudy,
I made a post yesterday on the thread about preemptive processes and how it
works on VM. Ping me if you can't find it. You may find it useful because I
posted some actual data from running a demo you can download. I ran it on
my laptop and an AWS instance. The general specs of the AWS instance are
there too. It shows the sort of differences I've been seeing. It seems the
issue with AWS is partly the sheer horsepower you sign up for in terms of
cores and such but equally important is the amount of bandwidth you commit
to. Impacts the performance and cost quickly.

I'm hoping someone with more expertise in this might join the conversation.
(Balinder? you out there?) It's almost good for directly connecting. I
think if you are running 4D to power a web server it's quite good. Also, I
think if you deploy there optimizations you can make in code to
accommodate the network will become apparent. I quickly saw that places
where I move data from the server to the client and manipulate it on the
client are very speedy. ORDA is probably going to help with that. I'm also
curious if you can set up a situation that cost effective where you run an
instance for the server and then some others to support clients using RDP
or the like.

It is certainly appealing.

On Sat, Oct 12, 2019 at 2:28 PM Two Way Communications via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk,
>
> I am very interested on your progress with AWS. Can you tell me a little
> bit more about the kind of 4D DB you are running on it?
> Are you running client/server or using SQL? Do you notice speed
> differences between ORDA / Classic 4D?
>
>
> I’m asking because I am currently using AWS myself. The response is quite
> ok, but still way slower than LAN client server.
> I am thinking of putting more 4D databases on AWS.
>
>
> Regards,
>
> Rudy Mortier
> Two Way Communications bvba
>
>
>
> > On 10 Oct 2019, at 17:09, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Peter,
> > I am in the process of moving a database from our own hardware to and AWS
> > instance. It's true that the most expensive part of setting it up, at
> this
> > point, is getting the appropriate amount of band width and throughput
> speed.
> >
> > 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. So preemptive threading is looking to be mainly a benefit for
> > companies that run their own hardware and for desktop apps.
> >
> > On Thu, Oct 10, 2019 at 5:25 AM Peter Jakobsson via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> 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 ser

Re: Make me smart about Write Pro

2019-10-12 Thread Kirk Brooks via 4D_Tech
Tom,

On Sat, Oct 12, 2019 at 12:47 PM Tom Benedict via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Another key concept to be aware of when working with Write Pro is that is
> that features are additive. In Write Classic all its features were
> available by default and you had to restrict or remove features as needed
> via code. In Write Pro only the most basic features are available by
> default leaving you to add the ones you want, via code.
>
Thank you for that tip.


> There is lots of documentation for Write Pro. Unfortunately it is spread
> through the 4D Write Pro Reference, 4D Language Reference, 4D Design
> Reference, 4D Tech Notes and the 4D Blog. You may wish to spend a few days
> (or weeks) browsing the various resources before you begin.
>
True and true. That's why I thought I'd start this discussion, to try to
get a sense of where to start.

I re-watched Caroline's preso from the 2018 Summit (on the blog
<https://blog.4d.com/your-imagination-is-the-limit-with-4dv17-and-4d-write-pro/>).
That's giving me a place to start. I was actually there for it but didn't
appreciate what her demo actually accomplished until I started attempting
it myself. Hence her comment after the demo runs and the room is quiet:
"Hey, that's pretty good isn't it?" In fact it is.

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

Re: 4D Server Hosting - The Future ? & Using Github to Manage Distributed Development

2019-10-11 Thread Kirk Brooks via 4D_Tech
Hi JPR,
i'm glad the 'Bat Signal' still works.

On Fri, Oct 11, 2019 at 1:34 AM JPR via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Do you like Fairy Tales?
>
I thought that was the demo...


> > So what you are saying is that if you are deploying 4D Server in a VM
> there is not need to try and use preemptive mode. You get no benefit from
> doing that. It’s a waste of time?
> Wrong. It will be a benefit in terms of speed, even not as large as you
> dream, because the system will optimise the use of each possible core. And
> a benefit in term of smoothness of execution, because no process will
> freeze the others.
>
OK - but assuming I'm running on a VM isn't that speed and usability
benefit coming from moving the processing into a Worker?


> > The whole benefit of preemptive mode is to allow 4D to assign a process
> to a core.
> Wrong. What I explained is that 4D does NOT assign a process to a core,
> but assigns a process to a THREAD, and the System assigns cores to Threads.

And once more I display my sketchy understanding of how the hardware works.


> > But in the case of a VM the actual, physical cores are managed by the VM.
> Wrong. The VM talks to the System, and the System manages cores. In fact,
> just imagine that a machine can run several VM at the same time.
>
Ibid.

If you have been at the 2019 Tour, remember J_OtherObjects example, where I
> show that if you use cooperative processes, with one executing an
> excruciating method, then the Forms on use are kind of frozen. Then, by
> switching to preemptive mode, the same awfully blocking method doesn't
> impact on interface while running.
>
True (in fact I just pulled it out to look at again). But we are running
that on our machines where the _threads_ can be assigned by the _system_ to
various cores and I can see that in the activity viewer. In fact running on
'bare metal' shows a lot of variation in the activity of the various cores.

I went rummaging around in the knowledgebase to see if I could find what
I'm remembering. I think it was one of the keynotes from the '16 Summit and
I couldn't find it. But I did find Laurent Ensault's session on the
subject: https://kb.4d.com/assetid=77547

I rewatched it and ran the example database. The demo spawns 4 cooperative
and 4 preemptive processes then runs an intensive method 1mil times in
each.

I made a small change to his demo - I added the start and end ticks to the
process record in addition to the duration. Why? Because I wanted to see
the total time spent on processing the 'job'. I do this by taking the end
of the last process to finish and subtracting the start of the first
process to begin. I also moved the demo db to v17.3.

As luck would have it I have an AWS instance with v17.3 installed so I am
able to run the demo locally and on AWS.
On my laptop:

Cooperative 1: 376 ticks
Cooperative 2: 376 ticks
Cooperative 3: 375 ticks
Cooperative 4: 367 ticks

Total run time:  395 ticks


Preemp 1: 118 ticks
Preemp 2: 119 ticks
Preemp 3: 117 ticks
Preemp 4: 119 ticks

Total run time:  119 ticks  //  that's what we want to see!


On AWS:

Cooperative 1: 740 ticks
Cooperative 2: 706 ticks
Cooperative 3: 793 ticks
Cooperative 4: 731 ticks

Total run time:  821 ticks


Preemp 1: 881 ticks
Preemp 2: 824 ticks
Preemp 3: 857 ticks
Preemp 4: 848 ticks

Total run time:  881 ticks

Your first thought might be, "hold on, why is the total run time almost the
same as each process' run time?" The very first line of the method sets a
variable with the tick count. Because Laurent included the IDLE command in
the demo method those methods yield the processor back to 4D on each
iteration. (The video talks about the details on this.) So Coop1 starts and
then yields back to 4D which starts Coop2 and so on. In contrast Preemptive
processes simply start and run without having to 'yield back' to 4D.

So what we see is that each them gets started pretty much at the same time
and complete pretty close together as well. This probably wouldn't be the
case if they weren't doing exactly the same work and if 4D were actually
working instead of doing a demo. Total run time, as I said, is the tick
count for the last process to finish minus the tick count of the first one
to start. Or the total amount of time spent processing by all 4 processes.

This illustrates the point I recalled from back then: when you run on a VM
the advantage of the the OS to distribute threads to the actual cores is
abstracted away. They may be distributed to virtual cores but that doesn't
impact the total processing time. In the case of AWS apparently this VM
overhead actually causes it to run slower but this is a small sample set. I
have no idea why and frankly don't have the expertise to figure it out. But
it's there.

FYI - the AWS instance is an m5ad.xlarge: 4 cores, 16gb RAM. It sorta
sucks. I'd love to hear from anyone actually running 4D server on A

Re: Using Github to Manage Distributed Development

2019-10-10 Thread Kirk Brooks via 4D_Tech
ng to simplify).
> >
> > Regards,
> >
> > Narinder Chandi,
> > ToolBox Systems Ltd.
> >
> > I am available for new consulting opportunities…
> >
> http://4d.1045681.n5.nabble.com/ANN-4D-Developer-Available-td5765443.html
> > --
> >
> > -Original Message-
> > From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech
> Mailing List <4d_tech@lists.4d.com>
> > Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
> > Date: Thursday, 10 October 2019 at 18:42
> > To: 4D Tech Mailing List <4d_tech@lists.4d.com>
> > Cc: Tom Benedict 
> > Subject: Using Github to Manage Distributed Development
> >
> >In my current environment, each developer works on a separate
> copy of a “Master" 4D structure. Periodically each developer runs the
> "Export structure file” command to export everything (methods, forms etc)
> to local disk. Then they compare those files using a diff tool (Examdiff in
> our case) against a folder full of files exported from the "master” copy of
> the 4D structure. The diff tool shows us what methods/forms/etc are
> different. The developer then uses that list as a guide and, with both the
> local 4D structure open and the “master” 4D structure open, copy/pastes or
> ‘moves’ the edits from local to master.
> >
> >We would like to move this process to Github. I’ve tried, but
> have not been able to map the Git concepts to my existing process. Is
> anyone using Github with 4D in this way? If so, could you describe your
> workflow?
> >
> >BTW, I’ve read the Tech Note about 4D on Github, but it looks
> like it is focused on using Project Mod. I also read Thomas Maul’s post <
> https://forums.4d.com/Post/EN/30825681/1/3056#30825682> about his
> component which will commit methods to Github. I’m also aware of Lutz
> Epperlein’s use of VC Framework. None of those matches my current workflow.
> >
> >Thanks for any help.
> >
> >Tom Benedict
> >
> **
> >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
> >
> **
>
>
>
>
> **
> 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
> **



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

Re: 4D Server Hosting - The Future ?

2019-10-10 Thread Kirk Brooks via 4D_Tech
Hey Tim,

On Thu, Oct 10, 2019 at 10:43 AM Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> So what you are saying is that if you are deploying 4D Server in a VM
> there is not need to try and use preemptive mode. You get no benefit from
> doing that. It’s a waste of time?

That's what I got. Thomas showed a demo app he wrote deployed on AWS or the
like and using a lot of cores (32?). But it did not improve the overall
processing time. The reason being, as I understand it, the whole benefit of
preemptive mode is to allow 4D to assign a process to a core. But in the
case of a VM the actual, physical cores are managed by the VM. It really
couldn't be otherwise and support all the cool stuff that makes the VM
attractive.

I don't know that makes preemptive a waste of time but it does mean you
need to think about where your db will be running to decide if it's worth
the effort to implement it.

On the other hand this means that in a VM environment CALL WORKER is pretty
much as useful and a lot less hassle.

It would be interesting to know if preemptive is something that can be
called for a local process on a client machine. Now _that_ would be pretty
handy. Ask JPR when you chat with him.

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

Re: 4D Server Hosting - The Future ?

2019-10-10 Thread Kirk Brooks via 4D_Tech
Peter,
I had a discussion with Tim Nevels on another channel about this last week
too. He's a big fan and maybe will weigh in here. I will not miss having to
make a trip to the colo to change an SSD that died. (Hint: mirrored SSDs so
you don't have to do that in the middle of the night.) It is kind of
interesting that we are moving back to the topology the industry started
with - what's the difference between a 'main frame computer' and 'cloud
computing'?

On Thu, Oct 10, 2019 at 8:23 AM Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

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



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

Re: 4D Server Hosting - The Future ?

2019-10-10 Thread Kirk Brooks via 4D_Tech
Peter,
I am in the process of moving a database from our own hardware to and AWS
instance. It's true that the most expensive part of setting it up, at this
point, is getting the appropriate amount of band width and throughput speed.

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. So preemptive threading is looking to be mainly a benefit for
companies that run their own hardware and for desktop apps.

On Thu, Oct 10, 2019 at 5:25 AM Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

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



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

Re: File Decoding: EBCDIC

2019-10-07 Thread Kirk Brooks via 4D_Tech
Hi Bob,
This was an interesting topic to look up. That data must be coming from a
company running some very old main frame. If you haven't already looked at
the Wikipedia entry for EBCDIC it's both informative (this goes straight
back to punch cards) and humorous. https://en.wikipedia.org/wiki/EBCDIC

If I were you I'd try this product: https://www.vedit.com/try-buy.html
If it works tell the client to buy and it and task one of their folks to do
the conversion and verify the data are OK for import. Apparently there is
no hard and fast rule for handling all the encodings - just a general
consensus. I would be careful of putting myself in the line of fire there.


On Mon, Oct 7, 2019 at 5:53 AM Bob Miller via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hello,
>
> I have a project where sales data is being sent to an FTP site and I'm
> picking it up and importing into 4D.  The latest dataset comes from Asia
> Pacific and is stored as a double byte character set in EBCIDIC format.  I
> need to somehow open this and convert it back to the source character
> base, which is Simplified Chinese.
>
> I have no idea where to start with this; any ideas would be most welcome!
>
> Thank you,
>
> -Bob Miller
> Parker Hannifin Corp.
>
> ll
> "PLEASE NOTE: The preceding information may be confidential or privileged.
> It only should be used or disseminated for the purpose of conducting
> business with Parker. If you are not an intended recipient, please notify
> the sender by replying to this message and then delete the information from
> your system. Thank you for your cooperation. Parker Hannifin Corporation
> and its subsidiaries, affiliates and associated companies ("Parker")
> process personal data in accordance with Parker’s Personal Data Privacy
> Policy which may be accessed from www.parker.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
> **



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

Re: v15 - Array Object and Append array

2019-10-03 Thread Kirk Brooks via 4D_Tech
Chip,

On Thu, Oct 3, 2019 at 1:55 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ok..
> why does this not work???
>
> in a loop
> For ($i;1;$Column_Count)
>   INSERT IN ARRAY($Columns;1)
>   OB SET($Columns{$i};)
>

You said you wanted to append an array so you would use:
OB SET ARRAY($Columns{$i};"arrayName";$theArray)

or you create an object and append that as 

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

Re: v15 - Array Object and Append array

2019-10-03 Thread Kirk Brooks via 4D_Tech
Chip,

On Thu, Oct 3, 2019 at 1:26 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> is it possible to use append array with an object array?
>
No. But you can with collections.

To accomplish what you are describing you would need to create an object,
set the array to the object and then append the object to the object array.

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

Re: Web aficionados - Not allow user to access file directly

2019-10-01 Thread Kirk Brooks via 4D_Tech
Randy,
On Tue, Oct 1, 2019 at 9:05 AM Randy Engle via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Most of our customers are resistant to proxy servers
> They think that we should be handling all of it.
>
Are these the same guys who do such a great job protecting themselves from
ransom ware?


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

Re: Web aficionados - Not allow user to access file directly

2019-10-01 Thread Kirk Brooks via 4D_Tech
Hey Randy,
The optimal way to achieve this is to set up the website with a different
web server functioning as the node publicly exposed to the internet. That
server deals with all the authentication and heavy protection stuff 4D
isn't very good at and communicates with your 4D server via API calls. Your
4D server can be locked down to only talk with something coming from a
specific IP address (the front facing server) on a specific port.

If you can't do that the 4D server will statically serve any pages in the
web folder with the one you identify as the index page being the default.
If you set the default page to a non-existent page, xxx.html for instance.
In this case

"The On Web Authentication Database Method is automatically called,
regardless of the mode, when a request or processing requires the execution
of a 4D method. It is also called when the Web server receives an invalid
static URL (for example, if the static page requested does not exist)."
https://doc.4d.com/4Dv17R5/4D/17-R5/On-Web-Authentication-Database-Method.300-4127485.en.html


So you can intercept and validate using On web auth. If you do nothing in
On web auth the request flows to On web connect. I generally deal with the
requests there.

You can use the scheme of serving web pages stored elsewhere and/or
construct the response in code. At this point you are really building and
API more than a web server - which I think is a good thing.

If you are going to use 4D code to actually construct html pages I really
encourage building the html as templates (stored outside the web folder).
Use Process 4D tags to populate them with data you develop in code. I find
attempting to construct anything more than the most trivial html in 4D code
the path to long hours and great unhappiness.


On Tue, Oct 1, 2019 at 8:38 AM Randy Engle via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi Web Experts,
>
> I don't want the web users to access html files directly, without going
> through ON WEB CONNECTION.
>
> e.g.
>
> http://myweb/foobar.html
>
> If "foobar.html" exists in the web folder, Users can put in this in the
> address and it will pull up the web page, but will not process the 4D Tags,
> etc.
> Very, very funky.
>
> So, I'm probably being a dope, but does anyone know what I can do to
> prevent accessing html files directly?
>
> Gracious thanks
>
> Randy Engle
>
>
> **
> 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
> **



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

Re: Another splitter question

2019-09-25 Thread Kirk Brooks via 4D_Tech
Piotr,

listbox_1  |  listbox_2  |  listbox_3

listbox_1:  horizontal resize = grow; vertical resize= grow (I assume)
splitter_1:  horizontal resize = none; vertical resize= grow
listbox_2:  horizontal resize = grow; vertical resize= grow
splitter_2: horizontal resize = none; vertical resize= grow
listbox_3: horizontal resize = grow; vertical resize= grow

Notes:

Be sure the splitters start before the top of the listbox and end after the
listbox. It won't work if the splitters are not longer, at least by a pix
on each end. At least in my experience.

You won't be able to size the listbox smaller than the layout in the form
editor.




On Wed, Sep 25, 2019 at 1:05 AM Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> I have a form with three listboxes on it, with in between 2 vertical
> splitters
>
> I want to accomplish the following, preferably only by setting object
> properties :
> When I move the left splitter the left listbox must size, the middle
> listbox + right splitter must move, and the right listbox must size
> When I move the right splitter the middle and right listbox must size (the
> left splitter + listbox must stay as is)
>
> I am having troubles to find a (good) way to accomplish this
>
> Anybody any tips?
>
> Gr,
> Piotr
>
> **
> 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
> ******



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

Re: Custom Notepad++ Editor Style for 4D?

2019-09-25 Thread Kirk Brooks via 4D_Tech
Tom,
Miyako wrote such a thing for Atom. You can search for it in the Atom
add-ins area.

On Wed, Sep 25, 2019 at 7:51 AM Tom Benedict via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Does anyone have a custom User Defined Language for NotePad++ for 4D HTML
> pages?
>
> I’d like to have 4D Tags displayed as code rather than comments. Has
> anyone created such a thing? If not, maybe there are other editors which
> are preferred for creating and maintaining 4D web sites?
>
> Thanks,
>
> Tom Benedict
> **
> 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
> ******



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

Re: FYI: 4D-Objects - Embedded Objects --> Save as file

2019-09-24 Thread Kirk Brooks via 4D_Tech
Tim,

On Tue, Sep 24, 2019 at 2:32 PM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> On Sep 24, 2019, at 8:00 PM, Kirk Brooks wrote:
> > Do you have to Base64 encode the picture to store it in the JSON file?
>
> I would PICTURE TO BLOB and then BASE64 ENCODE the blob to create a text
> representation of the picture. Reverse the process to bring it back.


I suppose that would work for just about any kind of document wouldn't it?

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

Re: FYI: 4D-Objects - Embedded Objects --> Save as file

2019-09-24 Thread Kirk Brooks via 4D_Tech
Tim,
Do you have to Base64 encode the picture to store it in the JSON file?

On Tue, Sep 24, 2019 at 10:28 AM Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Picture object properties only store a reference to the picture, hence the
> “[object Picture]” property value. JSON Stringify command does not encode
> picture properties, you have to do that. You can write a wrapper method for
> JSON Stringify and JSON Parse to handle this situation if you need to do
> this often.


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

Re: [v17.3] - Clear 4D-Oject

2019-09-24 Thread Kirk Brooks via 4D_Tech
On Mon, Sep 23, 2019 at 11:42 PM Christian Sakowski via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> > I thought that only clears a reference to the object, not the object
> itself.
>
> Depends,
>
> if the ref-counter goes to 0, the object itself will be cleared too.
>
That's why I prefer Wayne's suggestion of using New object. Or setting it
to null.
But the lesson here is keeping in mind exactly what it is you are trying to
do.

$root:=New object("a";100;"details";New object("b";200;"c";"foo"))
$child:=$root.details
$child.d:="bar"  // root: {a:100,details:{b:200,c:foo,d:bar}}
CLEAR VARIABLE($root)  // $root = null; $child: {b:200,c:foo,d:bar}

 // 
$root:=New object("a";100;"details";New object("b";200;"c";"foo"))
$child:=$root.details
$child.d:="bar"  // root: {a:100,details:{b:200,c:foo,d:bar}}

$root:=New object  // $root = {}; $child: {b:200,c:foo,d:bar}

In both cases $child persists because the object itself ($child) exists
with its own ref counter. This may or may not be what you want.
What do you think happens when $child:=New object?

 // 
$root:=New object("a";100;"details";New object("b";200;"c";"foo"))
$child:=$root.details
$child.d:="bar"  // root: {a:100,details:{b:200,c:foo,d:bar}}

$child:=New object  // $root = {a:100,details:{b:200,c:foo,d:bar}}; $child:
{}

How the hell do I make $child and $root.details be empty? Maybe:
   // 
$root:=New object("a";100;"details";New object("b";200;"c";"foo"))
$child:=$root.details
$child.d:="bar"  // root: {a:100,details:{b:200,c:foo,d:bar}}
$root.details:=New object // $root = {a:100,details:{}}; $child:
{b:200,c:foo,d:bar}

Why doesn't $child become empty? It's in the docs: "... New object creates
an empty object and returns its reference." $root.details contained a
reference, because the data are actually stored and managed by 4D, to the
object created by the first call to New object. Next I assigned $child the
reference to that same object. So its ref count is now 2. When I
call $root.details:=New object a new ref is created and assigned to
$root.details. This also lowers the ref count for the original object from
2 to 1. Because the ref count is not 0 the data persists and so $child,
which actually is a reference to the original object, still 'has' the
data.

This is what we encounter when using Storage too. Each object has to be
tracked with respect to its ref counter. That's why it's so fussy about
only allowing other shared objects to mingle.

This is a much different way of thinking about data outside of records and
fields or variables. In those cases the object is the data, as it were. And
this makes a strong case for scoping objects as local vars as much as
feasible because when a method ends the local vars are destroyed and any
references assigned only to local vars are cleared.

Here's a final take on this example. In this case let's define $child first:
   // 
$child:=New object("b";200;"c";"foo")
$root:=New object("a";100;"details";$child)
$joey:=$root.detailswhat's the ref count on $child now?

$joey.d:="bar"  // root: {a:100,details:{b:200,c:foo,d:bar}}

For each ($prop;$root.details)

OB REMOVE($root.details;$prop)

End for each
// $root: {a:100,details:{}}  , $child: {},  $joey: {}

I hope this helps. It's been a real challenge for me to get the hang of how
references work and I don't profess to be an expert at it.

BTW - I did those examples in 17r6 but they should be the same in any
previous version.

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

Re: v17r6 Entity-Selection ListBox — how 'SELECT ALL'?

2019-09-23 Thread Kirk Brooks via 4D_Tech
Chris,
Have a look at these commands:

entitySelection.and( )  - intersection
entitySelection.or( )  - union
entitySelection.minus( )  - difference
entitySelection.add( )
entitySelection.minus( )


For working with a listbox like you are I will have two 'versions' of the
entity selection:

master  - this is the version created by the query or whatever other method

display - this is a different entity selection that is a reference to the
master

The idea is you put the display in the listbox. Showing and hiding become
easier as many of (if not all) the operations we want to use to manipulate
the displayed list produce a new entity selection.

This is a place where working with references really shines. Using this
approach in classic 4D we would be duplicating the data whereas here we are
simply manipulating references to it.

On Mon, Sep 23, 2019 at 4:37 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> CB:  typo: on “Show” the   .and( ) basically makes the .es = to the
> .es_Selected [but they are not the same entity selection].
>
> —
>
> > On Sep 23, 2019, at 4:35 AM, Chris Belanger 
> wrote:
> >
> > I have a listBox with an Entity Selection as its dataSource.
> > I want to support standard ‘set manipulations’ such as   HIDE,  SHOW,
> SHOW ALL,  SELECT ALL [yes, I realize these are not 4D sets, but
> collections…terminology…]
> >
> > Given that:
> > Form.es  = entity selection displayed in the ListBox
> > Form.es_Selection = “Selected Items” in the listbox
> >
> > I am able to easily HIDE or SHOW the "Selected Items”
> > : ($1.parameter="Hide")
> >   Form.es:=Form.es.minus(Form.es_Selected)  // remove the
> selection
> >   Form.es_Selected:=Form.es.getDataClass().newSelection()
> // change this to a NEW BLANK selection
> >
> > : ($1.parameter="Show")
> >   Form.es:=Form.es.and(Form.es_Selected)  // remove the
> selection
> >   Form.es_Selected:=Form.es.getDataClass().newSelection()
> // change this to a NEW BLANK selection
> >
> >
> > but “SELECT ALL” is giving me issues.
> > I can easily set the ‘Selected Items’ to be the same as the Entity
> Selection
> > Form.es_Selected:=Form.es.or(Form.es_Selected)  // select all the
> records
> >
> > but even though this makes the ‘Selected Items’ the same as the entity
> selection. It is not reflected in the appearance of the listBox (i.e. all
> rows are NOT selected as desired)
> > I also tried:
> > INVOKE ACTION(ak select all) — no affect
> >
> > also tried:
> > Form.es_Selected:=Form.es.or(Form.es_Selected)  // select all the
> records
> > Form.es:=Form.es  // cause a re-draw — BUT IT DOESN’T!
> >
> > 
> > So does anyone know how to simulate   SELECT ALL in a listbox that has
> an entity Selection as a datasource?
> >
> > thanks,
> > Chris
>
> ******
> 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
> **



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

Re: 4D Object To BLOB/TEXT/Document

2019-09-17 Thread Kirk Brooks via 4D_Tech
Jorg,

JSON Stringify converts an object into plain text. So you can use:

TEXT TO DOCUMENT($docPath;JSON Stringify($myobject))


The syntax of Object Tools is very similar to 4D's. Not the object notation
part but the basic OB SET and OB get. I have converted lots of methods
using my text editor and a couple of regex patterns.

On Mon, Sep 16, 2019 at 11:51 PM Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> G'day All,
>
> Does someone has a solution to save a 4D Object somehow to a file?
>
> I like to be prepared for a dark future without Aparajita's ObjectTools.
>
> Thanks
>
> Cheers
> Jörg
>
> **
> 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
> ******



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

Re: More on 4D Objects and 'Inheritance'

2019-09-16 Thread Kirk Brooks via 4D_Tech
Well gee, what does Aparajita know about object oriented stuff? 樂

Nicely put.

On Mon, Sep 16, 2019 at 1:23 PM 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 <
> 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
> **



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

Re: More on 4D Objects and 'Inheritance'

2019-09-16 Thread Kirk Brooks via 4D_Tech
Peter,
On Mon, Sep 16, 2019 at 1:58 AM Peter Jakobsson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The key is the new “This” self-referencing function because it now lets
> you create an active object as a class.

It does.


> I realise OO purists may not regard it as a class,

They do not.


> Immense !
>
I agree.

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)))
>
To expand on the options here:
You can put that code into a method which returns the new object:

$animal:=Animal_obj

// Animal_obj

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


New Formula can call, and pass parameters to, a method.

// Animal_obj

C_TEXT($1;$2)

$animal_obj:=New object
$animal_obj.type:=$1
$animal_obj.name:=$2
$animal_obj.goodBoy:=null  // boolean
$animal_obj.color:=null // text

$animal_obj.talk:=New Formula(f_animal_getTalk)
$animal_obj.setGoodBoy:=New Formula(This.goodBoy:=$1))  //  what?
$animal_obj.setColor:=New Formula(This.color:=$1))

$0:=$animal_obj

// f_animal_getTalk

case of
  :(This.type="dog")

...

:(This.type="cat")

...

end case


This is a trivial use of formulas but illustrates a couple of points.
First, note the way the $1 param is handled. First, I pass in the
initialization params. You can also make these an option. In the
method Animal_obj is a text value. Later on I pass "$1" in as a boolean.
This compiles just fine. 4D sorts it out internally. So you can pass
multiple params of varying types to the formulas.

BTW, when a method returns an object you can address the properties
directly from the method. Eg:

$name:=Animal_obj("Fido";"dog").name  //  $name = "Fido"


Being able to use methods as New Formulas is very powerful. Methods run in
the context of an object formula have access to This. So cool.

Another use I am liking a lot is to put an entity reference is an object
with some formulas. Let's imagine a PERSON table.

// Person_obj (person id)

$person_obj:=New object
$person_obj.id:=$1

$person_obj.data:=ds.PERSON.get($1)  // get a reference to the entity

$person_obj.getLastEmail:=New Formula(f_person_getLastEmail)
$0:=$person_obj

//  f_person_getLastEmail

some complicated procedure to look up the last email

$0:=LastEmail


And so on. You could write more methods to the object to retrieve common
values for Person. This can be handy when the paths to those values, in the
.data property, are related in complex ways. For myself I try to keep the
processing and look ups in these methods pretty simple and light. Heavy
queries, manipulations and calculations are best done outside this context.

 Not everyone is a fan and there are some good arguments to be made. One I
received on another channel after I posted some of these ideas:

Well my recommendation is not to use New formula ever. 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. 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. 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.
2) Safe to use and relatively performant. 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, and even then, time consuming to maintain.


Another thing I've noticed is there is a processing overhead involved. I
see it in both compiled and interpreted uses. For anything having to do
with the UI I don't hesitate to build objects like this. The benefits are
great and the overhead unnoticeable. I tried applying it in another case
where there was no UI and a lot of processing in loops. It was slow. I'm
using the beta versions for that stuff so it may be better when it's
actually released. I say that because I suspect the overhead has to do with
whatever internal mechanism 4D uses to manage the references and I expect
it to get better as it's used more. But for now YMMV.

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

Re: Shared objects and collections

2019-09-14 Thread Kirk Brooks via 4D_Tech
Hi Jim,
I haven't worked with Storage very much because frankly it's a pain and
it's slow. I get why it's a pain and has so much overhead. Every single
object has to have its own lock/unlock ('locker') mechanism and it works
between preemptive processes. So cool for that - no small thing. For me
it's good to keep it as flat as possible and limited to data that's likely
to be actively manipulated in the other processes. I figured this out the
first time I attempted to put a smalish collection of objects into Storage.
Not a good use case, in my opinion.

Otherwise I'm coming back to the liking a single IP object var for storing
essentially read-only data. If you don't have a situation where multiple
processes are likely to be hitting on it, like this sounds, it works fine.
If I need to make the data accessible to a preemptive process write it to
disk and read it into the process. I find TEXT TO DOCUMENT, which is thread
safe, pretty fast.


On Fri, Sep 13, 2019 at 9:33 PM Jim Crate via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> On Sep 9, 2019, at 9:55 PM, Keisuke Miyako via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> >> So it looks like you can’t .push() a shared object onto a shared
> collection.
> >
> > not quite.
> >
> > a shared object is either single (solo) or multiple (once belonged to a
> group)
> > if an object joins a group, it is free to leave it, but it can't join
> another group.
> > [snip]
> > in your case, the problem is that you add $sharedObj to $catalogObj,
> > then $catalogObj to Storage.
> >
> > if you reverse the order, that is,
> > add $catalogObj to Storage first,
> > then $sharedObj to $catalogObj later,
> > it should work.
>
> $catalogObj is a sub-object from the results of an API call with HTTP Get.
> So it is an existing non-shared object (I.e. not manually created with keys
> and values by 4D code). I want to add that object to a shared collection so
> it can be put into Storage.
>
> The only reason $sharedObj exists is because I need to copy all attributes
> of $catalogObj to $sharedObj so I can add to a shared collection. (Note: I
> had an error in the first code snippet below; $sharedObj should have been
> assigned a New Shared Object.)
>
> If I use the code in the reference KB article, copying the non-shared
> $catalogObj to a new shared object $sharedObj, I can’t add $sharedObj to
> the shared collection. Presumably I could add that shared object to Storage
> as a root-level object, but I want a shared collection of those objects.
>
> It looks like collection.push() is actually copying the shared object, and
> that results in an error because of the shared object's __LockerID property
> being duplicated. However, we don’t seem to have any other way to add
> objects to a collection besides .unshift(), which probably does the same as
> .push(). It seems like .push() should just add the shared object reference
> to the shared collection, not copy it, especially for shared objects.
>
> If collection.push($myObj) actually copies $myObj, this should be clearly
> documented. If the general rule is that working with objects is by
> reference, we need to know when objects are copied instead of referenced.
>
> Jim Crate
>
>
> >> 2019/09/10 13:13、Jim Crate via 4D_Tech <4d_tech@lists.4d.com>のメール:
> >>
> >> So what doesn’t work is:
> >>
> >> $sharedObj:=New Shared Object
> >> OB_CopyToSharedObject ($catalogObj;$sharedObj)
> >> Use (Storage.MySharedCollection)
> >> Storage.MySharedCollection.push($sharedObj)
> >> End use
> >>
> >>
> >> What does work is:
> >>
> >> Storage.MySharedCollection.push(New shared object)
> >> Use (Storage.MySharedCollection[Storage.MySharedCollection.length-1])
> >> OB_CopyToSharedObject
> ($catalogObj;Storage.MySharedCollection[Storage.MySharedCollection.length-1])
> >> End use
> >
> >
> >
> > **
> > 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
> **



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

  1   2   3   4   5   6   7   8   9   >