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

Re: CALL FORM

2019-09-11 Thread Kirk Brooks via 4D_Tech
Jeremy,
Sorry - I find it so annoying when people recommend things I can't get at
too.

Here's a short primer from my own, limited, work with using DIALOG(*).

First, why? I think the idea is to reduce the number of processes some of
us create simply to display data. It's not uncommon for a user on my system
to have 20 or so processes due to having lots of records open at one time.
Not to mention the various controllers, lookup forms and what not I may
have and a few background processes. Not a problem for smallish systems but
the guys at Sweetwater would explode with that kind of load on the server.
So by allowing multiple windows in a process we have the option of
centralizing UI windows, for example.

In previous versions of 4D the memory required for this could have been a
problem. Not so much now because of the increased use of references rather
than full copies of data.

So far the best scheme I've found for managing this sort of thing is a
UI_Process method that starts the process and displays a form where users
can find and open records. I don't usually like toolbars but it could be
that, a floating window or just a form. This form 'anchors' the process and
keeps it open. There has to be one DIALOG call without the * otherwise the
method just runs to the end, the process closes and all the DIALOG(*)
windows close.

After that it's really about the aesthetics of your interface what you want
to do. There's no particular reason not to open a form in its own process
if you need to. I find having all the UI forms in a single process makes
communicating between them easy and I don't have to resort to IP vars,
setting process variables or Storage.

On Wed, Sep 11, 2019 at 2:34 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> As neither an attender nor a partner, I can’t see that presentation (yet;
> I assume it will become more generally available one day). I need to look
> more closely at DIALOG(*), but it does seem to me that CALL FORM can be
> pretty useful as a means of interprocess communication as well as
> inter-window.
>

-- 
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: CALL FORM

2019-09-11 Thread Kirk Brooks via 4D_Tech
Jeremy,
On Wed, Sep 11, 2019 at 1:13 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ... CALL FORM as a method of interprocess communication. ...


You might want to take a look at John Baughman's preso from the last
Summit:
https://kb.4d.com/assetid=78028

Long story short, CALL FORM is intended for comms between forms (or windows
really). It's particularly great with windows in the same process. Multiple
open forms in a single process is a new capability of DIALOG(*). This
scheme works well with the ORDA tools. If you are doing classic 4D it's
probably going to be a lot more fussy.

 --
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 authentication system that allow for stronger security.

2019-09-09 Thread Kirk Brooks via 4D_Tech
Eric,
I got around to looking at the Tech Note Tim Penner put up talking about
this subject. https://kb.4d.com/assetid=78310

I haven't looked at or used the Validate password method but if you are
using 4D users it's useful. First you can pass a hashed (
https://doc.4d.com/4Dv17R5/4D/17-R5/Generate-digest.301-4127707.en.html)
password
as well as plain text. More to the point of workstation security after 4
failed attempts 4D itself enforces a 10 second freeze. Sadly this freeze
seems to only apply to every 5th attempt - using both17.2 and 17r6.

On Thu, Sep 5, 2019 at 7:22 AM Eric Naujock via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Does anyone have a replacement login system for 4D that offers stronger
> authentication security than the current system. Since the current system
> does not enforce password changes, or password complexity it is a pretty
> poor system in the current age. While the encryption is crypt is is still
> brute force attackable as well. There are no failed login lockouts. Nor is
> three the ability to have two factor authentication? Or is this something
> beyond what anyone out there is using.
>
> ---
>
> MacCafe
> 7860 Central Ave.
> Toledo, OH 43617
> Phone: (419) 885-1240 X 241
> Fax: (419) 517-2063
> Eric Naujock  -  ACSA 10.2, 10.3, 10.4 Apple - ACTC 10.5, 10.6, 10.7,
> 10.8, 10.9, 10.10, -ACSP 10.11, 10.12, 10.13
> http://www.mac-cafe.com
> email: e r...@mac-cafe.com 
> 
> AOL IM: erlic
>
>
>
> **
> 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 authentication system that allow for stronger security.

2019-09-06 Thread Kirk Brooks via 4D_Tech
Hi Eric,
This is a good discussion and you are making a lot of good points.

On Fri, Sep 6, 2019 at 6:25 AM Eric Naujock via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 1. Passwords are only alphanumeric.
> 2. No two factor options.
> 3. Usernames and password are stored in the Structure file. (Very bad if
> your revving structure files during continuous developemnt.
> 4. No account lockouts for fail authentication attempts. An attacker can
> just continuously try usernames and passwords indefinitely.
> 5. The AD options require that you serve from a windows server bound to
> and AD system. You cannot use this if you have Mac clients or a Apple
> server.
> 6. No ability to define password difficulty or force password changes
> periodically. (I know that need to change passwords regularly has been
> debunked but most govt. best practice documents still believe that’s the
> way to go.)
>

#1 is something 4D should simply fix. Period. But this may be an issue with
r3. I don't see it on 17r6.
#3 is true by default but easy to change.
The rest though - I was trying to think of a desktop application that
offers those points and couldn't come up with any.

But you are talking about 4D server rather than 4D local or a built app.
Gaining access to a server db would require running a 4D client or spoofing
one. And you need direct network access because I'm assuming if the data in
this db is critical you aren't going to run your server on a public IP. So
first you need to crack the network security to even get to the point where
you can run your keystroke bot. And you need to know a user name.

I have also run my own user auth scheme for twenty or so years. I've used
several approaches. I really like the new option 4D offers of SET USER ALIAS
.
The scheme here becomes defining a default user with no password and no
permissions. On login you start an authorization loop. At this point you
totally control the situation and can enforce whatever rules you want. I
haven't looked at 2FA solutions like Authenticator or others but one could
probably to found to work. At the very least you can insert a delay between
authorizations that come back false. DELAY PROCESS for a couple of seconds
coupled with a max number of fails. If the user succeeds you assign them to
an authenticated use account and start a session process. If they fail you
simply kick them out.

So now the question becomes is it possible to break out of this process? In
a compiled db I doubt it. But let's say they are able to break out of the
authorization loop without getting a valid password. That is what 0day
exploits are all about. Where would you go with no permissions? 4D doesn't
have a CLI. The only menu options would be the ones you provide which
should be none. The best hope for a compromise would be to invoke EXECUTE
with a payload of a "PROCESS 4D TAGS (with malicious code)". And if you
pass the name and password to a separate method for verification, instead
of setting a variable in the form process, the targets for spoofing are
small.

There is an opportunity for code injection via the user name field if the
lookup is using ORDA and you are sloppy about filtering the input. So don't
use ORDA for that. Use a classic query. And limit the length of the name
string to something reasonable like 30 chars or so. More is just asking for
trouble, though the user doesn't need to know that.

I would not say this type of attack is impossible. But it would require a
deep understanding of 4D and the structure of the database. And compiling
greatly improves security. Interpreted mode is really development mode.
There is some security but it's pretty easy to circumvent if you have
experience and dev access. Not so once it's compiled.

You could set up a test database using these principles in a couple of
hours for your network folks to bang on and attempt to break. It doesn't
need to have anything real in it to test the login stuff.

-- 
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: Entity-Selection ListBoxes and adding new records

2019-08-30 Thread Kirk Brooks via 4D_Tech
Hey Chris,

On Thu, Aug 29, 2019 at 1:39 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Yet to show the related data in a listbox (i.e. ‘invoice lines’) as an
> entity selection, the problem is how do you give ‘blank lines.’
>
Take a look at entitySelection.add()
https://doc.4d.com/4Dv17R5/4D/17-R5/entitySelectionadd.305-4128677.en.html

You create a new [invoiceLine] entity (record) and then add it to the
entitySelection.
When you create the new one you can pre-populate it as you like. Don't
forget to also call .save() at some point.



> The choice seems to be to create some ‘previsionary’ records and add them
> to the es_selection you are operating on. I suppose that is a possibility.
> Then a person just needs to ‘link up’ records that ‘really’ belong and
> ignore the rest.
>
I jumped on the ORDA bandwagon pretty early. And in those early days tended
to think about solving problems in ORDA using familiar approaches. This
idea reminds me of some similar schemes I thought up. For myself I found
that when some complicated solution like this was appearing to be the way
to go I wasn't really thinking about the problem in the context of how ORDA
works. In ALP the listbox controlled the data, in ORDA the data determines
what's in the listbox. Like I said before think about the listbox 'showing'
or 'reflecting' the data. So you don't need to 'add' a line to the listbox,
you need to create a new record in the data and the listbox takes care of
itself.

Remember you can create and add a record to the entitySelection without
saving it. So as a UI feature you may want to always add a blank line to
the entity selection and only save it when the user modifies it. You may
already be aware of the option to hide empty lines in a listbox. That might
be useful in this situation to make the visual representation more
accurately reflect the data.

-- 
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: Entity-Selection ListBoxes and adding new records

2019-08-26 Thread Kirk Brooks via 4D_Tech
Chris,
Working with collection or entity selection based listboxes is easier for
me when I think of the listbox as simply 'showing' or 'displaying' the
underlying data. From this perspective when I add something to that
underlying data the listbox updates itself because that's all it's doing -
showing the data.

Old school listboxes, in contrast, were objects that did the modifying of
the underlying data. So I had to change the listbox to change that data.
See how it's sort of flipped?

In the example you mention you probably have a button or something to
initiate adding a new line. That's where the new data object (whether it's
a record or an object in the collection) get's created. The listbox will
change to show it.

I've been using 17r6 which is pretty darn good with this stuff. In some
earlier versions if you changed the data outside of the listbox object
itself, I think, and you were using Form you had to set the collection to
itself to update the listbox. So if I had Form.myCollection displayed in a
listbox and it was updated by some other action I would want to be sure to
call

Form.myCollection:=Form.myCollection

Like I say this has been fixed but I don't remember where.

On Mon, Aug 26, 2019 at 5:31 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am using ORDA-based programming exclusively now; not using ‘classic’
> methodology.
> I am wondering what you are doing about creating ‘new’ entities within a
> listBox (related to some master record).
>
> For example, classic scenario:
> INVOICE - invoice table
> INVDETAIL - invoice detail lines table
> Invoice opened; INVDETAIL displayed in a listBox.
>
> User needs to add invoice lines; BUT an ‘ADD BUTTON’ is clumsy, and still
> could result in erroneously-created BLANK entities in the INVDETAIL file.
>
> Using a COLLECTION-based listBox makes it easy to let them do whatever
> (can create ‘blank’ entries in the collection so they can naturally enter
> within the listBox) and then ’save’ these lines to InvDetail when they save
> the invoice.
> But that means managing the underlying InvDetail records.
>
> So is there a better way? Do Transactions work with ORDA?
>
> Thanks for any input.
>
> — 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: Syntax Checking with Component

2019-08-26 Thread Kirk Brooks via 4D_Tech
Hi David,
If your database is going to be compiled all the components must be
compiled too. That's what the Compiler is complaining about.

Best option is to open the component and compile it yourself. Plus that
will get it up to date with the version you are using.

On Mon, Aug 26, 2019 at 1:22 PM David Rose via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have a v17 interpreted database that includes an interpreted component
> (Miyako's Excel Component). The component has a number of methods that have
> $0 parameters. The component has a Compiler method in which all of the
> parameters are typed. The local variables in the host database to which the
> return values are assigned are all correctly typed.
>
> When I check syntax in the Compiler window of the host database, it
> produces the following errors in the host methods that call the component
> methods that return a value:
> The component 'Excel Library' must be compiled
> Invalid constant type: real
> Cannot make an assignment with those types
> Changing the type of the variable $MyVar from type real to type text
>
> (This problem also existed when the database was running in v12 and v15.)
>
> Any way to fix this? It doesn't interfere with the operation of the
> program - no errors occur when calling the component methods. It's just a
> nuisance to see these syntax errors in the Compiler screen.
>
> David Rose
>
> **
> 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: Regex expert needed??

2019-08-24 Thread Kirk Brooks via 4D_Tech
Maybe they do actually read the nug:

https://kb.4d.com/assetid=78301

On Thu, Aug 22, 2019 at 1:13 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Given 2 strings,
> I want to find, and return, the longest substring which is the same in
> both, regardless where in either string the longest substring starts.
>
> ex:
> 1- This is my dog
> 2- My dog does not have fleas
> longest common string is 'my dog'
>
> how to go about this, efficiently?
> I am assuming that there is regex black magic that would do this.
>
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 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: Regex expert needed??

2019-08-23 Thread Kirk Brooks via 4D_Tech
Arnaud,
Good point. If collections aren't available GET TEXT KEYWORDS would be the
easy solution.

On Fri, Aug 23, 2019 at 3:20 AM Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 23 août 2019 à 06:52, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > And as I think about it you need to deal with the multiple match issue
> > better:
>
> Hi Kirk,
> still not well awake and too lazy understand if your algorithm was based
> on chars or words. If it's the former, I'd suggest the use of GET TEXT
> KEYWORDS to produce 2 arrays of words to compare. In the resulting array
> words keep ordered as in the text, it may help if the wanted match is the
> sequence of words.
>
> --
> Arnaud de Montard
>
>
>
> **
> 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: Regex expert needed??

2019-08-22 Thread Kirk Brooks via 4D_Tech
And as I think about it you need to deal with the multiple match issue
better:

$bestMatch:=""

$bestMatch_n_words:=0


Then you loop through the shorter array:

$start:=1  //  first search is on the first word of 

For($i;1;size of array())

$pos1:=Find in array(;{$i}; $start)

while($pos1>0)   // this word matches

$start:=$pos1+1  //  the next Find in array for this word starts on the
next word

$thisMatch:={$i} // a string of matches

$n_words:=1

// now you need to loop through the remaining words in 
until you stop matching

$j:=$i+1 //the word in  to check next

$k:=$pos1+1 // the word in  that must match 

// we need to make sure we don't overrun the size of either array

if ( $j< size of array()) & ( $k< size of array())

while ({$k} = {$j})

$thisMatch:=$thisMatch+" "+{$j}

$n_words:=$n_words+1

end while


if($n_words>$bestMatch_n_words)

$bestMatch_n_words:=$n_words

$bestMatch:=$thisMatch

end if

end if

end while

$start:=1  //  moving on to next word of 

End for

I probably should have actually coded this...

On Thu, Aug 22, 2019 at 9:42 PM Kirk Brooks  wrote:

> Damn, hit send too soon.
> I think you split the two strings into arrays.
> You create:
>
> $bestMatch:=""
>
> $bestMatch_n_words:=0
>
> Then you loop through the shorter array:
>
> For($i;1;size of array())
>
> $pos1:=Find in array(;{$i})
>
> if($pos1>-1) // this word matches
>
> $thisMatch:={$i} // a string of matches
>
> $n_words:=1
>
> // now you need to loop through the remaining words in 
> until you stop matching
>
> $j:=$i+1 //the word in  to check next
>
> $k:=$pos1+1 // the word in  that must match 
>
> while ({$k} = {$j}) & ( $j< size of
> array())
>
> $thisMatch:=$thisMatch+" "+{$j}
>
> $n_words:=$n_words+1
>
> end while
>
>
> if($n_words>$bestMatch_n_words)
>
> $bestMatch_n_words:=$n_words
>
> $bestMatch:=$thisMatch
>
> end if
>
> end if
>
> End for
>
> Use Split string if you can use collections and it should be pretty darn
> fast. Also need to decide what to do with matches of equal length.
>
> On Thu, Aug 22, 2019 at 9:35 PM Kirk Brooks  wrote:
>
>> Chip,
>> I think you split the two strings into arrays.
>> You create two more arrays: $aMatches,  and $aNumWords (unless by
>> 'length' you mean number of characters)
>>
>> The you look through the shorter array:
>>
>> For($i;1;size of array()
>>
>> $pos1:=Find in array(;${$i})
>>
>> if($pos1>-1) // this word matches
>>
>> $thisMatch:={$i} // a string of matches
>>
>> $n_words:=1
>>
>> // now you need to loop through the remaining words in 
>> until you stop matching
>>
>> $j:=$i+1 //the word in  to check next
>>
>> $k:=$pos1+1 // the word in  that must match 
>>
>> while ({$k} = {$j}) & ( $j< size of
>> array())
>>
>> $thisMatch:=$thisMatch+" "+{$j}
>>
>> $n_words:=$n_words+1
>>
>> end while
>>
>>
>> end if
>>
>> End for
>>
>>
>> On Thu, Aug 22, 2019 at 1:13 PM Chip Scheide via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>
>>> Given 2 strings,
>>> I want to find, and return, the longest substring which is the same in
>>> both, regardless where in either string the longest substring starts.
>>>
>>> ex:
>>> 1- This is my dog
>>> 2- My dog does not have fleas
>>> longest common string is 'my dog'
>>>
>>> how to go about this, efficiently?
>>> I am assuming that there is regex black magic that would do this.
>>>
>>> ---
>>> Gas is for washing parts
>>> Alcohol is for drinkin'
>>> Nitromethane is for racing
>>> **
>>> 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 *
>>
>>
>
> --
> 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 *
>
>

-- 
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: Regex expert needed??

2019-08-22 Thread Kirk Brooks via 4D_Tech
Damn, hit send too soon.
I think you split the two strings into arrays.
You create:

$bestMatch:=""

$bestMatch_n_words:=0

Then you loop through the shorter array:

For($i;1;size of array())

$pos1:=Find in array(;{$i})

if($pos1>-1) // this word matches

$thisMatch:={$i} // a string of matches

$n_words:=1

// now you need to loop through the remaining words in 
until you stop matching

$j:=$i+1 //the word in  to check next

$k:=$pos1+1 // the word in  that must match 

while ({$k} = {$j}) & ( $j< size of
array())

$thisMatch:=$thisMatch+" "+{$j}

$n_words:=$n_words+1

end while


if($n_words>$bestMatch_n_words)

$bestMatch_n_words:=$n_words

$bestMatch:=$thisMatch

end if

end if

End for

Use Split string if you can use collections and it should be pretty darn
fast. Also need to decide what to do with matches of equal length.

On Thu, Aug 22, 2019 at 9:35 PM Kirk Brooks  wrote:

> Chip,
> I think you split the two strings into arrays.
> You create two more arrays: $aMatches,  and $aNumWords (unless by 'length'
> you mean number of characters)
>
> The you look through the shorter array:
>
> For($i;1;size of array()
>
> $pos1:=Find in array(;${$i})
>
> if($pos1>-1) // this word matches
>
> $thisMatch:={$i} // a string of matches
>
> $n_words:=1
>
> // now you need to loop through the remaining words in 
> until you stop matching
>
> $j:=$i+1 //the word in  to check next
>
> $k:=$pos1+1 // the word in  that must match 
>
> while ({$k} = {$j}) & ( $j< size of
> array())
>
> $thisMatch:=$thisMatch+" "+{$j}
>
> $n_words:=$n_words+1
>
> end while
>
>
> end if
>
> End for
>
>
> On Thu, Aug 22, 2019 at 1:13 PM Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> Given 2 strings,
>> I want to find, and return, the longest substring which is the same in
>> both, regardless where in either string the longest substring starts.
>>
>> ex:
>> 1- This is my dog
>> 2- My dog does not have fleas
>> longest common string is 'my dog'
>>
>> how to go about this, efficiently?
>> I am assuming that there is regex black magic that would do this.
>>
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing
>> **
>> 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 *
>
>

-- 
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: Regex expert needed??

2019-08-22 Thread Kirk Brooks via 4D_Tech
Chip,
I think you split the two strings into arrays.
You create two more arrays: $aMatches,  and $aNumWords (unless by 'length'
you mean number of characters)

The you look through the shorter array:

For($i;1;size of array()

$pos1:=Find in array(;${$i})

if($pos1>-1) // this word matches

$thisMatch:={$i} // a string of matches

$n_words:=1

// now you need to loop through the remaining words in 
until you stop matching

$j:=$i+1 //the word in  to check next

$k:=$pos1+1 // the word in  that must match 

while ({$k} = {$j}) & ( $j< size of
array())

$thisMatch:=$thisMatch+" "+{$j}

$n_words:=$n_words+1

end while


end if

End for


On Thu, Aug 22, 2019 at 1:13 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Given 2 strings,
> I want to find, and return, the longest substring which is the same in
> both, regardless where in either string the longest substring starts.
>
> ex:
> 1- This is my dog
> 2- My dog does not have fleas
> longest common string is 'my dog'
>
> how to go about this, efficiently?
> I am assuming that there is regex black magic that would do this.
>
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 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: _ as first character in Method Name [was 64 bit...]

2019-08-19 Thread Kirk Brooks via 4D_Tech
I agree. I haven't found anything indicating a leading underscore is not
allowed. Miyako said it's discouraged to avoid unintended consequences.
That's a lot different than not allowed.

I'm using, and compiling, leading underscore methods in 17r6 without
issues.

On Mon, Aug 19, 2019 at 9:13 AM John DeSoi via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Why is 64 bit 4D not going to like it? Spaces are still allowed in method
> names.
>

-- 
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 (Why does query fail to find zero uuid value, i.e ("0"*32))

2019-08-13 Thread Kirk Brooks via 4D_Tech
Jeremy,
Try searching the UUID fields for:  "20202020202020202020202020202020"

I got that here:  https://kb.4d.com/assetid=77576

On Tue, Aug 13, 2019 at 3:46 PM Jeremy French via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Give the following
>
> Table with:
> 1) primary key "key_uuid"
> 2) another field named "some_key_uuid"
> 3) 20-records
> 4) 12 of 20 have value assigned to "some_key_uuid"
> 5) 8 of 20 have no value assigned to "Some_key_uuid". Field value is
> 32-zeroes
>
> Code to locate the 8-records whose "some_key_uuid" contains 32-zeroes:
>
> 
> C_OBJECT($not_assigned1_eso)
> C_OBJECT($not_assigned2_eso)
> C_TEXT($key_t)
>
> $not_assigned1_eso:=ds[Table name(->[test])].query(Field
> name(->[test]some_uuid_key)+" = :1";String(32*"0"))
>
> $key_t:=(32*"0")
> $not_assigned2_eso:=ds.test.query("some_uuid_key = :1";$key_t)
>
> QUERY([test];[test]some_uuid_key=(32*"0"))
> 
>
> Why does ORDA **fail** to locate the entities with 32-zeroes in
> "some_key_uuid", but legacy 4D **does** locate the 8-records?
>
> Here's what I see in the debugger:
>
> https://i.postimg.cc/Pfy88KhZ/p01-orda-vs-legacy-query.png
>
> **
> 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 to clear an object?

2019-08-11 Thread Kirk Brooks via 4D_Tech
Jorg,
 If you are using $MyGreatObj in a loop or some situation where you are
reusing it you can also do:

For each ($MyGreatObj; $someDataStructure)

$MyGreatObj:=New Object

$myGreatObj:= 

$someOtherObj.greatProp:=$MyGreatObj

End for each

Remember that unlike other reference items from the past (menus and lists)
when you create an object using $anything:=New Object its scope is a local
variable. So when the method that created it ends the variable is cleared
too UNLESS you assigned it to a non-local variable.

This made me curious so I just checked out how this works in the debugger:

C_OBJECT($myGreatObj)  //  $myGreatObj = null
$myGreatObj:=New object  // $myGreatObj = {}

CLEAR VARAIBLE($myGreatObj) // $myGreatObj = null


So we can say New object initializes the object as empty and CLEAR VARIABLE
sets it to null, which is equivalent to $myGreatObj:=null.

On Sun, Aug 11, 2019 at 1:03 AM Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Happy Sunday to all,
>
> Just wondering how would one clear/delete/vaporise a 4D object (Language):
>
> C_Object($MyGreatObject)
>
> $MyGreatObject:= New Object
> $MyGreatObject:=Get system info
>
> // playing around with the object
>
> Now I want to clear/vaporise the object before I go on, but not set all
> the properties to NULL
>
>
>
> Would the object have been created by ObjectTools I’d simply use
>
> OT Clear ($MyGreatObject).
>
>
> Any pointers anyone?
>
> 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: POS systems

2019-08-03 Thread Kirk Brooks via 4D_Tech
Dave,
One of the first big 4D projects I took on was interfacing 4D with an OS/2
based POS system. From that I tinkered with the idea of writing one for a
while. It's certainly doable and I'm sure some enterprising Devs have
accomplished it. That said I would suggest you look at whatever task you
need to accomplish from a results oriented perspective.

If the requirements are pretty low volume and you anticipate them staying
that way you may want to roll your own POS to accommodate.

If the expectation or current need is fairly robust then the POS system
needs to be more than a bolt-on solution. In this case I'd look at existing
solutions with an eye toward the best fit for the client AND ease of
interfacing with the 4D app.

POS is one of those things that in theory is pretty straightforward but it
is a massive crate of devilish details with added benefit of needing to
interface with various flavors of hardware and payment processing. What
fun! Throw in a smattering of accounting, user training and so on and it
just gets better and better.

 Like I say, if the scope of your needs are narrow you may be better off
doing your own. Otherwise let a POS company worry with that stuff and
concentrate on how to get your database to pull the good parts out of their
system.

To return to my opening story that is exactly what my database did. It
pulled a daily data dump from the POS system and converted this into data
we were using. This was a restaurant so we wanted menu analysis, bar
inventory, accounting, and so on. There was a similar process for the time
clock (different system back then) and all those data were aggregated for
payroll, accounting and management. Pretty cool for the late '80s.

On Sat, Aug 3, 2019 at 5:03 AM Dave Tenen via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> To all of the 4D universe,
>
> Does anyone have any experience with a 4D based POS systems?
>
> Thanks in advance,
>
> Dave Tenen
>
>
> Personal Chef
>
> Coming to you from Spec Pond and I swear the fish was
> []
> this big
>
> dte...@me.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: No Object Auto-Completion for 4D Commands?

2019-08-02 Thread Kirk Brooks via 4D_Tech
It can hang on to it for a long time, though.
I really wish we have a REGEX option for Find in Design.

On Fri, Aug 2, 2019 at 10:39 AM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> On Aug 2, 2019, at 12:24 PM, Jeffrey Kain wrote:
>
> > And if you misspell a property (or get the case wrong), it will suggest
> that to you forever as well.  So don't make a mistake... ever! :)
>
> I don’t think it does it “forever”.The way I understand it works is every
> method that you open is scanned for dot notation and it grabs all attribute
> names and stores them. It remembers until you quit.
>
> Are you seeing it work differently, or are you just having some fun
> scaring people on Friday. :)
>
> Tim
>
> *
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.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: No Object Auto-Completion for 4D Commands?

2019-08-02 Thread Kirk Brooks via 4D_Tech
Narinder,
This is a good point. Previously 4D has been sort of development
environment with its own editors and so forth.
But now we are starting to look for it to be more of an IDE. Especially
with the Projects option coming where the 4D part is all stored in text
files.

On Fri, Aug 2, 2019 at 10:37 AM Narinder Chandi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Yup, that is _exactly_ the behaviour I would expect from an IDE.
> Obviously, 4D's Method Editor isn't there yet...
>

-- 
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: Managing multiple windows in the same process (v17r5)

2019-08-02 Thread Kirk Brooks via 4D_Tech
Wayne,
That's true but it's easy to hand off tasks like that to Workers. And the
worker uses CALL FORM to hand back the results.

On Fri, Aug 2, 2019 at 10:22 AM Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> One disadvantage is that there is only one execution stream with multiple
> windows in the one process.
>
> If something is taking time in one window (a sequential search or sort or a
> even just a long method) execution will stop in all other windows, the UI
> will freeze etc
>
>
>
> On Sat, 3 Aug 2019 at 02:29, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com
> >
> wrote:
>
> > Hi Pat,
> > For something like that I would think about using a palette or
> toolbar-ish
> > window as the 'root', if you will, for the UI process.
> > That could actually simplify things - if the user attempts to close it
> you
> > confirm they want to quit. And then you don't have to fuss around with
> > counting windows opened and closed.
> >
> > On Fri, Aug 2, 2019 at 9:19 AM Pat Bensky via 4D_Tech <
> > 4d_tech@lists.4d.com>
> > wrote:
> >
> > > I also have a question about this ...
> > > In our database we require at least one user window to always be open.
> > When
> > > a user closes a window, the close method counts the number of user
> > windows
> > > and if there is only one, it doesn't allow it to be closed.
> > > However ...
> > > If the user has opened another window within the same process (for a
> > > preview, for example), 4D now thinks there are two user windows open,
> and
> > > it allows the user to close it ... which of course closes both of the
> > > windows.
> > > Other than keeping track of all open windows-within-windows, which is
> > > messy, is there any way to differentiate main windows and their
> > associated
> > > windows within the same process?
> > >
> > > PB
> > >
> > > On Wed, 26 Jun 2019 at 16:08, Kirk Brooks via 4D_Tech <
> > > 4d_tech@lists.4d.com>
> > > wrote:
> > >
> > > > Hi Chris,
> > > > Good questions. Here are my thoughts on them based on what I've
> picked
> > up
> > > > from the World Tour and Summits.
> > > >
> > > > On Wed, Jun 26, 2019 at 12:31 AM Chris Belanger via 4D_Tech <
> > > > 4d_tech@lists.4d.com> wrote:
> > > >
> > > > > 1) What is the reasonable limit as to how many windows/dialogs
> should
> > > get
> > > > > opened in the same process?
> > > > >
> > > > This is going to be limited by the resources available to 4D. A
> laptop
> > > with
> > > > the minimum RAM and processor is going to have a lower limit than a
> > nice
> > > > new Mac Pro by a long way.
> > > >
> > > > But there's no reason to be opening a huge number of windows. A
> window
> > is
> > > > really a UI portal as it were. We no longer need to hack certain
> > > operations
> > > > with 'offscreen' or 'hidden' windows so a good design should open a
> > > window
> > > > for something useful.
> > > >
> > > > On top of that now it's really easy and fast to completely repurpose
> > > what a
> > > > window is 'doing' anyway. You could design a window interface to be a
> > lot
> > > > like the OS window interfaces are - you display something and then
> > > > completely change it based on a user action. But now we could revert
> to
> > > any
> > > > previous window content like the back button on a Finder window. You
> > > would
> > > > have to retain the displayed form and the Form contents but with that
> > > info
> > > > you could reload a past window.
> > > >
> > > > So I think this is a case where the technical limit on the number of
> > > > windows is less important than building a good design for the
> > interface.
> > > >
> > > >
> > > > > 2) do windows that share the same process also share processing
> time?
> > > > What
> > > > > I mean is: If window A is executing, does window B have to wait
> until
> > > > > Window A is done before any processing it does would start (think
> > CALL
> > > > FORM
> > > > > ( window ) )?
> > > > >
> > > > > For example: Wi

Re: No Object Auto-Completion for 4D Commands?

2019-08-02 Thread Kirk Brooks via 4D_Tech
My bad - I mis-read what he was asking about.

On Fri, Aug 2, 2019 at 9:51 AM Timothy Penner via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hello,
>
> > What gives? Tell me I made a basic mistake somewhere?!
>
> Here is the blog post regarding the feature:
> https://blog.4d.com/autocomplete-function-expanded-to-object-attributes
>
> TL/DR - Each time you open a method, or edit some code, the method editor
> collects the attributes used in your code and proposes them in the list of
> suggestions.
>
> -Tim
>
>
>
>
>
>
>
> -Original Message-
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Narinder Chandi
> via 4D_Tech
> Sent: Friday, August 02, 2019 9:42 AM
> To: 4D Tech Mailing List <4d_tech@lists.4d.com>
> Cc: Narinder Chandi <4dtechmailingl...@toolbox.uk.com>
> Subject: No Object Auto-Completion for 4D Commands?
>
> So, I'm in the final phase of a v15 to v17.2 upgrade and
> eliminating/replacing all the remaining _o_ prefixed obsolete 4D commands.
> I came across some Method Editor behaviour that I totally didn't expect...
> btw, this is my very first foray into using C_OBJECT and 4D commands that
> return objects!
>
> Let me illustrate with the following very simple example:
>
> C_OBJECT($object)
>
> $object:=Path to object(Get 4D folder)
>
> Now, when I type $object into the Method Editor, I expected the
> auto-completion to show me available object properties such as
> parentFolder, name and extension but it didn't. I then modified the code to:
>
> $object:=New object
> $object:=Path to object(Get 4D folder)
>
> But that didn't yield anything more - I had assumed in the first example
> that the 4D command would implicitly initialise the object internally. So,
> I have a couple questions a this point:
> * for 4D commands that return an object is object initialisation implicit
> or must "New object" always be called first?
> * is it the case that there is actually no auto-completion for 4D Commands
> that return objects? That would be a real disappointment :((
>
> Note that I also tested the above in a completely new 4D v17 database just
> in case there was something up with a converted database. I also checked
> that the auto-complete settings in Preferences were setup correctly - they
> are identical in both the converted v17 and new v17 databases.
>
> I also tested this example:
>
> C_OBJECT($object1)
> C_OBJECT($object2)
>
> $object1:=New object
> $object1:=Path to object(Get 4D folder)
>
> $object2:=New object
> $object2.foo:="foo"
> $object2.bar:="bar"
>
> In this case I get auto-completion of "object1.foo" as well as
> "object2.foo" which is really not what I would expect at all! It seems to
> me that the Method Editor is wholly indiscriminate about what the
> auto-completion options are!
>
> What gives? Tell me I made a basic mistake somewhere?!
>
> Regards,
>
> Narinder Chandi,
> ToolBox Systems 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
> **
> **
> 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: No Object Auto-Completion for 4D Commands?

2019-08-02 Thread Kirk Brooks via 4D_Tech
Narinder,
I just pasted your example into a new db in 17.2 (Mac) and it worked as
expected.

I'd suggest dragging the $object var into the debugger pane. Though it
worked for me typing in the variable as well.

On Fri, Aug 2, 2019 at 9:41 AM Narinder Chandi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> So, I'm in the final phase of a v15 to v17.2 upgrade and
> eliminating/replacing all the remaining _o_ prefixed obsolete 4D commands.
> I came across some Method Editor behaviour that I totally didn't expect...
> btw, this is my very first foray into using C_OBJECT and 4D commands that
> return objects!
>
> Let me illustrate with the following very simple example:
>
> C_OBJECT($object)
>
> $object:=Path to object(Get 4D folder)
>
> Now, when I type $object into the Method Editor, I expected the
> auto-completion to show me available object properties such as
> parentFolder, name and extension but it didn't. I then modified the code to:
>
> $object:=New object
> $object:=Path to object(Get 4D folder)
>
> But that didn't yield anything more - I had assumed in the first example
> that the 4D command would implicitly initialise the object internally. So,
> I have a couple questions a this point:
> * for 4D commands that return an object is object initialisation implicit
> or must "New object" always be called first?
> * is it the case that there is actually no auto-completion for 4D Commands
> that return objects? That would be a real disappointment :((
>
> Note that I also tested the above in a completely new 4D v17 database just
> in case there was something up with a converted database. I also checked
> that the auto-complete settings in Preferences were setup correctly - they
> are identical in both the converted v17 and new v17 databases.
>
> I also tested this example:
>
> C_OBJECT($object1)
> C_OBJECT($object2)
>
> $object1:=New object
> $object1:=Path to object(Get 4D folder)
>
> $object2:=New object
> $object2.foo:="foo"
> $object2.bar:="bar"
>
> In this case I get auto-completion of "object1.foo" as well as
> "object2.foo" which is really not what I would expect at all! It seems to
> me that the Method Editor is wholly indiscriminate about what the
> auto-completion options are!
>
> What gives? Tell me I made a basic mistake somewhere?!
>
> Regards,
>
> Narinder Chandi,
> ToolBox Systems 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
===

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: Managing multiple windows in the same process (v17r5)

2019-08-02 Thread Kirk Brooks via 4D_Tech
Hi Pat,
For something like that I would think about using a palette or toolbar-ish
window as the 'root', if you will, for the UI process.
That could actually simplify things - if the user attempts to close it you
confirm they want to quit. And then you don't have to fuss around with
counting windows opened and closed.

On Fri, Aug 2, 2019 at 9:19 AM Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I also have a question about this ...
> In our database we require at least one user window to always be open. When
> a user closes a window, the close method counts the number of user windows
> and if there is only one, it doesn't allow it to be closed.
> However ...
> If the user has opened another window within the same process (for a
> preview, for example), 4D now thinks there are two user windows open, and
> it allows the user to close it ... which of course closes both of the
> windows.
> Other than keeping track of all open windows-within-windows, which is
> messy, is there any way to differentiate main windows and their associated
> windows within the same process?
>
> PB
>
> On Wed, 26 Jun 2019 at 16:08, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com>
> wrote:
>
> > Hi Chris,
> > Good questions. Here are my thoughts on them based on what I've picked up
> > from the World Tour and Summits.
> >
> > On Wed, Jun 26, 2019 at 12:31 AM Chris Belanger via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> > > 1) What is the reasonable limit as to how many windows/dialogs should
> get
> > > opened in the same process?
> > >
> > This is going to be limited by the resources available to 4D. A laptop
> with
> > the minimum RAM and processor is going to have a lower limit than a nice
> > new Mac Pro by a long way.
> >
> > But there's no reason to be opening a huge number of windows. A window is
> > really a UI portal as it were. We no longer need to hack certain
> operations
> > with 'offscreen' or 'hidden' windows so a good design should open a
> window
> > for something useful.
> >
> > On top of that now it's really easy and fast to completely repurpose
> what a
> > window is 'doing' anyway. You could design a window interface to be a lot
> > like the OS window interfaces are - you display something and then
> > completely change it based on a user action. But now we could revert to
> any
> > previous window content like the back button on a Finder window. You
> would
> > have to retain the displayed form and the Form contents but with that
> info
> > you could reload a past window.
> >
> > So I think this is a case where the technical limit on the number of
> > windows is less important than building a good design for the interface.
> >
> >
> > > 2) do windows that share the same process also share processing time?
> > What
> > > I mean is: If window A is executing, does window B have to wait until
> > > Window A is done before any processing it does would start (think CALL
> > FORM
> > > ( window ) )?
> > >
> > > For example: Window A is doing a QUERY that takes a few seconds. Does
> > that
> > > make Window B (in the same process) unresponsive until Window A has
> > > finished the QUERY?
> > >
> > Prior to preemptive processes each instance of 4D ran on a single core of
> > the machine. How the CPU cycles were allocated and prioritized was
> between
> > 4D and OS. To us it looked like multiple processes were running
> 'parallel'
> > but it was all happening on a single core. The only way you could truly
> > have parallel processing was by using server side processes or EXECUTE ON
> > CLIENT and each of those instances were limited in the same way.
> >
> > With a preemptive process you can truly have different processes running
> > concurrently on different cores. Thomas Maul has some great demos of
> this.
> > If you aren't a Partner (they may be walled off from non-partners) check
> > out a presentation he did for 4DMethod <https://4dmethod.com/>. He also
> > includes a demo of why pre-emptive processing only matters on actual
> > hardware, not virtualized machines. I forget if that's in the 4DMethod
> > preso or I saw it at a Summit. Bottom line: preemptive is meaningless on
> a
> > virtual machine because the virtual machine is running virtual cores and
> > then entire virtual machine is running on a single instance of the host
> > machine. So, if you plan to deploy on AWS or the like don't worry about
> 

Re: v15R5 bug?

2019-07-31 Thread Kirk Brooks via 4D_Tech
Jeremy,
Not a boring response at all and gives a good description of what you're
doing.

My first thought is that if you want to support both "classic 4D" listboxes
and modern, Form based listboxes from the same component you are going to
want to branch the code. As you are discovering attempting to use both
"modern" and "classic" 4D tools at the same time leads to various problems
with complicated workarounds. Especially in a situation like this where the
approach to managing what appears on the screen as a 'listbox' is a
completely different data structure depending on the way it's constructed.

Personally I've found the modern approach so. much. easier. I use a
fraction of the code I would have before. But I also commit to the listbox
(based on entity selection or collection) being "modern".

Working with classic listboxes is where I pull out pointer arrays,
selection sets, current row numbers, and all that jazz.

I have not had good results attempting to combine the two. Choose one or
the other: you're working on a Camero or you're working on a Tesla. Parts
for one just don't fit the other even when they are called the same thing.

Or perhaps a more germane quip would be a long time ago when I discovered
the very expensive Laserwriter I purchased couldn't be "upgraded" to the
new generation. "The only thing the two can both use is the power cord," my
rep explained.


On Wed, Jul 31, 2019 at 8:31 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> Thanks for your reply, which is interesting. This is what I’m doing. I
> wrote most of the code quite a while ago, before objects and before dynamic
> variables.
>
> I have a component to handle listboxes. Its methods can be used in three
> ways.
>
> 1. The box is fully set up in the Form editor. The component’s routines
> are used mainly to record, without any more code, changes in sort order,
> column width and column order.
>
> 2. The box is designed in the component’s designer but lives in one of the
> host’s forms. A single call sets up all the columns and deals also with
> everything in option 1.
>
> 3. The box is designed as in (2), but lives in a subform containing a form
> in the component. At the host level, all that’s necessary to set up the box
> is to assign the box’s name (set in the designer) to the subform’s variable.
>
> In the component, there’s a global array of objects in the form I
> described: {pointer to listbox; info object}. The info object holds column
> order, column widths, table/field IDs, column expressions and so on.
>
> When the host calls the component’s methods (which include querying,
> sorting, handling clicks and double-clicks and so on), it identifies the
> relevant box by passing a pointer as a parameter. The component can then
> locate the info object for that box by searching on the pointer. Using Find
> in array with matched arrays (one of pointers and one of info objects), it
> works very nicely, but of course the arrays need to be kept in sync. The
> advantage to the host programmer is that listbox pointers can be used to
> call the component’s methods in the same way as 4D’s listbox methods.
>
> Using the listbox variable name doesn’t work well when the box is on a
> host form because the component can’t see objects in the form; and it
> doesn’t work well when the box is in a subform, because they all have the
> same name. The advantage of pointers is that they are truly universal,
> usable in exactly the same way in host and component.
>
> I bore you with the details only because I feel your detailed post merited
> a detailed response.
>
> Jeremy
> **
> 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 to decode this text

2019-07-31 Thread Kirk Brooks via 4D_Tech
Miyako,

On Wed, Jul 31, 2019 at 1:47 AM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The MIME header is an multi layered specification.
> https://en.wikipedia.org/wiki/MIME
>
> one can switch encodings or charsets mid-sentence, or use multiple lines,
> so the decoding logic can get really complex.
> c.f.
> https://github.com/miyako/4d-plugin-gmime


How would I send a .eml BLOB or file with 4D?


-- 
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: v15R5 bug?

2019-07-28 Thread Kirk Brooks via 4D_Tech
Hey Jeremy,
A couple of thoughts:

On Sun, Jul 28, 2019 at 9:20 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a collection objects, each of which has a pointer to a variable and
> an associated object:
>
You don't need to use a pointer in the collection. It sounds like what you
want is for that value, in the collection, to be dynamic and to be able to
query on it and find different results as other things have changed. So
what you need to do is design things so that whatever is now a pointer is
itself a reference.

"list" could be any number of things but I bet it could be represented as a
collection. At which point it becomes much easier for you to work with
directly rather than having to dereference what ever that is.


> I want to find the item in the collection from the pointer, which is in
> $ptr
> $boxes:=<>boxes.query(“lb = :1”;$ptr)
>
This might work if $ptr is pointing to a var and you dereference $ptr. But
it's not clear if $ptr is an actual pointer or not.


> Is searching for pointers not allowed?
>
Using ORDA I don't think so.
Using these new data structures, collections, objects, entities and such,
works most effectively when you work with them using references. Within
that context a reference is similar to a pointer but more powerful and
easier to use. Pointers are for working with variables, fields and tables.
It's a different structure from ORDA. You have to rethink how you go about
doing some things. Especially when working with forms and familiar objects
like listboxes. But it's what we have to do. I can tell you from personal
experience over the past year or so the payoff is pretty good. These new
abilities are great.

If you find yourself trying to figure out how to use pointers when you're
doing something with an object, collection or entity you are on the wrong
path. Take a step back and figure out how to accomplish your goals using
references.

You know since Form I rarely use pointers for anything except buttons. Why?
Because it's easier to simply put those objects in the Form object and
reference them.
Input fields: you need to recognize the On data change event but from there
I just work with whatever the value in Form.thisField is.
Listboxes: the only place I've made a listbox with an array is in v15
projects I'm still working on. Otherwise they are either collections or
entity selections. Once more there is nothing I need a pointer to - the
components of them are referenced in Form and easy to work with from there.

Speaking of them, your example suggests to me you are working out a way to
have several different 'boxes' in an array, perhaps with the intent of
making it easy for the user to switch between them? Great idea. I might do
something like:

$lb_obj:=New object("name";"my name";"data"; )

as the object. And instead of an IP var consider using a process variable.
To accommodate multiple windows you use DIALOG(*). You can have many
independent windows in a single method. I'm starting to have a single UI
process where all the windows the user interacts with exist. Coupled with
CALL FORM it's very easy to support this.

Finally, keep in mind that when we create a reference to something we
aren't duplicating it. This is where the similarity to pointers is similar.

$obj:=new object(with a bunch of data)

And then I include this in a collection:

processColl.push($obj)


There is still only 1 instance of $obj. If I then do

$otherColl.push(processColl[0])

$myColl.push(processColl[0])

it's the same thing. There's only one instance of $obj and now 3 references
to it, one in a process variable and 2 in locals (these could be on forms).
So thinking about a form for a moment let's say I put $myColl into
Form.myColl. Now I can reference the values of $obj on my form with

Form.myColl[0].someProperty

which in this example is equivalent to

processColl[0].someProperty

And if the user makes some change on the form those changes are reflected
in all the instances. This is a pretty simple example and you could pretty
easily accomplish the same functionality using pointers. You would need a
lot more code to do it but really I just wanted to try to highlight the
differences in the way you think about the data.



-- 
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 eMail Editor - full HTML support

2019-07-23 Thread Kirk Brooks via 4D_Tech
Hi Kirk,

On Mon, Jul 22, 2019 at 11:26 PM rooftop99--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Our marketing department is creating eMails in Outlook which included
> images, hyperlinks (text and image), backgrounds, etc.  We would like to
> take these emails and copy the body content into a field in 4D to be
> retrieved for future email campaigns sent from 4D. The links, images and
> formatting need to be maintained.


> I have looked at 4D Write Pro as an option but it doesn’t appear to accept
> the entire contents of an outlook email via paste and it is expensive.


First, you don't say but I assume the emails are formatted HTML. The
"entire contents of an outlook email" is a .eml file, or Microsoft's
interpretation of one, and Write may be able to work with it.

I would take the email text, and that's all it is - a big block of text -
and extract the HTML. You'll have to inspect the actual text but I expect
you can find something that starts with "" and ends with "".
Pull that out and store it in a text field or whatever. That content should
display as you want in a web area. You may get different results using the
internal web kit vs. not.

The html may not be so neatly identified but the principle is the same,
find the html part, extract it, wrap it in your own  tags if
you need to and display in a web area. That's all something that could be
automated, I think. Set up a mailbox for the server, if it doesn't have one
already, and have marketing include it in the mailings. Server checks the
box now and then, downloads the marketing email and creates the record for
it. You probably have that in place already, I suppose.

If the emails aren't html for some reason it will be extremely difficult to
match formatting and such. But I really doubt that's the case.

-- 
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: Microsoft Azure & 4D

2019-07-22 Thread Kirk Brooks via 4D_Tech
Paul,
Are using CLI on the server or client machines?

On Mon, Jul 22, 2019 at 1:12 AM Paul Dennis via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I use the AWSCLI tools to sync and move my locally generated pdf's to S3
> using launch external process. When pdf's are generated I call AWSCLI and
> it
> syncs or moves the files.
>
-- 
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: Microsoft Azure & 4D

2019-07-19 Thread Kirk Brooks via 4D_Tech
John,
I have been using Bruno's AWS component for a few years myself. I'm going
to be moving away from using the component soon. Not because of a problem
with it but because I'm changing the way files are put into AWS. I'm
looking at a service for managing file transfers called Transloadit
. They have 'robots' pre-configured to transfer
files to Azure, AWS, Dropbox, Instagram and others. And it's really easy.
It's not free but it looks pretty good so far.

What I particularly like is being able to defined a URL to receive a
notification for each file. I set up an API to receive these and update the
database with the specifics.

On Fri, Jul 19, 2019 at 3:33 PM JOHN BAUGHMAN via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a deployed database that is currently using AWS. We have 200gb of
> PDFs stored on the same machine as 4D server. A Xojo Web App displays the
> available PDFs, when the end user requests one of the PDFs Xojo sends the
> request to 4D and 4D returns the PDF.
>
> At the present time we are using AWS to handle large files that stall our
> the Xojo web app, by uploading the file to AWS and sending an email link to
> the file to the requesting user. This all works great.
>
> Now the client wants to move the PDF archive to the cloud and have 4D
> serve them all from the ASW cloud. I do not see that should be any problem
> using Bruce Legay’s excellent AWS Component.
>
> Now the client suddenly has expressed a desire to use Microsoft Azure
> instead of AWS. So my question to you all are…
>
> 1. Is anyone out there using Azure for data storage and retrieval?
> If so any suggestions on where to look for help ie. Component or plug in. I
> don’t see anything in the knowledge base.
>
> 2. Any thoughts on the pros and cons between using Azure or AWS.
>
> Thanks,
>
> John
>
>
>
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.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: Stuffing a shared object

2019-07-15 Thread Kirk Brooks via 4D_Tech
You know these new tools and features in 4D are exactly like that when you
use them the way they are designed.

On Mon, Jul 15, 2019 at 9:22 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk, you are so right. Thank you: after ten minutes’ work I have a
> solution which both works and is enormously more elegant.
>
> Jeremy
>
> > On 15 Jul 2019, at 17:05, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Jeremy,
> > It's easy to keep trying to do everything the same way we have for years.
> > That's why a list like this is so useful.
> >
> > On Mon, Jul 15, 2019 at 9:01 AM Jeremy Roussak via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Kirk,
> >>
> >> Now why didn’t I think of that? It’s exactly what CALL WORKER is for,
> >> isn’t it?
> >>
> >> Jeremy
> >>
> >>> On 15 Jul 2019, at 16:44, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com>
> >> wrote:
> >>>
> >>> Jeremy,
> >>> I don't think this would be a good situation for using Shared objects.
> >>> Every object in a shared object must itself be shared. There's a lot of
> >>> overhead involved in maintaining the various lockers and such.
> >>>
> >>> I would look at using CALL WORKER. Bundle up everything into an object
> >> and
> >>> pack it off to a worker. When the worker is done the results come back
> >> via
> >>> CALL FORM. This will be faster and easier.
> >>>
> >>>
> >>> On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
> >>> 4d_tech@lists.4d.com> wrote:
> >>>
> >>>> I have a form which accepts some information and, when a button is
> >>>> clicked, does some fairly time-consuming calculations which return a
> >> set of
> >>>> figures. At present, it uses objects with the Form object for input
> and
> >>>> output data.
> >>>>
> >>>> I’d like to hand off the calculations to a separate process. As I
> >>>> understand it, I can’t pass the Form object to the new process but
> have
> >> to
> >>>> create a shared object.
> >>>>
> >>>> How do I get the information from the Form object into the new shared
> >>>> object? I’ve tried
> >>>>
> >>>>   $shared.formObj := OB Copy(Form)
> >>>>
> >>>> but it gives a error: “Not supported value in a shared object”.
> >>>>
> >>>> Am I, as so often, missing something obvious?
> >>>>
> >>>> Jeremy
> >>>> **
> >>>> 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
> >>> **
> >>
> >> **
> >> 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
> > **
>
> **
> 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: Stuffing a shared object

2019-07-15 Thread Kirk Brooks via 4D_Tech
Jeremy,
It's easy to keep trying to do everything the same way we have for years.
That's why a list like this is so useful.

On Mon, Jul 15, 2019 at 9:01 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> Now why didn’t I think of that? It’s exactly what CALL WORKER is for,
> isn’t it?
>
> Jeremy
>
> > On 15 Jul 2019, at 16:44, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Jeremy,
> > I don't think this would be a good situation for using Shared objects.
> > Every object in a shared object must itself be shared. There's a lot of
> > overhead involved in maintaining the various lockers and such.
> >
> > I would look at using CALL WORKER. Bundle up everything into an object
> and
> > pack it off to a worker. When the worker is done the results come back
> via
> > CALL FORM. This will be faster and easier.
> >
> >
> > On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> I have a form which accepts some information and, when a button is
> >> clicked, does some fairly time-consuming calculations which return a
> set of
> >> figures. At present, it uses objects with the Form object for input and
> >> output data.
> >>
> >> I’d like to hand off the calculations to a separate process. As I
> >> understand it, I can’t pass the Form object to the new process but have
> to
> >> create a shared object.
> >>
> >> How do I get the information from the Form object into the new shared
> >> object? I’ve tried
> >>
> >>$shared.formObj := OB Copy(Form)
> >>
> >> but it gives a error: “Not supported value in a shared object”.
> >>
> >> Am I, as so often, missing something obvious?
> >>
> >> Jeremy
> >> **
> >> 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
> > **
>
> **
> 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: Stuffing a shared object

2019-07-15 Thread Kirk Brooks via 4D_Tech
Jeremy,
I don't think this would be a good situation for using Shared objects.
Every object in a shared object must itself be shared. There's a lot of
overhead involved in maintaining the various lockers and such.

I would look at using CALL WORKER. Bundle up everything into an object and
pack it off to a worker. When the worker is done the results come back via
CALL FORM. This will be faster and easier.


On Mon, Jul 15, 2019 at 8:27 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a form which accepts some information and, when a button is
> clicked, does some fairly time-consuming calculations which return a set of
> figures. At present, it uses objects with the Form object for input and
> output data.
>
> I’d like to hand off the calculations to a separate process. As I
> understand it, I can’t pass the Form object to the new process but have to
> create a shared object.
>
> How do I get the information from the Form object into the new shared
> object? I’ve tried
>
> $shared.formObj := OB Copy(Form)
>
> but it gives a error: “Not supported value in a shared object”.
>
> Am I, as so often, missing something obvious?
>
> Jeremy
> **
> 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: Stylesheet Search?

2019-07-13 Thread Kirk Brooks via 4D_Tech
Tim,
At the moment style sheets only go away in Projects. I've been working with
Projects and quite a bit with dynamic forms. You can implement an
equivalent of style sheets pretty easily when you're working with the form
JSON directly. In fact you have far better style capabilities. A style
sheet is just 3 properties: font, size and style. But you can set all the
text properties in the object JSON (which is part of the form JSON). So
your own styles could be defined in a file in the Resources folder and
include those properties along with alignment, color, etc. You 'apply' them
to each text object on the form.

The biggest convenience with the current styles is recognizing the
platform. But that's not hard to do. What's missing currently is a way to
identify such a style and associate it with a form object. The thing there
is this is likely to change the dimensions of form objects. I assume
currently 4D just manages that stuff programmatically as it draws the forms
on the screen. I bet how this is ultimately going to work with dynamic
forms is a topic of some discussion.

I think the interface with Projects, as it develops, is going to have some
way to deal with this. At this point it's not even clear if Projects is
going to be the default configuration at some point. I suspect so but I'm
only speculating. Personally I'd like to see a command to manage importing
elements from a Project (like forms, methods, tables) into 'regular' 4D
databases.


On Sat, Jul 13, 2019 at 1:08 PM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> On Jul 13, 2019, at 2:00 PM, Keisuke Miyako wrote:
>
> > stylesheets are deprecated in project mode.
>
> Are you saying in future versions of 4D that Style Sheets will no longer
> be supported?  So what takes their place? How do you assign font, style and
> size to objects that supports macOS and Windows like we do now with Style
> Sheets? I love Style Sheets and I use them EVERYWHERE.
>
> Tim
>
> *
> Tim Nevels
> Innovative Solutions
> 785-749-3444
> timnev...@mac.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: Splitter behaviour

2019-07-12 Thread Kirk Brooks via 4D_Tech
Hi Pat,
Try adding a vertical splitter on the left and right of the area with the
horizontal splitter set to grow vertically.

I have almost always see problems with a splitter placed as you described.
Using other splitters to define the area seems to help.

On Fri, Jul 12, 2019 at 7:35 AM Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Using v17 r5, Mac
> I have a form with a splitter on it. To the left of the splitter is a
> hierarchical list and two buttons. To the right of the splitter are a
> varying number of objects depending on what's being displayed.
> The properties of the splitter are
> Horizontal sizing: move
> Vertical sizing: grow
> Pusher: true
>
> So, I want to make the hierarchical list wider as some of its content is
> hidden. I move the splitter to the right a bit. That's fine.
> Now I expand one of the items in the hierarchical list. The expanded list
> it displayed, but the view of the list shifts to the right so that the left
> side of it disappears off the edge of the form. Nothing you do can make it
> return to normal - the only solution is to close the window and open a new
> one.
>
> Additionally, if I try to resize the window by dragging the bottom right
> corner, instead of making it smaller it makes it bigger! I'm dragging left
> but the window is getting wider! Sometimes it goes really bananas and
> instantly makes the window HUGE.
>
> This is the sort of thing that drives users crazy!
>
> Any ideas?
>
> 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
===

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 Subform Modern UI

2019-06-27 Thread Kirk Brooks via 4D_Tech
Robert,
First off I wouldn't recommend trying to implement any of the new ORDA
style techniques in existing forms. I just don't see any benefit.

So, if you have the opportunity to make a new form to replace an existing
one I recommend spending some time getting familiar with the new Form
object. This completely changes the way you make a form. From there the way
subforms work now is very cool and so. much.easier. Specifically check out
OBJECT SET SUBFORM. With this you can change what's displayed in a subform
object instantly. So you can setup a manner of 'sub' forms and switch them
in the subform object.

There's a bit to learn here if you are just starting in with ORDA but the
payoff is large.

On Thu, Jun 27, 2019 at 3:11 PM Robert ListMail via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Kirk, I’m using Windows v17.2.
>
> The unusual issues with the Subform have been fixed, thanks to Tim Nevels.
> The converted database had fields defined on the included form which did
> not leave enough space for the chosen font size. Converted databases can
> take slightly more room and if there is no room to give than very strange
> behavior ensues. So for now this database will continue to use the old
> subform approach in these Admin only areas… but I’m still curious how you
> might choose to implement this with Listboxes.
>
> Thanks,
>
> Robert
>
> > On Jun 27, 2019, at 4:59 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > What version are you using?
>
> **
> 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 Subform Modern UI

2019-06-27 Thread Kirk Brooks via 4D_Tech
What version are you using?

On Thu, Jun 27, 2019 at 1:55 PM Robert ListMail via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Although, I’ve implemented this in various ways, I’d like to know the
> modern UI approach that you’ve found to be beneficial to your users and
> with an efficient programming effort. How do you handle included subforms
> (on a detailed form)? I’ve replaced an old included form with a new listbox
> object ( that’s populated with a related election of records. When I assign
> a required list to the only field presented in the listbox the selected
> record is not maintained which prevents the delete button from working.
> Also, the interface is a bit clunky since adding new records brings up the
> related table input form… So, how do you approach simple listbox objects to
> manage multiple related records where the acceptable values must be entered
> from a certain list.
>
> Thanks,
>
> Robert
> **
> 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: Complex graph

2019-06-26 Thread Kirk Brooks via 4D_Tech
Ferdinando,
For truly complex graphing you can't beat D3 .

On the other hand for the sort of in-line graphs you referenced I heard a
great hack from David Adams: Unicode U+2588 is a small, black, borderless
square. So you create single line histograms in a text var using this
character.

On Wed, Jun 26, 2019 at 11:59 AM stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> I need to do a graph of type istogram as below.
>
>
> ONE]]
>
> TWO>  
>
> TRE * 
>
> FOUR  + ]]
>
>  24681012141618 20
>
> The histograms must be drawn in horizontal
>
> Someone know a demo that i can to see?
>
> I need to draw some symbols in graph areas.
>
> Thanks
>
> /Ferdinando/
>
> Il 26/06/2019 15:06, stardata.info ha scritto:
> >
> > Hi All,
> >
> > Using 4D V16 or V17 on windows, I have need of to do a complex
> > graphical representation.
> >
> > Does someone know a demo application in 4D that explain the use of SVG
> > or other 4D features that I can see?
> >
> > Thanks
> >
> > /Ferdinando/
> >
> **
> 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: Managing multiple windows in the same process (v17r5)

2019-06-26 Thread Kirk Brooks via 4D_Tech
Hi Chris,
Good questions. Here are my thoughts on them based on what I've picked up
from the World Tour and Summits.

On Wed, Jun 26, 2019 at 12:31 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> 1) What is the reasonable limit as to how many windows/dialogs should get
> opened in the same process?
>
This is going to be limited by the resources available to 4D. A laptop with
the minimum RAM and processor is going to have a lower limit than a nice
new Mac Pro by a long way.

But there's no reason to be opening a huge number of windows. A window is
really a UI portal as it were. We no longer need to hack certain operations
with 'offscreen' or 'hidden' windows so a good design should open a window
for something useful.

On top of that now it's really easy and fast to completely repurpose what a
window is 'doing' anyway. You could design a window interface to be a lot
like the OS window interfaces are - you display something and then
completely change it based on a user action. But now we could revert to any
previous window content like the back button on a Finder window. You would
have to retain the displayed form and the Form contents but with that info
you could reload a past window.

So I think this is a case where the technical limit on the number of
windows is less important than building a good design for the interface.


> 2) do windows that share the same process also share processing time? What
> I mean is: If window A is executing, does window B have to wait until
> Window A is done before any processing it does would start (think CALL FORM
> ( window ) )?
>
> For example: Window A is doing a QUERY that takes a few seconds. Does that
> make Window B (in the same process) unresponsive until Window A has
> finished the QUERY?
>
Prior to preemptive processes each instance of 4D ran on a single core of
the machine. How the CPU cycles were allocated and prioritized was between
4D and OS. To us it looked like multiple processes were running 'parallel'
but it was all happening on a single core. The only way you could truly
have parallel processing was by using server side processes or EXECUTE ON
CLIENT and each of those instances were limited in the same way.

With a preemptive process you can truly have different processes running
concurrently on different cores. Thomas Maul has some great demos of this.
If you aren't a Partner (they may be walled off from non-partners) check
out a presentation he did for 4DMethod . He also
includes a demo of why pre-emptive processing only matters on actual
hardware, not virtualized machines. I forget if that's in the 4DMethod
preso or I saw it at a Summit. Bottom line: preemptive is meaningless on a
virtual machine because the virtual machine is running virtual cores and
then entire virtual machine is running on a single instance of the host
machine. So, if you plan to deploy on AWS or the like don't worry about
preemptive, just use CALL WORKER.

So all the windows in the UI process will work, essentially, like the
windows in the separate processes we used to use. 4D has optimized things
like query a lot, for example. And the speed is improved significantly. I
hear in v18 ORDA may be as fast as classic 4D queries.


> 3) I used separate processes before because it was possible to do
> ‘parallel processing’ that way. Because windows were in separate processes,
> anything one window was working on would not impact the responsiveness of
> other windows.
> Is it still advisable to break out windows under its own process if it may
> need to do substantial processing at times?
>
It would be better to break out the heavy operations using CALL WORKER.
This is really what it's designed for.

Underlying all this is the question of memory management. I have the
impression 4D is committed to optimizing memory use. New process

recommends 0 for the stack size, "Pass 0 in stack to use a default stack
size, suitable for most applications (recommended setting)." The docs go on
to say the size is not total process memory and is influenced by things
like number of windows, number of forms, and so on. This isn't anything new
and doesn't address the situation you start off asking about.

I expect the memory allocation when you pass 0 stack size has been
addressed but it would be good for someone closer to the engineering team
to weight in on 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: Dialog (;*) question

2019-06-25 Thread Kirk Brooks via 4D_Tech
Hi Peter,

When you call DIALOG(*) the dialog opens in the current process. But as you
saw execution continues on. The solution is to make a DIALOG call by itself
first and open the subsequent windows from there.

The suggestions I've heard are to think about having a single UI process.
This initial dialog could be something really simple, like a small palette
or it could be a big window. That doesn't really matter. The change in
thinking is we open new windows from here for things that we would spin up
a separate process for in 4D classic.

What about memory management? you may think. Well, this approach is
probably best suited for working with ORDA and minimal reliance on process
variables. If you are using ORDA the great majority of the data you are
working with are actually references and 4D is super optimized for working
with this.

Hope this helps.

On Tue, Jun 25, 2019 at 6:45 AM Peter Bozek via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I maybe already asked this question, but anyway I am still a bit confused:
>
> I wanted to use DIALOG with * as an additional parameter, but have problem
> to make it work. I have app that display several info windows - like
> palettes, progress messages, communication statuses etc.Currently, I often
> need 2 processes for each task: one does the work as background task,
> another display it status / progress.  So instead of running a separate
> process for each window, why not to use one process that will display
> whatever windows application wants to display? Or display status from
> inside background process that do communication or lengthy task.
>
> My original idea was to call
>
> OPEN FORM WINDOW
> DIALOG(;*)
> PAUSE PROCESS
>
> but that does not work, as the process execution is "standing" at PAUSE
> PROCESS and no code is executed (and CALL FORM is either not executed or
> window is not redrawn.)
>
> When I remove PAUSE PROCESS, process ends and DIALOG window is closed.
>
> According to documentation, it would work of I do
> OPEN FORM WINDOW
> DIALOG(;*)
> DIALOG()
>
> but that is quite ugly, and would cause some problems, as I want the
> process that calls DIALOG(;*) periodically evaluate which windows are open
> and close itself if none.
>
> Another possibility is just to open window and call DIALOG(), then call
> DIALOG(;*) from inside the form method of the first DIALOG() form. That
> would (probably) work, form can use On timer event to check what is open,
> open additional dialogs etc. but I do not like the idea either.
>
> Is there a way how to use DIALOG(;*)  from a process that does not have any
> other window open?
>
> Regards,
>
> --
>
>
> 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: Select document command and .4lbp files

2019-06-24 Thread Kirk Brooks via 4D_Tech
Jeff,
Sorry, I didn't read your original email closely enough.
I just updated the code I posted to:

$DocType:="com.adobe.pdf;com.4d.4d.labelFile;.jpeg;.txt;.text;.csv;.json"


I was able to select both a PDF and a label file I just created. Perhaps
there is some sort of permission block? Or, how were the files created?
Maybe the system thinks they are something different?

-- 
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: Select document command and .4lbp files

2019-06-24 Thread Kirk Brooks via 4D_Tech
Jeff,
I have only had luck using Select document when the file types are separate
by semi colons. Here's an example from working code:

*C_TEXT*($doc;$DocType)

*ARRAY TEXT*($aDocs;0)

$DocType:=".pdf;.jpg;.jpeg;.txt;.text;.csv;.json"

$Doc:=*Select document*(*System folder*(Desktop);$DocType;"Select the
document:";0;$aDocs)


I know it's contrary to the docs but it's what's worked for me.


On Mon, Jun 24, 2019 at 12:01 PM jeff--- via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> In 4D v17.2 on MacOS 10.14.3, I am attempting to open a 64-bit label
> format file using Select document. I am passing "com.4d.4d.labelFile" in
> the fileTypes parameter but all such files are greyed out and disabled.
>
> --
> Jeff Grann
> SuccessWare, Inc.
>
> **
> 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: Developing Using Selector Methods

2019-06-20 Thread Kirk Brooks via 4D_Tech
Hi Narinder,
I have some thoughts.

To start, with v17 the whole concept of what a form is in 4D is
fundamentally different. I'm talking about building new forms, here, not
tweaking existing ones. One important change is ditching process variables
as form elements. Just stop. Buttons, fields, variables, and so forth do
not need to be in process variables any longer. In fact using them becomes
a liability if you attempt to use the new DIALOG(*) command. And you should
be using this because unlike our previous best-practice of opening new
windows in new processes the thinking now is to have few, like 1, process
for displaying data and opening multiple windows as needed within that
process. I still see a lot of examples coming out of 4D, even 4D technical
support, that use this old approach. I think it's old hands still doing
what's worked and they are in a hurry. Process vars are just not a good
idea on new forms.

But what about the Current Selection and table locking and all? These are
not concerns with ORDA. And if you start opening multiple forms in the same
process and these forms use process vars for buttons or things the value of
all those buttons (but not the Form event) all change each time you change
one. So, ditch the process vars on forms. In fact with an ORDA database I
rarely have more than a handful of process vars at all. What I do always
have is a single object process var and I use this for any process level
data that needs to persist. I use this as my own process data-store instead
of dozens (hundreds) of distinct vars. A lot of code I look at shows an
almost superstitious view of variable handling in 4D that seems to suggest
there is a hierarchy of variable stability starting with IP vars (most
stable) down to local vars (most volatile). I do not believe that has any
basis beyond very old programming habits of 4D devs. But we can probably
have another discussion about that topic alone. ;-)

The other truly radical change in forms is Form.
https://doc.4d.com/4Dv17R5/4D/17-R5/Form.301-4128553.en.html
The significance of Form to the way you setup a 4D form can not be
overstated. And very little of your understanding of forms from pre v17
programming really applies. It will still work, of course, but using Form
and ORDA you can achieve results on a form that would require a lot of
coding to manage using 4D classic. Sometimes I sat back after getting
something to work and just marveled because the actions were so profound
and there was no code - only the setup of the form and the data it worked
with. The blog has some good examples. One I studied a lot is here:
https://blog.4d.com/multilevel-collection-in-different-listboxes/

But getting back to some specifics of your question, I have argued for a
long time about the value of using a 'form controller' method on forms. I
put all the code for the form into that project method and include that
single method in any form object and the form method. You can identify what
object invoked the method using OBJECT get name. It's basically one big
Case of statement with each object identified by name with whatever code
that object needs. And you can add other actions shared by objects on the
form.

I still use this on complicated forms but I've noticed much less need for
object level code with ORDA. Having a single method is also useful, pretty
much required, to take advantage of Dynamic Forms since the 'method'
property of a dynamic form only accepts a project method, you can't include
code. Dynamic Forms are quite useful. They can be applied to a subform
object or a form opened with DIALOG. Managing various complex listboxes,
for example, is a lot easier with dynamic forms than building them in code.
Faster too. For example, I can design my listboxes in a temporary form and
then use FORM Convert to dynamic to get the code for it, save it to a file
and then load it into a subform when needed. Switching between various
listboxes in the same subform becomes simple. And there is no data loading
because the data are already referenced in Form. In classic 4D
accomplishing this sort of thing would require large methods to build the
listboxes and lots and lots of arrays to manage. And it would be really
difficult to change later on.

I really encourage you to take advantage of coming back to 4D to approach
it as a new environment. Unless you are angling to support old projects
don't worry about how we were doing things 15 years ago. Focus on the new
stuff and run with it. That's where the platform is headed. And it's just a
lot more fun, too.



On Thu, Jun 20, 2019 at 7:48 AM Narinder Chandi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm wondering, who out there is still actively developing using selector
> methods?
>
> For a long time now (way back since v6, perhaps even before that...) I
> have tended to encapsulate all of my code into Project Methods such that
> Form and Object level methods consist of nothing more than a Case...End
> Case block of Form

Re: Arrays in objects

2019-06-10 Thread Kirk Brooks via 4D_Tech
Jeremy,


On Mon, Jun 10, 2019 at 12:22 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> What I was hoping to do was to build a couple of text arrays in a method;
> return them in an object; and then use them directly in calls to HTTP
> methods, something like this:
>
> C_OBJECT($headers)
> $headers:=BuildHeaders // returns object containing matched arrays
> $status:=HTTP Get($url; $response; $headers.names; $headers.values)
>
> Is that possible, or must I extract the names and values arrays from the
> returned object before use? I’m using v17R4.
>
Everything you describe is possible - it's just not clear how you want to
do it.

Assuming by 'headers' we're talking about basic key:value pairs the thing
to do probably depends more on how you are sending the data to wherever.
You could build a single header object like:

{ "someHeader":"the header value", "anotherHeader": "another value", ...}

or you could put each key par into an object in a collection:

$headerCollection.push(new object("someHeader";"the header value"))
$headerCollection.push(new object("anotherHeader";"another value"))


It depends more on how you're going to send it off. If you're using older,
established methods there may not be a big advantage to implementing this
and just sticking with building arrays. HTTP Get is still looking for text
arrays as an input so I'd go with whatever is easiest give the data you are
pulling from.

I will say that using an object as a sort of associative array, that is:
the property names are the header names, is very easy to work with and
convert to text arrays. Just be aware of issues with spaces in the header
names - they can cause issues if you use them as object property names.

Hope this helps




>
> Jeremy
>
> > On 10 Jun 2019, at 19:47, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Jeremy,
> > Depends on which version you are using. If you are in v17 then 'arrays in
> > objects' are essentially gone. They are collections now and you can use
> dot
> > notation with collections.
> > Otherwise, yes 'arrays' are still arrays within the object.
> >
> > It's possible to mix the nomenclatures in v17. You _can_ define an object
> > as use OB SET ARRAY but there is no advantage to doing so. It's much
> better
> > to use collections.
> >
> > C_OBJECT($o)
> > $o:=New object
> > $o.array:=New collection
> >
> > $o.array.push(1) // $o: {array: [1]}
> >
> >
> > $x:=$o.array[0]  //  $x = 1
> >
> > If you have some array of longints you want to append you can call OB SET
> > ARRAY($o;”array”;$arrayOfLongs) without an error and it will be a
> > collection.
> > You could also call ARRAY TO COLLECTION($o.array;$arrayOfLongs)
> >
> >
> > On Mon, Jun 10, 2019 at 11:37 AM Jeremy Roussak via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Are arrays within objects rather second-class properties? I know that I
> >> can put an array into an object using OB SET ARRAY, and I can retrieve
> it
> >> (all of it) using OB GET ARRAY, but is that all?
> >>
> >> Can I use dot notation to refer to the arrays themselves, or to
> individual
> >> elements of the array?
> >>
> >> C_OBJECT($o)
> >>
> >> $o:=New object
> >> OB SET ARRAY($o;”array”;$arrayOfLongs)
> >>
> >> $o.array{1} - error
> >> $o.array - error
> >> $o[“array”] - error
> >>
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ===
> >
> > What can be said, can be said clearly,
> > and what you can’t say, you should shut up about
> >
> > *Wittgenstein and the Computer *
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
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: Arrays in objects

2019-06-10 Thread Kirk Brooks via 4D_Tech
Jeremy,
Depends on which version you are using. If you are in v17 then 'arrays in
objects' are essentially gone. They are collections now and you can use dot
notation with collections.
Otherwise, yes 'arrays' are still arrays within the object.

It's possible to mix the nomenclatures in v17. You _can_ define an object
as use OB SET ARRAY but there is no advantage to doing so. It's much better
to use collections.

C_OBJECT($o)
$o:=New object
$o.array:=New collection

$o.array.push(1) // $o: {array: [1]}


$x:=$o.array[0]  //  $x = 1

If you have some array of longints you want to append you can call OB SET
ARRAY($o;”array”;$arrayOfLongs) without an error and it will be a
collection.
You could also call ARRAY TO COLLECTION($o.array;$arrayOfLongs)


On Mon, Jun 10, 2019 at 11:37 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Are arrays within objects rather second-class properties? I know that I
> can put an array into an object using OB SET ARRAY, and I can retrieve it
> (all of it) using OB GET ARRAY, but is that all?
>
> Can I use dot notation to refer to the arrays themselves, or to individual
> elements of the array?
>
> C_OBJECT($o)
>
> $o:=New object
> OB SET ARRAY($o;”array”;$arrayOfLongs)
>
> $o.array{1} - error
> $o.array - error
> $o[“array”] - error
>

-- 
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: Open a v17 data file when Structure is unknown

2019-06-08 Thread Kirk Brooks via 4D_Tech
Jorg,
Sorry, I missed the bit about the compiled structure. Sounds like a
difficult situation. But if you have access to user mode exporting all the
data is as good a solution as any, really.

It's slow doing the export but you only have to do it once.

On Sat, Jun 8, 2019 at 6:31 PM Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi Kirk,
>
> As mentioned in an other post the client has a compiled structure, but the
> guy the business was bought of refuses to hand over the source code. The
> funny thing is the business is based on and depends on that application,
> meaning no application/data no business.
> It is possible to go to the user environment and export all that stuff
> manually.
> But this is not my problem any more at least for a long time I hope.
>
>
> > On 9 Jun 2019, at 01:36 AEST, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > In general I think 4D's tightening up of data security is a good thing.
> Yes
> > it creates headaches when good people do stupid things but on the whole
> is
> > a better architecture by limiting opportunities for bad people to do bad
> > things by intent.
>
> I couldn’t agree more.
> I personally go a step further by not allowing the data to be opened on a
> different computer even if the structure is a 100% match.
>
> I like the prospect to be able to encrypt tables/content, as long as it is
> my choice what table(s) are to be encrypted.
> The idea to do such thing on record level is on my “to do later list” for
> a while now.
>
> Thanks again for all the input.
>
> 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: Open a v17 data file when Structure is unknown

2019-06-08 Thread Kirk Brooks via 4D_Tech
Jorg,
Well, one man's 'data rescue' is another man's 'data breach'. Frankly it
sounds a little hinky that a client would have a lone datafile and no clue
about where the structure file is or who created it. But I have run bars
and restaurants in my past and am suspicious of stories like that.

In general I think 4D's tightening up of data security is a good thing. Yes
it creates headaches when good people do stupid things but on the whole is
a better architecture by limiting opportunities for bad people to do bad
things by intent.

FWIW - I recall JPR admonishing us at a Summit a few years ago regarding
the 'security' of the proprietary datafile. To paraphrase, "you may think
your data is somehow encrypted in there. IT'S NOT!" So the file could be
analyzed and data recovered. This also changes in v17r5 (I think) where we
can now encrypt tables.

On Sat, Jun 8, 2019 at 7:41 AM Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> NOW, the new “WEDD” is integrated and the developer is fu, if he has
> to do some kind of data rescue.
>
> It doesn’t matter what algorithm and/or encryption is used by 4D to
> realise that “New WEDD” function, disturbing is , that 4D did not inform
> the developer community in detail about those changes.
>

-- 
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: Open a v17 data file when Structure is unknown

2019-06-08 Thread Kirk Brooks via 4D_Tech
Jorg,
As I recall the WEDD was a simple string supplied by the developer. I never
looked into how, or if, 4D used that string to create anything more complex
like a hash.

On Sat, Jun 8, 2019 at 12:37 AM Jörg Knebel via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Since this project turned into a kind of academic one, what is the “New
> WEDD Resource” based on or are these information classified as “Burn before
> reading”?
>

-- 
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 to v17 Conversion of Obsolete _o_C_STRING/_o_ARRAY STRING Commands

2019-06-07 Thread Kirk Brooks via 4D_Tech
Hi Narender,
Welcome back.

Changing the variable declarations is a simple regex exercise. In fact I
think 4DPOP may have a command in it already for doing so. If not it's not
too difficult to write a method to loop through all the code, find the old
strings and replace them.

I don't have any code on hand at the moment but a REGEX pattern like:

"_o_.+STRING \(\d+;"

will find either declaration. The "\d+;" bit deals with whatever number is
present as well as the extra ; you won't need.

Then you can pull that substring and see if it contains "ARRAY" and know
what to replace it with:

"ARRAY TEXT ("
"C_TEXT ("


Hope that helps.

On Fri, Jun 7, 2019 at 8:49 AM Narinder Chandi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi all. I am migrating a v15 database to v17, 4D Server running on Mac. I
> need some opinions as to what to do with regards to converting commands
> marked as obsolete as per this article:
>
>
> https://doc.4d.com/4Dv15/4D/15/Deprecated-or-removed-features-in-v15-product-range.200-2063067.en.html
>
> I have been addressing them by theme, and in some cases the conversion is
> straight forward, e.g. _o_ENABLE BUTTON/_o_DISABLE BUTTON is replaced by
> OBJECT SET ENABLED whilst some others can be removed completely, e.g.
> _o_REDRAW LIST.
>
> I am now looking at how to deal with the obsolete Compiler theme commands
> _o_C_INTEGER, _o_C_STRING and _o_ARRAY STRING.
>
> _o_C_INTEGER I have simply replaced with C_LONGINT as the docs state that
> "...4D and the compiler retype Integers into Longints internally."
>
> However, I am conflicted as to how best to deal with _o_C_STRING and
> _o_ARRAY STRING which are replaced by C_TEXT and ARRAY TEXT respectively.
> The docs state "The operation of the [_o_C_STRING/_o_ARRAY STRING] command
> is strictly identical to that of the [C_TEXT/ARRAY TEXT]". Of course the
> string length parameter in the obsoleted commands makes the conversion
> non-trivial and code will need to reviewed for any functional regressions,
> e.g. in relation to database fields of type String where the length can
> still be defined (auto-truncation may not be the desired/intended
> behaviour!).
>
> I have searched the archives on this topic but opinions seem to be divided
> on whether or not to do this conversion? Perhaps I am mistaken, but I am of
> the opinion that it will have to be done sooner or later as 4D reserves the
> right to remove obsoleted commands and will eventually do so?
>
> TL;DR the options are:
> 1. Replace
> 2. Do nothing for v17
>
> Thoughts?
>
> I will deal with my questions and options regarding Subrecords in a
> separate email!
>
> Regards,
>
> Narinder Chandi,
> ToolBox Systems 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
===

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

Tips on reading email from gmail?

2019-06-04 Thread Kirk Brooks via 4D_Tech
Hi folks,
I know I've seen this subject passing by but can't seem to find it when I
need it. So, is anyone willing to share some tips about reading email in a
gmail account? Specifically I want to use IMAP.

Thanks

-- 
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: Anyone using zipcodeapi

2019-06-01 Thread Kirk Brooks via 4D_Tech
John,
I've been using SmartyStreets for several years. It's very easy to connect
with and the folks who run it are extremely helpful and friendly.

I looked at the website for zicodeapi.com and notice the service is less
expensive and offers a number of APIs for working with zip codes. It's a
solid suggestion.


On Sat, Jun 1, 2019 at 10:06 PM JOHN BAUGHMAN via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Actually since I am in the early stage of development any suggestions in
> this regard are welcome. I see another web based Zip Code site call
> SmartyStreets. That would work as well.
>
> So any other suggestions would be greatly appreciated.
>
> Thanks,
>
> John
>
> > On Jun 1, 2019, at 3:07 PM, JOHN BAUGHMAN via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Is anyone using zipcodeapi.com  to fill in city
> and state fields in a 4D database? Would you be willing to share your code?
> >
> > Thanks,
> >
> > John
> >
> >
> > John Baughman
> > Kailua, Hawaii
> > (808) 262-0328
> > john...@hawaii.rr.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: I've not seen this before

2019-05-29 Thread Kirk Brooks via 4D_Tech
Bob,
A project I'm working on has recently found that there can be issues
editing files, especially large files, directly on the server. Microsoft
and Adobe in particular but it seems true of any complex or large file. The
best practice, specifically mentioned by Adobe for one, is to copy the file
from the server to the local drive, makes changes, save it and then copy it
back. I can't tell if this is relevant to this particular case but it might
be.

I like Pat and Chip's points too. There are a lot of things involved in the
scenario you describe.

On Tue, May 28, 2019 at 5:50 PM Robert McKeever via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> A client reports that Windows did an update last night.
>
> Today, when importing one of the billing extract files (CSV format), he
> get the following error from 4D:
>
> “The volume for a file has been externally altered so that the opened file
> is no longer valid.”
>
> Sometimes the radiologists like to edit the file before importing it (I
> suggest otherwise, but that’s what they like to do). I think the error
> comes from his having edited the file, and left it open in the editing
> program before importing it.
>
> Any other ideas?
> _
> Bob McKeever  http://www.mswl.com <
> http://www.mswl.com/>
> McKeever's Software Wizardry
> Port Coquitlam, B.C.
> bobmckee...@mac.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: creating a plain text document from within 4D

2019-05-27 Thread Kirk Brooks via 4D_Tech
Hi ernie,

Reading this it seems like you are trying to do two different things at the
same time. The snippet you pasted looks like Styled Text. But you say you
want a "plain text" document. But you also say you want to text to look the
same way it does on the screen.

You can't have it both ways, I'm afraid. Plain text means just that - only
the text. No formatting or anything. If you want the formatting you want to
either look at Rich Text Format (RTF) or think about 4D Write Pro. If you
want just the plain text you need to remove the styling before you write it
to disk. ST get plain text

will help you with that.

Text to document is the suggested way to write the file.

On Mon, May 27, 2019 at 2:59 PM ernest hilgers via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> the dialog-window has a button "Save" that needs to save what's in that
> text variable vMessage_t
> (visible to the operator in the dialogwindow) to a plain text document.
> The idea is, the content of the text file should look like what's seen on
> screen.
>

-- 
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: Injecting Forms from a component

2019-05-23 Thread Kirk Brooks via 4D_Tech
John,

On Thu, May 23, 2019 at 10:28 AM John DeSoi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> > Can you inject a form from a component into a host system?
> > if so - how?
>
> Not possible as far as I know. In theory it will be possible with version
> 18. With version 17 you can use dynamic forms to some extent, but doubt you
> can get everything working the same as a form created in the design
> environment.
>
The only thing I've found that you can't do with a Dynamic Form is write
code into the 'method' property - you can only call a project method. But I
haven't thought object code was a good idea for a long time. I've exported
some very extensive forms from old databases using FORM Convert to dynamic and
it all comes over.

I seriously doubt 4D is going to invest any more resources in supporting
the classic structures beyond compatibility. So something like moving a
form is not likely to happen.

Besides, the use case Chip describes is really a perfect example of using
dynamic forms. They could be included in the component as JSON files or
hard code. The files would be better, I think, but either would work. The
definition files could either be accessed directly from the component of
written to the Host db's Resources folder. As I think about it coupled with
the improvements in PROCESS TAGS and 4DEVAL you could launch a whole
process with its own form from static disk files.

-- 
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: Benefits of 64-bit 4D Remote

2019-05-23 Thread Kirk Brooks via 4D_Tech
Tom,
I think this is a germane and timely question. It correlates with the 'if
it isn't broke don't fix it' rule of thumb and is particularly relevant to
the 4D community because of the longevity of many of our projects. In your
case you have probably done all you can. There doesn't appear to be any
technical reason for changing the clients -right now-. So let them be.

They may be able to exist happily in 32 bit land for years to come. Or it
may go sideways in six months. By making the change now you can do it in a
more controlled way. The day after something breaks it's more of a crisis
(aka: expensive). You can't necessarily say when it will matter but you can
confidently say one day it will matter. All you can do is recommend.

Frankly any given 4D server deployment has come to look to me more like a
floating river party. we've got a big house boat (4D server) surrounded by
various speed boats, canoes, kayaks and folks on inner tubes all loosely
roped together happily bobbing along. The argument for keeping everyone
updated is that the river keeps changing and the whole party keeps moving,
however slowly, along. The 'river' is the technological environment. A 20
year old 4D db is most likely running in a different environment than it
was written in. Might matter, might not. If the deployment has Macs in the
mix the imperative to update regularly is more pressing because Apple, for
better or worse, is not sitting still. The next OS is going to be 64 bit
only. 4D is going to be 64 bit only. More and more things are going to
become 64 bit only or depend on something that is. If a company exec uses
Macs odds are pretty good some weekend they will update their machine and
*poof* there goes 4D. More likely will be changes in security protocols
that will catch up with them. And the factor that drags the bottom of this
river is new hardware delivered with the newest OS at the time. There are
companies that simply refuse to change. I still see some outfits with some
old 8086 terminal, complete with amber phosphorescent displays, for just
this reason sitting next to the other computer that does everything else.
Very rare anymore. And very brittle but hey, if it ain't broke...

-- 
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: Webarea Embedded rendering engine show blank pages in 64-bit

2019-05-08 Thread Kirk Brooks via 4D_Tech
Piotr,
I also generate the webarea content on the fly and never found generating
the temp html files an issue speed wise. The processing is exactly the same
leaving on the time to write the file to disk. I added a routine to startup
to clear out the temp folder. It also gets cleared whenever you update the
resources folder on the server.

On Wed, May 8, 2019 at 9:16 AM Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Maybe you, or someone else, know of good reasons why this shouldn't work
> with Blink on 4Dv17 64-bit?
>
Nah, that's above my pay grade and frankly I don't care why. I don't find
any particular advantage to use WA SET PAGE CONTENT and the issues and
oddities, just like these, put me off using 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: Webarea Embedded rendering engine show blank pages in 64-bit

2019-05-08 Thread Kirk Brooks via 4D_Tech
Piotr,
I use web areas quite a lot. WA SET PAGE CONTENT is tricky to make work if
it's not initialized and generally not on the first page. I create pages on
disk instead in a WA folder I setup in Resources. This also gives me a
place to store Assets (CSS, JS, etc.) I use in the pages. Writing the pages
to disk also lets you troubleshoot them in an actual browser which can be
helpful during development. It also gives you the option to design a
default page for your web areas.

On Tue, May 7, 2019 at 11:21 AM Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> Tested on Windows
>
> In 4Dv17R4 32-bit I have some html pages that are shown in a Webarea
> Because I need "Access 4D methods", I use the embedded rendering engine
> Also, I like to use the embedded rendering engine in 64-bit because of
> Blink
>
> However, when using embedded rendering engine, the pages (that work in
> v17R4 32-bit) don't show in 4Dv17R5 64-bit
> When NOT using the embedded rendering engine the pages show up, but I
> can't use the "Access 4D methods"
>
> What could be the problem?
>
> Thanks,
> 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 Form Events

2019-05-06 Thread Kirk Brooks via 4D_Tech
Hi Chris,
I apologize for such a late response. I left on a road trip about the time
you sent this and frankly forgot to get back to you. Your enthusiasm is
infectious. And you describe some excellent applications. I haven't played
with OBJECT SET LIST BY REFERENCE yet... Thank you for the tips.

And I completely agree about reviewing the whole menus thing. I work on
some old projects with these insanely complicated schemes for menu bars and
it is just so much wasted time and effort to accomplish so little. It was
what was available 25 years ago but jeez I'm glad to be past that.

I wonder if you would elaborate on how you use [UI_class] and [UI_object]?
I have played with the concept a little but I fear I am over complicating
it to no good effect.

In addition to 4D POP David Adams and Cannon Smith shared some methods for
creating constants with code. I was a little skeptical at first of this
approach - writing a method to write an XLFF file for the constants but
I've come to prefer it. Mainly because in that method I can comment what
each constant is for. And once you do a couple of them it's quite easy.

In v15 I came to rely on constants for object property names. Just a great
way to deal with the need for consistency. With native dot notation you can
use them with [[brackets]] but I'm not as big a fan. On the other hand
without them there is a real issue about ever changing a property name. Or
a field name.

Of late I'm mucking around in v15. Looking forward to spending more time
again in v17r5.
-- 
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 V15 crash

2019-05-04 Thread Kirk Brooks via 4D_Tech
Bob,
Tech support 101:

Is it plugged in?

When was the last time you restated it?

It's easy to forget why that has become cliched. I may well be using that
myself today, as I think about it...

On Sat, May 4, 2019 at 9:59 AM Robert McKeever via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> And, the reboot fixed whatever was bothering it. Runs fine now.
>
> > On May 4, 2019, at 8:07 AM, Robert McKeever via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > My son is a software engineer at Apple. I passed him the crash log last
> night. He could not find anything obvious. He mentioned something about
> converting a URL format.
> >
> > Then I copied the entire setup to my MacBook Air. First time to open, it
> crashed. I then rebooted the MacBook. The app started up just fine. So, I
> rebooted the client machine which loses my Teamviewer connection. I’ll get
> it setup later today and see what happens.
> >
> >> On May 3, 2019, at 9:53 PM, John DeSoi via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >>
> >> Look at the crash log (should be in ~/Library/Logs/DiagnosticReports).
> It often gives helpful clues about what is causing the crash.
> >>
> >>
> >> John DeSoi, Ph.D.
> >>
> >>
> >>> On May 3, 2019, at 8:11 PM, Robert McKeever via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >>>
> >>> My client (4 time zones away), had been running the single user
> compiled and merged app under windows. Then he purchased a new Mac. It is
> running 10.14.3, I’m running 10.14.4. I have moved the appropriate mac app
> files to his machine, along with the datafile and index file from his PC.
> >>>
> >>> 4D crashes on startup.
> >>>
> >>> Then I had him add a printer. Tried again. No  luck.
> >>
> >> **
> >> 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
> >> **
> >
> > _
> > Bob McKeever  http://www.mswl.com <
> http://www.mswl.com/>
> > McKeever's Software Wizardry
> > Port Coquitlam, B.C.
> > bobmckee...@mac.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
> > **
>
> _
> Bob McKeever  http://www.mswl.com <
> http://www.mswl.com/>
> McKeever's Software Wizardry
> Port Coquitlam, B.C.
> bobmckee...@mac.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: Data Merge from v13 to v15

2019-05-01 Thread Kirk Brooks via 4D_Tech
Ronnie,
I was just reading through the thread here. I did a similar migration when
I moved a database from v2004 to v13. In that case the v13 database was a
major re-write of the original. There were significant differences in the
new structure including removing a couple of subtables. And there was even
a case where data from two tables were collapsed into a single one
requiring some careful attention to the ID numbers. As I say, it was a
rewrite.

My approach was to build the export methods in the old database. It's much
easier to manipulate that data in its own environment. Set up the export
methods to created documents that can be imported into the new tables. I
included setting/synching ID numbers in this operation. You can use SET
DATABASE PARAMETER to correct id sequence numbers after import. Some tables
may export as is. Great. Do it using the same process anyway. I found it
easier to resolve structure issues in the old db during the export than
anywhere else.

This is also a chance for you to clean up things like created/modified
fields that may be different in the new db.

On the import side you need to pay attention to setting a flag that your
trigger methods check if you have a lot of processing going on there.
And you can manage any other conversion chores that you couldn't manage on
the export side.

I used simple tab/cr export files. If you have text fields that may include
tabs or CRs encode them on the export side (I use  and  to keep it
simple) and decode them on the import side. I prefer this to CSV simply
because CSV can get tricky with text fields containing quotes.

I found this process useful. As I said it's easier to do transformations
and make changes to the data on the export side. Putting your data into
files that can be more or less directly imported helps you spot errors
pretty quickly. And I found it much easier to write import methods that
dealt with the data in the context of the new structure. Granted you may
wind up with some pretty slow methods. But they only need to run once. And
the importance of accuracy outweighs the time. At least in my case.


On Mon, Apr 29, 2019 at 11:53 PM Ronnie Teo via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> A client has requested to decommission  a v13 database and merge the data
> into a separate v15 database.
> The 2 database structures started the same (as in same tables and fields)
> but has expanded in different directions down the years.
> It would be fair to say that the fields in the v13 structure would be a
> subset of the v15 structure.
>
> A send/receive record option would not be feasible.
> Tinkling with some ideas, perhaps exporting table data to CSV file (from
> v13) and import into v15.
> Or perhaps just exporting individual tables (individual) fields to text
> files with custom delimiters….
>
> What would be the best way to accomplish this?
>
> Regards,
> Ronnie
> Tarawerkz
>
> **
> 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: Form and DIALOG

2019-04-29 Thread Kirk Brooks via 4D_Tech
Jeremy,

In the situation you describe I initialize the object that will be passed
to the Dialog first. Like so:

$formObj:= New object("listbox_1";New
Collection(100;200;300);"someObject";New Object("foo";"Hello world")
DIALOG("MyDialogForm";$formObj)

//  Dialog is closed and $formObj contains any/every thing added to it or
edited in the Dialog


This also allows you to configure what's going to be in Form. Such as
various entity selections, lists or what not. In the example above your
form could have a collection based listbox whose datasource is
'Form.listbox_1' and it could display the 3 numbers. You could set this up
in the On Load form event also, of course.

And it works in a similar way with a subform:

$subformObj:= New object("listbox_1";New Collection(100;200;300))
Object get pointer(Object named;"subform_object")->:=$subformObj
OBJECT SET SUBFORM(*;"subform_object";"MyDialogForm") // subform_object is
an object type var

// formObj contains any/every thing added to it or edited in the subform


When the subform object is itself an object or collection Form, in the
context of the subform, takes on the value of the subform object.
The great thing about this is that the code for the actual 4D form runs
identically whether it's in a dialog or a subform at least with respect to
Form (the function).

But wait, there's more.
In the example right above let's say instead of $subformObj being a new
object I assign it some object already in the parent form:

Object get pointer(Object named;"subform_object")->:=Form.someObject
OBJECT SET SUBFORM(*;"subform_object";"MyDialogForm")


Now in the context of the subform Form contains a 'reference' (say that
with an accent like JPR) to 'someObject' which was originally defined
before the dialog was loaded. Let's say the user changes 'foo' to "Hello
everyone".
In the subform:

Form.foo = "Hello everyone"

In the parent form:

Form.someObject.foo = "Hello everyone"


I think this gives a whole new value to subforms. I can design forms to
deal with a particular task or set of data and use them as a dialog or open
the within a dialog without having to change the code. Have you ever wound
up, or come across, a form with 10+ pages? These are ugly and difficult.
Instead you could have one page with a subform.


And gee we could use some more words for describing these things.

On Mon, Apr 29, 2019 at 1:05 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Is it safe to use the object returned by the Form command as a means of
> passing data back to the caller? That is, should the method of the form
> opened in DIALOG regard its Form object as read-only, or is it allowed to
> alter it?
>
> At present, changing the values of the object passed by DIALOG works: the
> new values are available to the caller when the DIALOG command returns.
> It’s quite handy. But there’s nothing in the documentation, as far as I can
> see, to indicate whether this is sanctioned or likely to change.
>
-- 
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
**

How to use collection.query for specific element of embedded collection

2019-04-26 Thread Kirk Brooks via 4D_Tech
Imagine a collection or entity selection populated with objects like:

{

id: "some string",

fields: [

{i:0, name:value1},

{i:1, name:value2},

{i:2, name:value3},

...

]

}


I want to find collection elements by searching for 'fields[1].name' =
someValue.
That is, only matches on the second element.

I thought the query string would be:

$queryString:="fields[1].name = :1"


But this throws an error:

Array element reference must be a letter in the object path: fields[1].


The query works without attempting to limit it to the particular collection
index.
What's the correct syntax for this kind of query?

Thanks!

-- 
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 Form Events

2019-04-25 Thread Kirk Brooks via 4D_Tech
Chris,
Thanks for the insight. It sounds like you are working with classic 4D code
(even if you're using v17). Let me encourage you to think about re-writing
your form using v17. I think most of the issues requiring elaborate
workarounds won't be necessary.

Positioning objects on the form. You mention this - that until the entire
On Load form event runs you don't know the final position of objects. This
can especially be a headache if you have subforms and a real headache if
you have nested subforms. The situation can be helped quite a bit by using
a 'form controller': a project method called by all the objects of a form.
I've talked about this a lot and done some presentations on it. It helps
manage complex forms in situations like this. Having all the objects
reference a single method makes managing them easier and helps keep clear
the order of execution:

 subform objects -> subform -> parent form objects -> parent form

It's easy to forget the parent form's On Load event is actually the last
one to run. This has not changed.

For constructing and displaying complex forms the new Form function coupled
with Dialog is incredibly powerful. To begin with, you can build your data
object prior to even opening the form. If you have array or selection based
listboxes these are replaced with collection based listboxes - referring to
either data collections or entity selections. This change alone can prune
dozens of lines of code because so little code is required to manage them.

But you can setup all that data prior to displaying the form and then pass
that data object to the form using Dialog:

DIALOG("myForm";$dataObject)

This will populate the Form function with $dataObject.

Previously if you had a complex situation the form objects or subforms
might call code to configure themselves. And sometimes this had to follow a
specific order during On Load. I'm saying that's no longer necessary. All
the data assembly can be done at once and stored in Form or some other
variable, though Form is more modular and generic. With that scenario it
doesn't matter when or in what order form objects, including subforms, are
drawn.

The second new feature may be too new to actually use but I encourage you
to look at what you can do with it and that's Dynamic Forms. Jsut for
starters you have complete control over drawing a listbox. Complete. Have a
listbx you like? Use the FORM Convert to dynamic command to get the code -
which you can just paste in.



On Wed, Apr 24, 2019 at 9:37 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I prefer to reduce the number of Project Methods while, of course,
> creating ones that make logical sense (as they can be called in several
> places in my code). But you understand that as a programmer.
>
I agree with not creating project methods without good cause. But there's
no downside to creating them when needed. Indeed, ORDA encourages us to
create methods for queries and such. Though a lot of the examples of this
in the docs are totally specific it's not hard to make those method more
generic.

And having worked a lot with addresses I don't find very much about them
trivial. Looking at your example as a basic principle responses to user
actions are handled by various events. Assuming the address object or
entity is in Form:

Form: {

address:{

City:"San Francisco"

Provence:"CA",

postalCode: "94114",

cityLine: "San Francisco, CA, 94114"

}

}


The input fields will refer to:

Form.address.City
Form.address.Provence
Form.address.postalCode and so on

and fire On data change. I have, and suspect you do too, a method to
normalize and format my address objects. So I only need to pass the address
object to it for all the work to be done. So the On data change code is:

Adrs_configure_obj (Form.address)

Adrs_configure_obj does all the work on the object. Since I pass
Form.address that is the object the method updates. And since I'm using
Form and referencing it in the form inputs they update as well. I don't
have to do anything else.

This aspect of working with objects, that you can pass the object to a
method and the method changes the object is quite powerful. Previously we
accomplished this with pointers to variables. It's a similar concept but
actually much more dynamic. And faster. When I call, Adrs_configure_obj
(Form.address), the method doesn't get a copy of the data, it gets a
reference to the data. Form.address is itself a reference to the data. The
data, entity or object, is managed by 4D. So this is both fast and resource
efficient.

I have played with the new Formula command myself. I haven't found any
really compelling uses for it in my work yet. I see it as an indication of
more changes to come, though. Like actual data classes where the
transformations I just talked about are part of the dataclass instead of a
separate method. But that's probably v18R stuff.

Hope this gives you some ideas to play with.

-- 
Kirk Brooks
San Francisco, CA
=

Re: -1 undefined database event

2019-04-24 Thread Kirk Brooks via 4D_Tech
David,

On Wed, Apr 24, 2019 at 2:23 PM David Ringsmuth via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The message says the record is locked, but 4D’s Locked($pTable->) returns
> false, and so does 4D’s Read only state($pTable->).
>
> Under what circumstances would this happen?
>
If you are using 4D server this can happen when the record has been
loaded/modified on the server. Triggers run on the server. This is one way
you get this sort of situation. The other, which has bitten me before, is
when an EXECUTE ON SERVER method has loaded, but not unloaded, a record.

-- 
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 Form Events

2019-04-23 Thread Kirk Brooks via 4D_Tech
Chris,
Reading through your post and the replies I'm trying to think of what a
'custom event' would be. Can you give an example or two?

On Tue, Apr 23, 2019 at 7:33 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am wondering if there is a way to configure Custom Form Events. I would
> like to be able to post a form event, and have it then processed within the
> FORM METHOD as such.
> I am doing a lot of work in “Orda context” right now and can think of some
> handy features that could be implemented in that way, especially with
> keeping the number of project methods down (as code could be put into a
> script instead).
> Before you think “why would he want to do that?” — please just focus on
> the question of ‘can I?’. :)
>
> In the past, I used the form event “on Outside Call” stuff to handle
> communications between processes, so I understand all that stuff.
>
> I remember — but cannot find again — some documentation that talked about
> using negative-numbered values for events to facilitate custom events.
> However, I seem to remember it only was in the context of subforms.
>
> Any help or direction you could provide would be most appreciated!
> 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
**

Salesforce anyone?

2019-04-18 Thread Kirk Brooks via 4D_Tech
I would like to talk with anyone who had done any work with Salesforce.
Specifically I'd like to hear about integrating with 4D. Please ping me
offline to talk.

Thanks!

-- 
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: Fast way to highlight a listbox entity selection

2019-04-16 Thread Kirk Brooks via 4D_Tech
Bingo.

On Tue, Apr 16, 2019 at 11:53 AM Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> It's looking like it can all be done with entity selections, and be more
> efficient.
>

-- 
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: Fast way to highlight a listbox entity selection

2019-04-16 Thread Kirk Brooks via 4D_Tech
Keith,
You know you can go about this from another point of view. I actually
posted about this a bit ago. This won't accomplish exactly what you are
asking for but it may be something you can use.

First, remember that even when you have a very large collection or entity
selection, as you seem to, you can make references to it WITHOUT
duplicating it. This saves memory, obviously, but also means you can work
with the list without having to worry about syncing it. It's even better
when you are working with an entity collection. With 'lazy loading' the
collection only contains references to the entities not a full copy of the
data.

Next, if it's the case the highlighted elements are being generated by some
sort of filter or search perhaps you can accomplish your goal by only
showing the records that match whatever criteria you have. I would think
this is especially true with a list of 40K items. Personally I would really
not want to have to scroll down to the second item highlighted when it's
#37306.

So, you have your 40k entity selection. The trick is not to put this in the
listbox. Instead make a reference to it and display that. Remember neither
of these entity selections consists of the data and the second one, the one
in the listbox, is only a reference to the first. I learned from JPR that
this is very memory efficient.

Let's say you put the entity selection in a process var (I would most
likely use Form for this) but to simplify the example let's call it
'entitySelection'. Next make a collection on Form called
"displayCollection" (or whatever) as


Form.displayCollection:=entitySelection

Use Form.displayCollection in the listbox. By default the listbox shows all
the elements of entitySelection.

To show a selection of this list you could do:

Form.displayCollection:=entitySelection.query("dateHired < :1";(Current
date-90))  //borrowing a query example from the docs.
Form.displayCollection:=Form.displayCollection  //  forces the listbox to
update itself


What are we doing? The query on the entity selection returns a collection.
The contents of the collection are references to the respective elements in
entitySelection. We're putting the query result into Form.displayCollection
and since we have defined our listbox to use displayCollection the listbox
now contains the query result.

This is very fast. Like update while the user is typing fast. And since we
are working with references changes you make to the something in the
listbox populates back to the entity selection, entitySelection. Plus it's
memory efficient.

Another thing I learned at the WT - the entitySelection.toCollection
command can be helpful BUT it does move the actual entity data to the
collection. For something like a 40k element entity selection this might
matter. So be sure to stick with your entity selection when it's large. And
in this case the data would be in entitySelection but not in the references
to it.


On Tue, Apr 16, 2019 at 9:11 AM Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Douglas,
>
> That seems promising.  Since the listbox is a collection/entity selection,
> each row's color would be set by the rows presence in the "Selected items"
> collection.  I imagine the performance would be OK as long as the search
> only took place as the row becomes visible to the User.
>
> Kirk's proposal alludes to a solution that 4D seems inches away from,
> where a row's membership in the selected items collection automatically
> grants it a highlight, similar to the boolean array of the array based
> listbox, and the HighlightSet of the selection based listbox.
>
> Thanks,
> Keith - CDI
>
> > On Apr 16, 2019, at 10:44 AM, Douglas von Roeder via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Keith:
> >
> > How about this - rather than change the highlight, what about just
> changing
> > the color of the rows to mimic that they’re selected? You can still
> > maintain array of record numbers/ID’s that represent the selection but
> just
> > update the UI so that it looks like the rows are selected.
> >
> > My thinking is that by using the list box code to select the rows, that’s
> > causing 4D to reload the records. The thought "Why would you want to do
> > that (if you don’t have to)?”, comes to mind. :-)
> >
> > --
> > Douglas von Roeder
> > 949-336-2902
> >
> >
> > On Tue, Apr 16, 2019 at 7:22 AM Keith Culotta via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Justin,
> >>
> >> Thank you for the suggestion.
> >>
> >> I switched the deselect-all code to
> >>   LISTBOX SELECT ROW(*;"valsBox";1;lk replace selection)
> >>   LISTBOX SELECT ROW(*;"valsBox";1;lk remove from selection)
> >> and the selection did clear, however as soon as this add-to-selection
> code
> >> is executed
> >>   LISTBOX SELECT ROW(*;"valsBox";0;lk replace selection)
> >> 4D immediately crashes.
> >>
> >> If all 40k rows get deselected, using either method, and selecting them
> >> all again is done in a loop, the loop finishes in about two se

Re: Fast way to highlight a listbox entity selection

2019-04-16 Thread Kirk Brooks via 4D_Tech
All,
I just started a Feature Request for this:
http://forums.4d.com/Post//29409213/1/

Take a look and see what you think. Collection/entity based listboxes are a
very different animal from array or selection based ones. And the way to
work with them is different too. Frankly the easiest thing would be if we
could set the selected collection and the listbox would highlight the rows
corresponding to those elements.

I'm proposing a command where you pass a collection of indices (scalar, the
index values of the objects you want) or a collection of elements contained
in the listbox collection. This second form is what you get with
collection.query.

On Tue, Apr 16, 2019 at 8:45 AM Douglas von Roeder via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Keith:
>
> How about this - rather than change the highlight, what about just changing
> the color of the rows to mimic that they’re selected? You can still
> maintain array of record numbers/ID’s that represent the selection but just
> update the UI so that it looks like the rows are selected.
>
> My thinking is that by using the list box code to select the rows, that’s
> causing 4D to reload the records. The thought "Why would you want to do
> that (if you don’t have to)?”, comes to mind. :-)
>
> --
> Douglas von Roeder
> 949-336-2902
>
>
> On Tue, Apr 16, 2019 at 7:22 AM Keith Culotta via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Justin,
> >
> > Thank you for the suggestion.
> >
> > I switched the deselect-all code to
> >LISTBOX SELECT ROW(*;"valsBox";1;lk replace selection)
> >LISTBOX SELECT ROW(*;"valsBox";1;lk remove from selection)
> > and the selection did clear, however as soon as this add-to-selection
> code
> > is executed
> >LISTBOX SELECT ROW(*;"valsBox";0;lk replace selection)
> > 4D immediately crashes.
> >
> > If all 40k rows get deselected, using either method, and selecting them
> > all again is done in a loop, the loop finishes in about two seconds.
> > At that point the macOS spinning wheel appears for three minutes. The
> > highlight then appears and control is returned to the app.
> > The fewer the records being highlighted, the shorter the macOS wheel
> spins.
> >
> > Regards,
> > Keith - CDI
> >
> > > On Apr 15, 2019, at 7:50 PM, Justin Carr via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >
> > > On 16 Apr 2019, at 5:04 am, Keith Culotta via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >>
> > >> Hello,
> > >>
> > >> I'm looking for a fast way to highlight a selection of rows in an
> > entity selection listbox.  The way I am aware of works OK unless the
> > listbox gets a large number of rows.
> > >>
> > >> Adding records to the Selected Items name in the Property list does
> not
> > highlight the listbox contents.  The equivalent of adding records to the
> > "UserSet" is not available with entity selection listboxes.
> > >>
> > >> Highlighting all with LISTBOX SELECT ROW(*;"listBox";0;lk add to
> > selection) crashes 4D if the listbox contains enough records.
> > >> LISTBOX SELECT ROW(*;"listBox";$position;lk add to selection) crashes
> > if put in a fast FOR loop.  If the loop is executed more slowly there is
> > success.  The slowness comes from looking for entitySelected[i] within
> the
> > entity selection and highlighting its position in the listbox.
> > >>
> > >> Is there a better way to get there?
> > >
> > > Hey Keith
> > >
> > > Are you clearing the listbox selection first (with LISTBOX SELECT
> > ROW(*;"listBox";0;lk remove from selection)? If so, that is probably the
> > cause of the crashing you are seeing. You can workaround it by
> highlighting
> > and unhighlighting the first row instead, i.e.
> > >
> > > LISTBOX SELECT ROW(*;"listBox";1;lk replace selection)
> > > LISTBOX SELECT ROW(*;"listBox";1;lk remove from selection)
> > >
> > > cheers
> > > Justin
> >
> > **
> > 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: From where is my form method called?

2019-04-15 Thread Kirk Brooks via 4D_Tech
Sandor,
You can open the form in the editor. At the top of the property list is a
popup menu. It lists all the objects on the current page of the form. You
can choose the object name from the popup and it will be selected. If there
are a lot of pages you will have to go through them one at a time. Be sure
to check page 0.

On Mon, Apr 15, 2019 at 9:05 AM Sandor Szatmari via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a form method [MyObject].MyObjectDetail.bValidate
>
>
> How can I find what form object this method is attached to?
>
>
> It looks like it's a button validation from the name, but I'm guessing.
>
>
> Is there a way to reveal the object to which this method is attached?
>
>
> Thanks,
> Sandor Szatmari
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Senior Software Developer
> Bristol Capital Inc. - InfoPlus
> 201 746 7215
> www.infoplusonline.com
>
>
> CONFIDENTIALITY NOTICE: This email (and any related attachments) contains
> information from InfoPlus (a service of Bristol Capital, Inc.). It is
> intended only for the addressee and may contain information that is
> confidential and/or otherwise exempt from disclosure under applicable law.
> If you are not the intended recipient or are acting as agent for the
> intended recipient, any use or disclosure of this communication is
> prohibited. If you have received this communication in error, please notify
> us immediately to arrange for the appropriate method of returning or
> disposing of the communication. If our respective Companies have
> confidentiality provisions in effect, this email and the materials
> contained herein are deemed CONFIDENTIAL and should be treated accordingly
> unless expressly provided otherwise.
> **
> 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: Type Ahead in Array Listbox Cell

2019-04-11 Thread Kirk Brooks via 4D_Tech
Doug,
I believe you want to use the On after keystroke form event on the listbox
(or the column) and the Get edited text function. Get edited text returns
the text that's being edited before it's saved to the object it's edited
in.

On Thu, Apr 11, 2019 at 8:35 AM Doug Cottrill via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi all,
>
> I’m trying to implement a type-ahead feature in an array listbox cell.
>
> I have this functionality in a form variable, and it works great- when the
> user types, code in the on after edit finds the first record value in a
> field that matches the first few characters, fills in the rest, and
> highlights the new characters so that if the user continues typing the item
> found can be replaced.
>
> The problem I’m having is that apparently in a listbox, you cannot call
> highlight text on a cell to highlight partial text.
>
> So, first off- am I correct that HIGHLIGHT TEXT will not work in a
> listbox?  If it WILL work, can someone post code since mine is not working,
> and it “should” as far as I can tell, but the docs say it will not work in
> a subform field.  I don’t know if a listbox qualifies or not, but it seems
> to.
>
> Second, assuming that HIGHLIGHT TEXT does NOT work in a listbox, how are
> others doing type-ahead in a list box?  Surely I’m not the first person to
> want to do 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
===

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: I really recommend the 4D World Tour

2019-04-10 Thread Kirk Brooks via 4D_Tech
Hey Pat
Yeah it will be really helpful for the planning you need to do.

Let me know what you think.

On Wed, Apr 10, 2019 at 11:01 AM Pat Bensky via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thanks for that Kirk. I found your ORDA comments interesting.
> I'll be at the London event.
> Pat
>
> On Wed, 10 Apr 2019 at 15:00, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com>
> wrote:
>
> > Heading home from the WT in Atlanta. For me this was the best WT so far
> and
> > I've been to them all. I think anyone using 4D benefits from attending.
> The
> > first day is free. In previous WTs day one was more of a sales pitch and
> > feature overview. Not so this time. There are 17 demo databases in day
> one.
> > They highlight and present many of the new capabilities involving ORDA,
> > Form, dynamic forms and a more refined preview of 4D for iOS. There are a
> > number of useful elements you can pull right into a project - assuming
> you
> > are working v17+.
> >
> > And this is really a critical point - the World Tour is focused on the
> > future of 4D and that future is ORDA. Actually it is more than just ORDA.
> > ORDA is the new, modern direction of programming 4D is taking. It's not
> > everything, though. The change in the way we can work with forms isn't
> > connected with ORDA per se but it's no less a profound change. And a
> > welcome one form me. I really like the form editor but the ability to
> > create forms dynamically and store their definitions externally in JSON
> > files is a good thing. The ability to store an entire 4D database (it
> will
> > be known as a Project) will be available soon (though not committed to).
> >
> > The first day exposes you to many of the new features in 4D and clearly
> > lays out the thinking behind the changes made and to come. This alone
> makes
> > it worth the time and expense to travel to it.
> >
> > The second day is for those of us using 4D professionally. JPR and Add
> have
> > spent time putting together excellent demos and presentations. These demo
> > the nuts and bolts of effectively working with ORDA and forms. This is
> > information you will need to effectively apply these new techniques in
> real
> > world projects. And once more there are bits and pieces you can pull
> right
> > out of a demo and use yourself which do useful things.
> >
> > I was chatting with someone yesterday morning and he asked me what my 3
> big
> > take-aways were up to then. Here's what I wrote back:
> >
> > #1 - all the time I’ve spent learning to use ORDA has been spot on and
> well
> > spent. (I finished yesterday for the first time feeling like I kept up
> with
> > JPR.)
> > #2 - this is truly the way forward for 4D.
> > #3 - because it’s the way forward it is where all the resources are being
> > focused. And they are moving fast.
> > #4 - it’s super important to grasp the concept of references vs. the way
> we
> > have thought about variables in the past.
> >
> > (get the reference to my off-by-one joke?)
> >
> > I have been actively working on educating myself on ORDA and object
> > oriented programming for the past few months. And I really did feel like
> I
> > was keeping up with JPR right up to the end of day 1. Not so much on day
> 2
> > but at least my eyes didn't glaze over. The point, though, is how much
> > programming in 4D is changing. 4D classic and backward compatibility is
> not
> > in danger. I mean - they've been threatening to remove subtables for how
> > many years and 4D still deals with them if it needs too. Mostly. So old
> > school programming done with 4D classic is going to run on new versions
> of
> > 4D for probably longer than any of us will be able to write intelligible
> > code. (Assuming you can write intelligible code now...) But all the new
> > work is being focused on ORDA and its associated technology.
> >
> > Why? Because Laurant believes it's the direction to go. It's a modern
> > approach to programming. You can (and will) argue with that but it's
> where
> > this train is headed.
> >
> > Do you need to get on board?
> >
> > I mean that seriously. The fact is you may not. There are a lot of us who
> > have used 4D for a long, long time. We've written bunches of apps, have
> > them deployed and running just fine. It's like a retired neighbor said to
> > me when we were talking about repairing a fence on our common lot line:
> "it
> > only has to last as long as I do."  Perso

Re: I really recommend the 4D World Tour

2019-04-10 Thread Kirk Brooks via 4D_Tech
Jody
Thanks
Be rested and any time you can put into prep will pay off

On Wed, Apr 10, 2019 at 10:14 AM Jody Bevan via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk:
>
> Thanks for taking the time to think through this and write it out. The
> Summit last year was a good introduction, and my expectation is that the WT
> this year will be some serious work to be thought through. Plan on coming
> rested this time.
>
> Thanks again
>
> Jody
>
> > On Apr 10, 2019, at 8:00 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Heading home from the WT in Atlanta. For me this was the best WT so far
> and
> > I've been to them all. I think anyone using 4D benefits from attending.
> The
> > first day is free. In previous WTs day one was more of a sales pitch and
> > feature overview. Not so this time. There are 17 demo databases in day
> one.
> > They highlight and present many of the new capabilities involving ORDA,
> > Form, dynamic forms and a more refined preview of 4D for iOS. There are a
> > number of useful elements you can pull right into a project - assuming
> you
> > are working v17+….
> >
> >
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

I really recommend the 4D World Tour

2019-04-10 Thread Kirk Brooks via 4D_Tech
Heading home from the WT in Atlanta. For me this was the best WT so far and
I've been to them all. I think anyone using 4D benefits from attending. The
first day is free. In previous WTs day one was more of a sales pitch and
feature overview. Not so this time. There are 17 demo databases in day one.
They highlight and present many of the new capabilities involving ORDA,
Form, dynamic forms and a more refined preview of 4D for iOS. There are a
number of useful elements you can pull right into a project - assuming you
are working v17+.

And this is really a critical point - the World Tour is focused on the
future of 4D and that future is ORDA. Actually it is more than just ORDA.
ORDA is the new, modern direction of programming 4D is taking. It's not
everything, though. The change in the way we can work with forms isn't
connected with ORDA per se but it's no less a profound change. And a
welcome one form me. I really like the form editor but the ability to
create forms dynamically and store their definitions externally in JSON
files is a good thing. The ability to store an entire 4D database (it will
be known as a Project) will be available soon (though not committed to).

The first day exposes you to many of the new features in 4D and clearly
lays out the thinking behind the changes made and to come. This alone makes
it worth the time and expense to travel to it.

The second day is for those of us using 4D professionally. JPR and Add have
spent time putting together excellent demos and presentations. These demo
the nuts and bolts of effectively working with ORDA and forms. This is
information you will need to effectively apply these new techniques in real
world projects. And once more there are bits and pieces you can pull right
out of a demo and use yourself which do useful things.

I was chatting with someone yesterday morning and he asked me what my 3 big
take-aways were up to then. Here's what I wrote back:

#1 - all the time I’ve spent learning to use ORDA has been spot on and well
spent. (I finished yesterday for the first time feeling like I kept up with
JPR.)
#2 - this is truly the way forward for 4D.
#3 - because it’s the way forward it is where all the resources are being
focused. And they are moving fast.
#4 - it’s super important to grasp the concept of references vs. the way we
have thought about variables in the past.

(get the reference to my off-by-one joke?)

I have been actively working on educating myself on ORDA and object
oriented programming for the past few months. And I really did feel like I
was keeping up with JPR right up to the end of day 1. Not so much on day 2
but at least my eyes didn't glaze over. The point, though, is how much
programming in 4D is changing. 4D classic and backward compatibility is not
in danger. I mean - they've been threatening to remove subtables for how
many years and 4D still deals with them if it needs too. Mostly. So old
school programming done with 4D classic is going to run on new versions of
4D for probably longer than any of us will be able to write intelligible
code. (Assuming you can write intelligible code now...) But all the new
work is being focused on ORDA and its associated technology.

Why? Because Laurant believes it's the direction to go. It's a modern
approach to programming. You can (and will) argue with that but it's where
this train is headed.

Do you need to get on board?

I mean that seriously. The fact is you may not. There are a lot of us who
have used 4D for a long, long time. We've written bunches of apps, have
them deployed and running just fine. It's like a retired neighbor said to
me when we were talking about repairing a fence on our common lot line: "it
only has to last as long as I do."  Personally I don't think there is any
compelling reason to take old code that's running fine and try to inject
ORDA into it. There is no advantage. As I understand it the database engine
in 4D is the same engine that Wakanda used. Wakanda exposed more
capabilities of that engine but at the core it's the same engine. ORDA is
rolling out so fast because the engine is already there and tested. ORDA is
a programming layer, if you will. 4D classic is different layer. ORDA is
faster to develop with and requires less code to accomplish the same
results. It's also more comprehensible to folks already accustomed to OOP
languages or javaScript. I think there are some cases where classic 4D may
be faster on basic operations but I don't think those will stand because
ORDA is where the focus is.

If you are planning on retiring in the next few years, or selling your
vertical market app there's no real reason for you to worry about learning
this stuff in my opinion. You don't have to have it. But if you are looking
at having your app running and being updated in the future, or our app is
critical to a business, or looking at hiring programmers to work on your
app, or looking at 4D as a rapid development platform (it used to be
classified that way) then g

Re: MAXIMUM NUMBER REACHED

2019-04-10 Thread Kirk Brooks via 4D_Tech
Ferdinando,
How do you know it's the 8th connection? If you log into the server and
observe the console window you can verify:

1) how many licenses (seats) you have available
2) how many are currently logged in


I would check that you have all your expansion licenses installed. 7 users
is the 2 default users and one 5-user expansion pack. 16 seats is an odd
number but certainly suggests another expansion pack or two. Check it.
Especially is the server was recently updated or upgraded.

It's also possible you have some 'ghost' users. This can happen when a
connection gets interrupted and the server doesn't remove the user.

Another situation to look for is another instance of the v12 server
running. 4D allows you to have multiple instances of the server running on
the same machine and the total number of licenses you have is distributed
among them. So if you have 3 instances of v12 server running you may have a
total of 16 (if that number is correct) users logged into the 3.


On Tue, Apr 9, 2019 at 9:46 AM stardata.info via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> hi all,
>
> In one application I use 4D V12 on Windows.
>
> I have 16 available simultaneous connections but sometimes, after the
> seventh client connected, during the eighth connection I have the
> message that says " maximum connections number reached ".
>
> Someone have a solution?
>
> Thanks
> Ferdinando
> **
> 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 and 4D selections

2019-04-09 Thread Kirk Brooks via 4D_Tech
Chuck,
There is no reason to use ORDA if you need a regular selection. Just use
the classic 4D query commands.

On Tue, Apr 9, 2019 at 2:27 PM Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi all,
>
> is there any way to perform a query using ORDA and create a current
> selection or set from the result.
>
> Thanks and regards
>
> Chuck
>
>
>
> --
>
> -
>  Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
>  Informed Solutions, Inc.
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D, Sybase & SQL Server connectivity
>   http://www.informed-solutions.com
>
> -
> This message and any attached documents contain information which may
> be confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution,
> disclosure, printing, copying, storage, modification or the taking of
> any action in reliance upon this transmission is strictly prohibited.
> Delivery of this message to any person other than the intended
> recipient shall not compromise or waive such confidentiality,
> privilege or exemption from disclosure as to this communication.
> **
> 4D Internet Users Group (4D iNUG)
> 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: Hierarchical Listbox Row with leading Icon (like hierarchical list)

2019-04-09 Thread Kirk Brooks via 4D_Tech
Hey John,
If you can make it to the World Tour JPR has a v17 listbox demo that does
this.

On Mon, Apr 8, 2019 at 8:55 PM John J Foster via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi All,
>
> I’m trying to duplicate the look and feel (in as much as it’s possible) of
> a hierarchical list but using a Hierarchical Listbox.
>
> I know we can add an icon to the column header. But I want to have a
> different icon displayed for each level of the hierarchy. In fact I’d like
> to potentially have an icon for each row of the listbox.
>
> I have looked in the docs, KB, and the NUG and don’t see anything. I know
> I can add a picture column and insert an image into each cell. But I don’t
> think that’s what I want to do since that will throw off the hierarchical
> sorting I think.
>
> Can it be done?
>
> Can anyone provide a simple example.
>
> 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
===

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

[TIP] Moving elements of a collection

2019-04-03 Thread Kirk Brooks via 4D_Tech
Collections are not arrays. So is I have a collection based listbox and
want to have a control to allow the user to move a selected element within
the collection how do I do that?

One way would be to allow her to drag and drop the element to the new
position. The other way is a spinner of some sort to allow moving a
selected element up or down. In both cases I need to actually move the
element within the collection.

Here is a method I came up with. It takes a collection, the selected
element index and a 'direction'. This is simply the number of places to
move the selected element. Positive moves it 'up' the list and negative
'down'. I did not follow 4D's approach to these sorts of things and wrap
the movement. In my method if the collection won't support the requested
move nothing happens.

Contents of the collection don't matter.

*C_COLLECTION*($col)

$col:=*New collection*("a";"b";"c";"d")

*Collection_move* ($col;0;3)  //$col=["b","c","d";"a"]

*Collection_move* ($col;3;-3)  //$col=["a";"b","c","d"]


$col:=*New collection*(\

*New object*("key";"a");\

*New object*("key";"b");\

*New object*("key";"c");\

*New object*("key";"d"))


*Collection_move* ($col;0;3) //  [{key:b},{key:c},{key:d},{key:a}]


And here's the method:

  //  Collection_move (col; long; long)

  // $1: collection

  // $2: element to move

  // $3: direction and magnitude

  // Written by: Kirk as Designer

  // --

  // Purpose: moves an element of collection

  // if $3 > 0 the element is moved 'up'


*C_COLLECTION*(*$1*)

*C_LONGINT*(*$2*;$i)

*C_LONGINT*(*$3*;$direction;$x)


$i:=*$2*

$direction:=*$3*


$x:=$i+$direction  //  proposed new location


*Case of*

*:* (*$1*=*Null*)

*:* (*$1*.length=0)

*:* ($direction=0)

*:* ($i<0) | ($i>(*$1*.length-1))

*:* ($x<0) | ($x>(*$1*.length-1))

*:* ($direction>0)  //  moving up

*$1*.*insert*($x+1;*$1*[$i])

*$1*.*remove*($i)


*Else*   // moving down

*$1*.*insert*($x;*$1*[$i])

*$1*.*remove*($i+1)


*End case*


-- 
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: Securing sensitive data in a 4D data file (Chip Scheide)

2019-03-31 Thread Kirk Brooks via 4D_Tech
I've taken the approach of creating a separate table for storing secure
data. Each record has a blob to hold the data. The idea is the sensitive
data is encrypted into a blob and the blob is saved in one of these
records. The record the data belongs to records the secure record id. When
the data is required the blob is copied, uncompressed and unencrypted.

The benefits are a single procedure to manage any secure data. And a single
place to save it. It's flexible and allows adding new fields as needed.
The detriments are the ones Bruno mentions: the keys are stored in the
code.

If you store data you want to search on you need to build some sort of
index based on hashes.

This is especially good for dealing with things like SSNs.

On Sun, Mar 31, 2019 at 10:50 AM Bruno LEGAY via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> Hi Chip,
>
> Interesting subject...
>
> You seem to have chosen (if I understand correctly) a good direction in
> your design : encrypt sensitive data (fields) with ENCRYPT BLOB I guess...
>
> This is good, so event when looking at the datafile with an hex editor, a
> clever hacker won't be able to extract data.
>
> It is not easy because the problem is that the data is not searchable,
> sortable... But it is a compromise.
>
> Maybe it would be nice if 4D would have a transparent datafile level
> encrypted/decrypter. A bit like FileVault but at database level... There
> would be a speed penalty, but maybe one could choose field by field which
> data needs to be encrypted...
>
> But then there is always the question of the keys... where do you store
> the keys and how do you protect them ? It would make the job more
> complicated, but not theoretically impossible.
> Also, if you loose your keys, you just crypto locked your data.
>
> The ideal solution is an HSM (piece of tempered proof $$$ hardware to
> store the keys), I have heard of them, but never seen one used. I have not
> idea if it could be used with 4D.
>
> I have written systems where the keys are stored in a function. The
> function returns the base64 key in text... I used these keys to
> protect/encrypt passwords stored in text files. But again a skilled hacker
> could find the keys in your code I guess.
> Definitely better than storing the keys in a plain text file name
> "key.txt" or password in a text file "credentials.txt"...
>
> I rarely encrypt data in our databases (maybe not as critical as your
> case), but one thing I do, is that the backups are compressed and encrypted
> before being sent to another server.
> I use 7z which has an AES 256 encryption option.
> This way, if a backup file is compromised/stolen, the data is "safe".
>
> At the end of the day it is always cost/risk ratio. A compromise between
> the "value" of your data (and therefore the amount of effort a skilled
> hacked would throw at reading your data) against how much your client is
> willing to pay to protect the data...
>
> It is important that you show that you have identified potential risks and
> you have prepared solutions.
>
> Security also require you to be consistent. No point encrypting data if
> your user can export the same data in a file (because he will export the
> data in a text file and then your precious sensitive data will be on the
> loose).
>
> In Europe we have RGPD which is trying to impose guidelines around data
> protection. It will be a long process... Some of it is good sense, some of
> it is not practical (but it makes some specialized lawyers rich along the
> way)...
>
> Bruno LEGAY
> A&C Consulting
>
> **
> 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: Printing Structure Diagram

2019-03-30 Thread Kirk Brooks via 4D_Tech
Hi Kirk,
Check this out
https://github.com/miyako/4d-utility-structure-to-svg-converter


On Sat, Mar 30, 2019 at 1:06 PM rooftop99--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> Thank you Chip,
>
> I am aware of the xml and html exports.  I have used the xml export for
> several purposes.  My question is, how do I get the printed visual
> structure digram I need using either of these.  Surely there are database
> schema [structure] diagram printing applications out there someplace that
> someone has used successfully.  I am also open to 4D based solutions.
>
> Kirk
>
>
> > On Mar 30, 2019, at 11:54 AM, Chip Scheide <4d_o...@pghrepository.org>
> wrote:
> >
> > I too can not print the structure any more
> >
> > However, there are 2 options I easily found.
> > with the structure window open, select the 'File' menu.
> > - Export -> Structure to xml
> >  and
> > - Export -> Structure to HTML
> >
> > that should get you started.
> >
> > Chip
> >> Hi All,
> >>
> >> We are in the midst of analyzing a very old 4D application. We’d
> >> like to print/plot/PDF a structure diagram, in all it’s glory, to
> >> hang on the wall.  It must represent all structure elements such as
> >> Tables, Fields, Relations, Indexes, etc….  I have seen these
> >> diagrams for other platforms but I haven’t been successful in
> >> extracting such from 4D.
> >>
> >> Way back in the day I could print a tiled version of the structure
> >> from the Structure editor window but that print menu seems to be
> >> disabled (at least for me) in current versions of 4D.  Ideally I
> >> would like to export the database as xml or JASON and load it into
> >> another charting specific application to manipulate and print.  I
> >> just need to find the proper application (or 4D component/methods)
> >> that can consume the xml/JASON and provide the needed diagrams.
> >>
> >> An example of what I am hoping for can be found in the top image of
> >> Vanessa Talbot’s 4D blog entry titled, “Detailed Analysis of Your
> >> Database Structure”  Here is the link if it is allowed on the Nug:
> >> "https://blog.4d.com/detailed-analysis-database-structure/“
> >> Something, clean, clear, and readable.
> >>
> >> FYI: We are on 4D v16R5 at the moment.  Moving to v17 soon.
> >>
> >> Any help is appreciated!
> >>
> >> Thank you!!
> >> 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
> >> **
> > 
> > Hell is other people
> > Jean-Paul Sartre
>
> **
> 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: Encrypt Blob issue

2019-03-28 Thread Kirk Brooks via 4D_Tech
Chip,
Try encrypting the blob before writing it to the field.
I have always applied encrypting and compressing to a blob variable and
then written the variable to/from the field without issues.

On Thu, Mar 28, 2019 at 8:20 AM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> When I attempt to encrypt a blob field I get an error "The BLOB could
> not be created" error 1.
> Is this expected behavior??
>
> Chip
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 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: Dropbox Upload and Dropbox Download Methods

2019-03-08 Thread Kirk Brooks via 4D_Tech
Tim,
Thanks for sharing this.

On Fri, Mar 8, 2019 at 3:55 PM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> A few weeks ago I posted a message asking if anyone had written code to
> upload and download files to Dropbox. Got no responses other than “the API
> looks like it is easy to do”.
>
> Today I spent time writing a couple of methods to allow uploading and
> downloading files from Dropbox with native 4D commands using the Dropbox v2
> API. And people were right, it was not too difficult. The v2 API is
> implemented very nicely and documented fairly well. I found a few
> documentation errors, but they were easily dealt with.
>
> 4D v17 provided all the commands needed to make it all work with very
> little code. Doing this with NTK would easily take 3 times the amount of
> code.
>
> My current needs are very simple. I want to upload a file to Dropbox and
> replace any existing file if necessary. Dropbox maximum file size for a
> single upload operation is 150MB. That’s more than enough for my needs. But
> if you want to upload larger files — up to the Dropbox API max size of
> 350MB — you’ll have to implement an “upload session”.
>
> Download requirements are also simple. Just download a file from a Dropbox
> path to a path on your hard drive. Dropbox paths are in POSIX format.
>
> The Dropbox v2 API uses OAuth 2, but that basically boils down to creating
> an “App” and getting an “access token” the you use with all the API calls.
> I’ll leave it up to you to go read the docs and set that all up. It’s easy.
>
> The code uses dot notation, but with a little work it could be ported to
> work with older versions for 4D probably back to v14. Code is
> cross-platform without any extra effort needed.
>
> Here is me giving back to the group so you don’t have to spend a day
> developing and testing code. If others implement more of the Dropbox v2
> API, please post it to the iNUG to help others.
>
>   // ===
>   // PROJECT METHOD: Dropbox_UploadFile
>
>   // PARAMETERS: $0 = results object
>   // $1 = dropbox access token
>   // $2 = dropbox path
>   // $3 = file path
>
>   // DESCRIPTION: Uploads a file to Dropbox using the v2 API
>   // Max upload size in a single transfer is 150MB.
>
>   // https://www.dropbox.com/developers/documentation/http/documentation
>
>   // CREATED BY: Tim Nevels, Innovative Solutions ©2019
>   // DATE: 3/8/19
>   // LAST MODIFIED:
>   // 
>
> C_OBJECT($0;$results_o)
> C_TEXT($1;$dropboxAccessToken_t)
> C_TEXT($2;$dropboxPath_t)
> C_TEXT($3;$filePath_t)
> $dropboxAccessToken_t:=$1
> $dropboxPath_t:=$2
> $filePath_t:=$3
>
>   // declare local variables
> C_TEXT($headerValue_t;$requestURL_t;$response_t)
> C_LONGINT($statusCode_l)
> C_BLOB($content_x)
> C_OBJECT($headerValue_o;$response_o)
> ARRAY TEXT($headerName_at;0)
> ARRAY TEXT($headerValue_at;0)
>
>   // setup http header
> APPEND TO ARRAY($headerName_at;"Authorization")
> APPEND TO ARRAY($headerValue_at;"Bearer "+$dropboxAccessToken_t)
>
>   // set upload header values
> APPEND TO ARRAY($headerName_at;"Content-Type")
> APPEND TO ARRAY($headerValue_at;"application/octet-stream”)
>
> APPEND TO ARRAY($headerName_at;"Dropbox-API-Arg")
> $headerValue_o:=New object(\
> "path";$dropboxPath_t;\
> "mode";"add";\
> "autorename";False)  // overwrite any existing file
> $headerValue_t:=JSON Stringify($headerValue_o)
> APPEND TO ARRAY($headerValue_at;$headerValue_t)
>
>   // set url
> $requestURL_t:="https://content.dropboxapi.com/2/files/upload";
>
>   // load the file
> DOCUMENT TO BLOB($filePath_t;$content_x)
>
>   // check file size
> If (BLOB size($content_x)>(1024*1024*149))  // over 149MB, too close to
> limit to try
> $results_o:=New object(\
> "success";False;\
> "statusCode";408;\
> "errorMessage";"File is to large to upload in one piece")
> Else
>   // upload the file
> HTTP SET OPTION(HTTP compression;1)  // do compression
> HTTP SET OPTION(HTTP timeout;60*10)  // 10 minute timeout
> $statusCode_l:=HTTP Request(HTTP POST
> method;$requestURL_t;$content_x;$response_t;$headerName_at;$headerValue_at)
>
>   // build results object
> Case of
> : ($statusCode_l=200)  // upload was a success
> $results_o:=New object(\
> "success";True;\
> "statusCode";$statusCode_l;\
> "errorMessage";"File upload was successful")
>
> : ($statusCode_l=409)  // endpoint specific problem
> $response_o:=JSON Parse($response_t)
> $results_o:=New object(\
> "success";False;\
> "statusCode";$statusCode_l;\
> "errorMessage";$response_o.error_summary)
>
> Else   // other problem
> $results_o:=New object(\
>  

Re: v17 web area

2019-03-05 Thread Kirk Brooks via 4D_Tech
David,
I downloaded the tech note and see the same thing. Looking under the hood a
little bit I'm thinking the issue is with the fairly old versions of
Leaflet, jQuery and some other libraries it uses. At this point they are
all 5 or 6 years old (based on the file headers) which is pretty long in
the tooth. If I were troubleshooting further I would start by changing the
dependencies on the static files to the CDNs for these libraries in the
demo copy. If the maps work then that's the issue.

I've seen web areas stop working when the client machine changes OS. This
happened to v15 users who upgraded to Mojave and the web area used the 4D
webkit, for instance. Most of the time you could stop using the webkit (or
upgrade to v17) and things would work again. That trick didn't work here so
I suspect it's something more fundamental.

On Tue, Mar 5, 2019 at 2:46 AM David Samson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> A few years ago I successfully implemented the tech note
> "15-13_MapWithDataCluster". I modified it for our needs and it worked well.
> That was on v14.
>
> Now, on v17 (Windows, 64 bit server, 32 bit clients) it is not displaying
> the background map. The generated data points are still displayed but on a
> blank background. I have checked the Leaflet map is in the correct
> resources folder. I tried to download the tech note again and the demo has
> the same problem when converted to v17.
>
> Any ideas?
> David Samson
>
> --
> D Samson
> **
> 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: "Attempting to retype using a pointer"

2019-02-28 Thread Kirk Brooks via 4D_Tech
I just noticed something when I stepped through one of my examples - in
this case:
$to:=New object
$from:=New object
$i:=100
$from.ptr:=->$i
$to.ptr:=->$k
$to.ptr->:=$from.ptr-> // $k = 100 at this line
The value of $k changed as soon as this line runs.

I also wondered what would happen if I initialized $to.ptr to a nil
pointer. The answer is

C_POINTER($nil)

$to.ptr:=$nil  // $to.ptr = null

Nil is regarded as null in v17.


On Thu, Feb 28, 2019 at 8:22 AM Kirk Brooks  wrote:

> Jeremy,
>
>
> On Wed, Feb 27, 2019 at 11:53 PM Jeremy Roussak via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> Objects pre-date ORDA, as you know.
>
> True. In this case what we are really talking about is 4D's object
> notation. I tend to use 'ORDA' for all the new capabilities and should be
> more specific.
>
>
>> I was simply using an object as a way of permitting a method to return
>> several values at the same time. Those values happened to be pointers to
>> variables (created by OBJECT DUPLICATE and so necessarily referenced using
>> pointers). I wanted then to copy the value in the variable pointed to by
>> one pointer into the variable pointed to by another pointer. The two
>> variables were of identical type, one having been created by duplicating
>> the other.
>>
> I find this an excellent application of using objects as containers for
> passing parameters to and retrieving values from a method.
>
> Since you mention OBJECT DUPLICATE you must be working with variables on a
> form. In that context using Form removes the need to work with pointers
> altogether.
>
>> There was therefore no reason why
>>
>> $to.ptr-> := $from.ptr->
>>
>> should have created any error at all; yet it did, and it was an error for
>> which I can find no logical explanation, particularly given that the
>> assignment did actually take place. Further, if I complicate the code by
>> writing
>>
> Perhaps you didn't create $to and $from with New object before using them?
> Try running this:
>
> C_OBJECT($to;$from;$obj)
> C_LONGINT($i;$j;$k)
>
> $to:=New object
> $from:=New object
>
> $i:=100
>
> $from.ptr:=->$i
> $to.ptr:=$from.ptr
>
> $k:=$to.ptr->  // $k = 100
>
>
> To use the code as you wrote it you must also initialize the property you
> are writing to:
>
> $from.ptr:=->$i
> $to.ptr:=->$k
>
> $to.ptr->:=$from.ptr->  // $k = 100
>
>
> But if this happens
>
> $i:=100
> $from.ptr:=->$i
> $to.ptr:=->$k
> $to.ptr->:=$from.ptr->
>
> $i:=200
>
> $k:=$from.ptr->  // $k = 200
>
>
> This was a useful exercise for me. I didn't realize you could use pointers
> this way in objects. I don't think it's a particularly good way to work
> with them but it looks like there is some fairly rigorous type checking
> going on under the hood. For example, I expected this to work:
>
> $i:=100
> $from.ptr:=->$i
> $k:=$from.ptr
>
> but it doesn't because $k isn't a pointer. However:
>
> $i:=100
> $from.ptr:=->$i
> $to:=OB Copy($from;True)
>
> $i:=200
>
> $k:=$to.ptr  //  $k = 100
>
> does work because I use the True flag to resolve the pointers to their
> values. This also points out (discovered pun) the fact that within an
> object properties are dynamically typed ($to.ptr is currently a number). OB
> Copy was a great tool in pre-ORDA days as a way to build a template of an
> object based on fields and then use it to create data objects.
>
> C_POINTER(p1; p2)
>> p1:=$from.ptr
>> p2:=$to.ptr
>> p2-> := p1->
>>
>> I get no errors, interpreted or complied.
>>
> Mixing 'classic' 4D code with 'ORDA' code is tricky. You can wind up
> spending so much time converting between the two there's just not much
> benefit. Where it excels is when you start with a new method and use ORDA
> to refactor some task in old code. Generally I will have 2/3 the code to
> accomplish the same results. Less code is better.
>
> And some things are still just faster in 'classic' 4D. Large queries for
> instance. "Large" meaning tables with millions of records or extensive
> relations. Or long loops where you are doing queries. OTOH I hear from guys
> with big applications ORDA is generally faster than SQL. In situations
> where I'm working with smaller sets (thousands or less of records) I love
> working with ORDA. And forms are just amazing using ORDA, Form, dynamic
> form variables and object notation.
>
> --
> 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 *
>
>

-- 
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: "Attempting to retype using a pointer"

2019-02-28 Thread Kirk Brooks via 4D_Tech
Jeremy,


On Wed, Feb 27, 2019 at 11:53 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Objects pre-date ORDA, as you know.

True. In this case what we are really talking about is 4D's object
notation. I tend to use 'ORDA' for all the new capabilities and should be
more specific.


> I was simply using an object as a way of permitting a method to return
> several values at the same time. Those values happened to be pointers to
> variables (created by OBJECT DUPLICATE and so necessarily referenced using
> pointers). I wanted then to copy the value in the variable pointed to by
> one pointer into the variable pointed to by another pointer. The two
> variables were of identical type, one having been created by duplicating
> the other.
>
I find this an excellent application of using objects as containers for
passing parameters to and retrieving values from a method.

Since you mention OBJECT DUPLICATE you must be working with variables on a
form. In that context using Form removes the need to work with pointers
altogether.

> There was therefore no reason why
>
> $to.ptr-> := $from.ptr->
>
> should have created any error at all; yet it did, and it was an error for
> which I can find no logical explanation, particularly given that the
> assignment did actually take place. Further, if I complicate the code by
> writing
>
Perhaps you didn't create $to and $from with New object before using them?
Try running this:

C_OBJECT($to;$from;$obj)
C_LONGINT($i;$j;$k)

$to:=New object
$from:=New object

$i:=100

$from.ptr:=->$i
$to.ptr:=$from.ptr

$k:=$to.ptr->  // $k = 100


To use the code as you wrote it you must also initialize the property you
are writing to:

$from.ptr:=->$i
$to.ptr:=->$k

$to.ptr->:=$from.ptr->  // $k = 100


But if this happens

$i:=100
$from.ptr:=->$i
$to.ptr:=->$k
$to.ptr->:=$from.ptr->

$i:=200

$k:=$from.ptr->  // $k = 200


This was a useful exercise for me. I didn't realize you could use pointers
this way in objects. I don't think it's a particularly good way to work
with them but it looks like there is some fairly rigorous type checking
going on under the hood. For example, I expected this to work:

$i:=100
$from.ptr:=->$i
$k:=$from.ptr

but it doesn't because $k isn't a pointer. However:

$i:=100
$from.ptr:=->$i
$to:=OB Copy($from;True)

$i:=200

$k:=$to.ptr  //  $k = 100

does work because I use the True flag to resolve the pointers to their
values. This also points out (discovered pun) the fact that within an
object properties are dynamically typed ($to.ptr is currently a number). OB
Copy was a great tool in pre-ORDA days as a way to build a template of an
object based on fields and then use it to create data objects.

C_POINTER(p1; p2)
> p1:=$from.ptr
> p2:=$to.ptr
> p2-> := p1->
>
> I get no errors, interpreted or complied.
>
Mixing 'classic' 4D code with 'ORDA' code is tricky. You can wind up
spending so much time converting between the two there's just not much
benefit. Where it excels is when you start with a new method and use ORDA
to refactor some task in old code. Generally I will have 2/3 the code to
accomplish the same results. Less code is better.

And some things are still just faster in 'classic' 4D. Large queries for
instance. "Large" meaning tables with millions of records or extensive
relations. Or long loops where you are doing queries. OTOH I hear from guys
with big applications ORDA is generally faster than SQL. In situations
where I'm working with smaller sets (thousands or less of records) I love
working with ORDA. And forms are just amazing using ORDA, Form, dynamic
form variables and object notation.

-- 
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: "Attempting to retype using a pointer"

2019-02-26 Thread Kirk Brooks via 4D_Tech
Jeremy,
You know objects are not intended as a way to manage transferring pointers
around. The docs actually refer to a more limited use of pointers in
objects:
https://doc.4d.com/4Dv17R4/4D/17-R4/Data-Types.300-4054923.en.html

A property value can be of the following type:
...
pointer (stored as such, evaluated using the JSON Stringify command or when
copying),


If you look at the object in the debugger you see a pointer is stored as a
text ref and 4D dereferences it when used either by Stringify or when you
use OB COPY. This makes it handy but I think it's good to keep in mind the
intent of the object is to let you manipulate the value of the pointed to
element and not move the pointer itself around. Also, objects are managing
references to the data which is similar to what a pointer is doing. You
don't really need to use a pointer in an object to reference the original
data. This is why, I think, the documented use case for pointers in objects
is limited to a way to put data into the object. The fact 4D tolerates
pointers in objects used other ways may be as much a problem as a benefit
precisely because it allows us to keep using them in this way.

I am a big fan of object notation and the ORDA commands but there are
places I avoid using them. I think using a classic 4D approach to handling
pointers, for instance, is more reliable. And if this is a case of trying
to retro-fit some ORDA code into existing code I have rarely found this
productive. You spend so much time making the old variables and _pointers_
consistent with ORDA and then moving them back again there's just no
benefit. ORDA commands work best in an ORDA context. Frankly I rarely use
pointers for anything in a v17 database. Objects and Form are just easier
and more robust.

What I have found productive working with old code is to start with a new
method and attempt whatever the overall goal is using all ORDA commands and
variables. After I did this a few times, and became familiar with the flow
of ORDA code, I usually have a method, or set of methods, that's about 1/3
the size of the original. Speed depends on the number and type of lookups.

On Mon, Feb 25, 2019 at 11:18 PM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk,
>
> My apologies. I mistyped the offending lines!
>
> The lines causing the error dereference the pointers. So they are
>
> $to.toDate->:=$from.toDate->
> $to.toAge->:=$from.toAge->
> etc.
>
> The curious things are that (a) the dereferenced pointers do definitely
> point at variables of the same type; (b) although I get an alert with the
> error message, the assignment does in fact work (that is, if I click
> “continue”, everything is exactly as it should be when the method
> completes).
>
> I can get round the error by using pointer variables:
>
> $pTo:=$to.toDate
> $pFrom:=$from.toDate
> $pTo->:=$pFrom->
>
> which works fine. I just don’t understand the actual error message, since
> I’m not doing what it’s accusing me of doing.
>
> Jeremy
>
>
>
> > On 25 Feb 2019, at 16:47, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Jeremy,
> > Since you are writing the data to an object what's the value of using the
> > pointer? Why not just write the data?
> >
> > In fact, since TCMGetRow looks like it is simply holding the data for the
> > transfer you could make it a loop:
> >
> > For($i;1;number of objects)
> >
> > $o["_"+string($i)]:=Object get pointer(Object named;$root+string($i))->
> >
> > End for
> >
> > This way you don't need to care about the data type assuming the 2
> objects
> > actually have the same typed objects for each index.
> >
> > But to specifically answer your question I would take a look at the way
> the
> > date value is stored in your object and then how you reference it.
> There's
> > another post about dates and objects that sounds on point with what you
> are
> > doing.
> >
> >
> > On Mon, Feb 25, 2019 at 7:37 AM Jeremy Roussak via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> I have a form which shows a variable number of rows of numbers and text.
> >> The rows are created using OBJECT DUPLICATE on each of the half-dozen
> items
> >> in the row (yes, using a collection listbox might be a better way do to
> it,
> >> but I wrote this code a while ago). If a row is deleted, I need to copy
> the
> >> contents of the rows beneath it upwards.
> >>
> >>
> >> So I have a method which creates an object and populates it with
> pointers
> >> to the created variables. I call this to get a set of pointers to one
> row,
> >&g

Re: "Attempting to retype using a pointer"

2019-02-25 Thread Kirk Brooks via 4D_Tech
Jeremy,
Since you are writing the data to an object what's the value of using the
pointer? Why not just write the data?

In fact, since TCMGetRow looks like it is simply holding the data for the
transfer you could make it a loop:

For($i;1;number of objects)

$o["_"+string($i)]:=Object get pointer(Object named;$root+string($i))->

End for

This way you don't need to care about the data type assuming the 2 objects
actually have the same typed objects for each index.

But to specifically answer your question I would take a look at the way the
date value is stored in your object and then how you reference it. There's
another post about dates and objects that sounds on point with what you are
doing.


On Mon, Feb 25, 2019 at 7:37 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a form which shows a variable number of rows of numbers and text.
> The rows are created using OBJECT DUPLICATE on each of the half-dozen items
> in the row (yes, using a collection listbox might be a better way do to it,
> but I wrote this code a while ago). If a row is deleted, I need to copy the
> contents of the rows beneath it upwards.
>
>
> So I have a method which creates an object and populates it with pointers
> to the created variables. I call this to get a set of pointers to one row,
> then again to get a set to the next row, and then I copy.
>
> I start
>
> C_OBJECT($from;$to)
> $from:=TCMGetRow($start)
>
> then in a loop,
>
> $to:=$from
> $from:=TCMGetRow($i)
>
> $to.toDate:=$from.toDate
> $to.toAge:=$from.toAge
> etc.
>
>
>
> TCMGetRow has
>
> C_OBJECT($0;$o)
> C_LONGINT($1;$row)
> $row:=$1
>
> C_TEXT($root)
>
> $root:="vr"+String($row)+"c"
> $o:=New object
>
> $o.toDate:=OBJECT Get pointer(Object named;$root+"0")
> $o.toAge:=OBJECT Get pointer(Object named;$root+"1")
> etc
>
> $0:=$o
>
> I’m getting the message in the subject line in the main loop for each
> assignment, but only when compiled; interpreted, it works fine. In the
> debugger, the pointers in $to and $from point to variables of the same type.
>
> I’m quite new to extensive use of objects. What am I missing?
>
> Jeremy
>
> **
> 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 notation bug?

2019-02-21 Thread Kirk Brooks via 4D_Tech
Drew,
On Thu, Feb 21, 2019 at 10:27 AM Drew Waddell via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am unable to do $oChildObject:=null in my actual situation because I am
> passing that object into a Dialog


You run into this when passing the object to a new form using DIALOG. I use
two approaches when i need to do this:
1) put the form into a subform on the parent form. You can hide it until
needed. Make the subform object an object and you're all set. This way you
avoid needing DIALOG.

2) if you need DIALOG just wrap it in another object. I like to use 'data'.
So you can do this:

$obj:=New object("data";$oChildObject)

DIALOG("myForm";$obj)

It's simple to change the references on the form objects to
Form.data.whatever. I find it more robust not the least of which because it
allows you to have a null object without crashing your form.


-- 
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: interesting find

2019-02-20 Thread Kirk Brooks via 4D_Tech
I have noticed the compiler in v17 is significantly better at flagging
little errors like that. And a lot of others. There were some wonky things
in a database I converted which is in active use, compiled, all vars typed.
I thought v17 must have corrupted the code somehow because I just didn't
think the things I saw could have been there before. But it turned out it
had been there for several years - I found it in exported method files
going back several years in some cases.

Not really a bad thing. Surprising sometimes.

On Wed, Feb 20, 2019 at 10:02 AM Chuck Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have found something in v17 that I did not think would work
>
> I have a method which is always passed a pointer. I made a mistake way
> back when in v15
>
> The compiler declaration is c_pointer (method;$1) while in the method it
> was c_text. What is strange is that it has worked in v15 but in 17 it
> throws an error as I would have expected. Hope this helps someone else.
>
> The compiler does not choke on this
>
> Regards
>
> Chuck
>
> 
>  Chuck Miller Voice: (617) 739-0306
>  Informed Solutions, Inc. Fax: (617) 232-1064
>  mailto:cjmillerinformed-solutions.com
>  Brookline, MA 02446 USA Registered 4D Developer
>Providers of 4D and Sybase connectivity
>   http://www.informed-solutions.com
>
> 
> This message and any attached documents contain information which may be
> confidential, subject to privilege or exempt from disclosure under
> applicable law.  These materials are intended only for the use of the
> intended recipient. If you are not the intended recipient of this
> transmission, you are hereby notified that any distribution, disclosure,
> printing, copying, storage, modification or the taking of any action in
> reliance upon this transmission is strictly prohibited.  Delivery of this
> message to any person other than the intended recipient shall not
> compromise or waive such confidentiality, privilege or exemption from
> disclosure as to this communication.
>
> **
> 4D Internet Users Group (4D iNUG)
> 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
**

Easy dynamic field highlighting

2019-02-16 Thread Kirk Brooks via 4D_Tech
Hi folks,
Here is a link to a few methods you may find useful.
https://github.com/KirkBrooks/Form-object-hilite

Sometimes the focus rectangle is just not the look I want on a form. What I
demo here are a couple of techniques for adding dynamic field highlighting
on the fly. Both of them are a very easy. I provide a few configurations to
get you started. It's easy to build on those and add more.

I really like the improved animation 4D has added to the way objects move
on a form.

The demo requires v17 because I use dot notation in the code. I include the
methods as text files. The actual mechanics probably work all the way back
to v11 though it's going to more cumbersome without object names. It should
be possible to re-write the code for earlier versions if you want.

-- 
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 R - Mojave compatibility

2019-02-15 Thread Kirk Brooks via 4D_Tech
Mitch,
I've been using 17R3 and recently R4 with Mojave with no issues. I'm not
doing production or using any fancy plugins with it but for general
development it's been fine.

On Fri, Feb 15, 2019 at 10:58 AM Mitchell Shiller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> I know that 17.1 is Mojave compatible.
> I am using 17R3. (I need some 4D WP features).
> Question: will there be an 17 R release that will be Mojave compatible or
> will I have to wait for v18?
>
> Thanks
>
> Mitch
>
> Sent from my iPhone
> **
> 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: v17 conundrum in design

2019-02-10 Thread Kirk Brooks via 4D_Tech
I worked on a project that did this too. In that case it turned out to be
an error in some old ALP code. Something subtle like a mistyped variable.
You may have a component or plugin that's generating the error silently.

On Thu, Feb 7, 2019 at 12:52 PM Chuck Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have an object method that shows no break points either in the method or
> when I show break points, yet it continues to stop at a particular line of
> code and it is annoying. Any ideas out there what it might be.
>
-- 
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: Set Time question

2019-02-10 Thread Kirk Brooks via 4D_Tech
Just to add a little more to this. I suspect a number of readers already
realized a really simple solution to this specific case is to simply test
the read/write state in the On timer form event and NOT update if it's read
write.

This turns out to be a better solution in my case because it's a single
place to test it vs. multiple points in the code otherwise. Easier to read
and understand.
However, it's also totally effective to just change toggle the Set timer
event on and off as Arnaud suggested, and in a different case could be
better.

Once more this turned out to be more of a question of how to look at the
problem.

On Fri, Feb 8, 2019 at 8:48 AM Kirk Brooks  wrote:

> Hi List,
> I have never used Set timer very much so I've got a noobie question. I'm
> adding some real-time updating code to financial forms: think Invoices,
> Billing Account summaries. that sort of thing. An invoice is the most
> obvious - User A has a form open that displays the invoice details (total
> amount, balance due). I want to update the balance due when a new payment
> is applied which could be from anywhere in the system. I have the code for
> all that worked out the issue is managing displaying the balance due part.
>
> Set timer is one solution. Every couple of seconds the form can simply
> reload the invoice details. The issue is the interruption to the user if
> they are doing something else on the form. Like entering data in a field or
> variable. Is there a way to trap use actions like that so I can block the
> On timer code from running?
>
> --
> 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 *
>
>

-- 
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: Set Time question

2019-02-08 Thread Kirk Brooks via 4D_Tech
Hi Arnaud,
Aha. That hadn't even occurred to me. I think that's exactly what I was
looking for. Off the top of my head I think using the On Before Data Entry
for listboxes and On before keystroke for fields.

Thank you!

On Fri, Feb 8, 2019 at 10:18 AM Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 8 févr. 2019 à 17:48, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > [...] Is there a way to trap use actions like that so I can block the
> > On timer code from running?
>
> Each new SET TIMER "kills" the previously set one, so it allows to
> postpone or cancel next 'On timer'. For example when the user types into a
> search box, send the query after he has stopped input since one or 2
> seconds.
>
> Maybe something like this in form method could work:
>
> jobPostponed:=60*2  //2 seconds, for example
> case of
>   on keystroke
> set timer(jobPostponed)
>   on timer
> set timer(0)
> job.do(please)
> set timer(jobPostponed)
> end case
>
> Thinking after, there is surely more events to consider (On click, double
> clic, menu, etc.)
>
> --
> Arnaud de Montard
>
>
> **
> 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
**

Set Time question

2019-02-08 Thread Kirk Brooks via 4D_Tech
Hi List,
I have never used Set timer very much so I've got a noobie question. I'm
adding some real-time updating code to financial forms: think Invoices,
Billing Account summaries. that sort of thing. An invoice is the most
obvious - User A has a form open that displays the invoice details (total
amount, balance due). I want to update the balance due when a new payment
is applied which could be from anywhere in the system. I have the code for
all that worked out the issue is managing displaying the balance due part.

Set timer is one solution. Every couple of seconds the form can simply
reload the invoice details. The issue is the interruption to the user if
they are doing something else on the form. Like entering data in a field or
variable. Is there a way to trap use actions like that so I can block the
On timer code from running?

-- 
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 to display read-only input form

2019-02-06 Thread Kirk Brooks via 4D_Tech
Jim,
If the table is in read only mode you can use any form you want and the
user can't edit the data.
I'd just put the table in read only and use DIALOG with the input form.

On Wed, Feb 6, 2019 at 1:32 PM Jim Crate via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Is there a convenient way to mimic the ease of DISPLAY SELECTION / MODIFY
> SELECTION to allow read/only or read/write access when using a listbox? Is
> DIALOG the only option?
>
tl:dr

Yep but call it 'best' option.

You didn't say which version of 4D we're talking about but it sounds like
an old one so I'm going to assume you're working in v15 at least. If it's
earlier than that it's probably not worth the effort to re-work it. You
know, you _could_ drop a Tesla drive train into an '92 Impala with a lot of
work and money. Or you could fix your '92 Impala with parts from another
'92 Impala. Chip is right about using variables. I did that in v13. It's
tedious, takes pages of code and is hard to change. Put the effort into
convincing the client to upgrade. So-

Make a form and display it using DIALOG in a new process. The form contains
a listbox. In v15 it could be named selection based or array based. Doesn't
really matter - just avoid selection based. Why? Because the idea is to
have a persistent list of records selected by the user. The actual
selection may change based on what the user does in the detail form. In v17
it could be an entity selection instead.

Feel free to add a quick search box above the listbox for the user to find
records quickly on a small set (like 1) criteria with the option for a more
involved query.
Depending on the type of data this list can be pretty concise or it may be
larger. If the records are fairly concise think about having the input form
right there on the dialog. This could be a subform or you could add the
fields directly. The user clicks on a record in the list and you load the
record. I like to include a button that toggles between READ ONLY and READ
WRITE. Default to read only. The uses can click around the list and records
pop up. If they need to edit something toggle the record to READ WRITE.

The advantage of a subform is you can easily swap the table you're looking
at (the listbox doesn't really care) and simply set a different subform to
the subform object.

If this is a converted database check the compatibility settings regarding
displaying fields in dialogs. For newer versions this already baked in.

Alternatively you could also pop the user selected record into a new
process for editing. This makes it easy to let the user open multiple
records from the same table in multiple windows.

OK, this crazy talk - you want to go old school: show a list and double
click to open the input form.
Fine, take all that input stuff off the dialog and add some more fields to
it. For the On double click event you toggle the table into READ WRITE,
load the record and then display it in the input form using DIALOG again.
There's nothing wrong with Modify record but DIALOG is more flexible
precisely because it's ambivalent to read write state. If the record is
locked the user can't change anything.

I've been using this approach in v15 databases for years now and it
generalizes easily to v17+. In fact it's really much easier to implement in
v17 than the old school Modify Selection approach, in my opinion.

I realize I've thrown out a lot of options here. The thing is they are all
based on a fairly small set of principles and techniques. That's what's so
cool - you have all that flexibility from using DIALOG, a listbox and some
processes.

-- 
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: Three-dimensional arrays?

2019-02-04 Thread Kirk Brooks via 4D_Tech
Pat,
I think you'll be pleased. But be forewarned - a collection based listbox
is not an extension or expansion of array based listboxes. It's a
completely new approach to listboxes. There has been a lot of discussion
about this on the list. I found this blog entry helpful:
https://blog.4d.com/display-a-collection-in-a-listbox/

Feel free to ping me if you have any questions.

On Mon, Feb 4, 2019 at 8:17 AM Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Thanks Kirk.
> I haven't had time to properly look into using Collections but this will
> give me a good incentive to do so.
>
> Pat
>
> On Mon, 4 Feb 2019 at 15:35, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com
> >
> wrote:
>
> > Pat,
> > This would be a lot easier to do with collections instead of arrays.
> >
> > Each 'sheet' can be represented by a collection. The 'workbook' is itself
> > another collection with each 'sheet' pushed onto it. You will put some
> > graphic element on the form to manage choosing the sheet you want but
> then
> > it's simply a collection based listbox.
> >
> > Using arrays is the same idea but you get into pointers and multiple 2D
> > arrays. Complicated. Collections are easy.
> >
> > On Mon, Feb 4, 2019 at 7:22 AM Pat Bensky via 4D_Tech <
> > 4d_tech@lists.4d.com>
> > wrote:
> >
> > > Here's a nice little question to ponder for a Monday morning ...
> > >
> > > Let's say we have a 2-D array that represents the cells in a
> spreadsheet
> > -
> > > eg
> > > a2tCellContents{10}{10})
> > > 10 rows x 10 columns. Simples.
> > >
> > > Now, we want to add another layer to this. Maybe for the individual
> > sheets
> > > in a spreadsheet. So if there were 4 sheets with varying numbers of
> rows
> > > and columns in each sheet, we would have a structure something like
> this:
> > > a3tContents{1}{10}{10}
> > > a3tContents{2}{5}{20}
> > > a3tContents{3}{8}{6}
> > > a3tContents{4}{2}{50}
> > >
> > > How would you accomplish this?
> > > (Using v17)
> > >
> > > PB
> > >
> > > --
> > > *
> > > 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
> > ===
> >
> > *We go vote - they go home*
> > **
> > 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
> > **
>
>
>
> --
> *
> 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
===

*We go vote - they go home*
**
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: Three-dimensional arrays?

2019-02-04 Thread Kirk Brooks via 4D_Tech
Pat,
This would be a lot easier to do with collections instead of arrays.

Each 'sheet' can be represented by a collection. The 'workbook' is itself
another collection with each 'sheet' pushed onto it. You will put some
graphic element on the form to manage choosing the sheet you want but then
it's simply a collection based listbox.

Using arrays is the same idea but you get into pointers and multiple 2D
arrays. Complicated. Collections are easy.

On Mon, Feb 4, 2019 at 7:22 AM Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Here's a nice little question to ponder for a Monday morning ...
>
> Let's say we have a 2-D array that represents the cells in a spreadsheet -
> eg
> a2tCellContents{10}{10})
> 10 rows x 10 columns. Simples.
>
> Now, we want to add another layer to this. Maybe for the individual sheets
> in a spreadsheet. So if there were 4 sheets with varying numbers of rows
> and columns in each sheet, we would have a structure something like this:
> a3tContents{1}{10}{10}
> a3tContents{2}{5}{20}
> a3tContents{3}{8}{6}
> a3tContents{4}{2}{50}
>
> How would you accomplish this?
> (Using v17)
>
> PB
>
> --
> *
> 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
===

*We go vote - they go home*
**
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: call subform

2019-01-30 Thread Kirk Brooks via 4D_Tech
Chuck,
If AddButton is on the subform you don't need CALL SUBFORM CONTAINER at
all. Just handle it there in your subform code:

OBJECT SET VISIBLE(*;"AddButton";Not(Read only state([table])))


I would put that in the form method code (i'm talking about the actual form
you use as the subform) so it ran for every form event.

It is possible to set individual objects and fields in a subform from the
parent form. In this case I don't see an advantage but you can do it.

1) get a pointer to the subform object: $ptr:=Object get pointer(Object
named;"AddButton";"subformName")

2) use EXECUTE METHOD IN SUBFORM to execute some code in the subform that
handles the button visibility.


On Wed, Jan 30, 2019 at 5:02 AM Chuck Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The AddButton is on subform. So I am not sure what goes on. Should I be
> setting call subform container in the print form or the subform. Docs look
> like it should be in subform form method. Is this not the case and yes
> trace seems to not show anything anywhere
>
> --
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
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: call subform

2019-01-29 Thread Kirk Brooks via 4D_Tech
Hi Chuck,


On Tue, Jan 29, 2019 at 5:11 PM Chuck Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have created a subform with an add button on it. In the form method I
> call subform (-999)
>
What kind of subform? input or output
What is the button adding? And is it doing so with an automatic action or
your own code?

In object on the subform I have case
> :(form event=-999)
> if(read only state(table))
> object set visible(*;”Addbutton”;false)
> else
> object set visible(*;”Addbutton”;true)
> end if
>
Have you traced the subform object to verify the code isn't running? I've
never really seen CALL SUBFORM CONTAINER not ping the parent object.
Also, the way you have described this "Addbutton" is on the parent form -
since the code will run in the context of the subform object on the parent
form.

I guessing but it looks like you may want "Addbutton" to be on the subform
and only visible when it's possible to add a record to 'table' which is
displayed in the subform. I would handle that in the subform itself - where
you code would work fine. But is Addbutton is on the subform it won't do
anything called from the subform object.

Does that help?


-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
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   >