Re: ORDA and 4D selections

2019-04-10 Thread John DeSoi via 4D_Tech
Good points. The primary disadvantage in my opinion is the loss of table and 
field referencing because queries and other functions embed everything in 
strings. Understanding or modifying a large code base (especially if you did 
not write it) is going to be a lot harder with ORDA versus traditional 4D code.

My approach is to create wrappers that generate ORDA strings from the structure 
references. A lot more work to set up, but hopefully it will pay off in the 
long run. Another advantage of this approach is the work can be abstracted to 
work with other databases, e.g. generate SQL instead of ORDA.

John DeSoi, Ph.D.
 

> On Apr 10, 2019, at 12:01 PM, Christian Sakowski via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> ORDA has many advantages compared to the classic 4D language:

**
4D Internet Users Group (4D iNUG)
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: Auto Updating 4D Not Working

2019-04-08 Thread John DeSoi via 4D_Tech
Hi Cannon,

It is working for me with 17.1. The 4D application is in the Applications 
folder and the update folder is a mounted disk image in the Downloads folder. 
If you are using other types of paths, maybe try something like that? Perhaps 
it could be a security restriction added by a recent macOS version. 

John DeSoi, Ph.D.


> On Apr 4, 2019, at 10:01 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 4D v17.1HF1, macOS only. (It works fine on Windows). I’m using essentially 
> the same code as in several other applications, also on v17.1HF1, but this is 
> the only application that doesn’t work. Also, it was working in previous 
> versions of 4D, but doesn’t now. With no code changes.

**
4D Internet Users Group (4D iNUG)
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-04-01 Thread John DeSoi via 4D_Tech
On the Mac one option is to script storing the private key in the Keychain with 
LAUNCH EXTERNAL PROCESS. Type "man security" Terminal to see the command line 
interface options.

John DeSoi, Ph.D.


> On Mar 31, 2019, at 10:54 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was planning on keeping the keys in the data file... but I can see that 
> might be an issue.
> Any other ideas on where/how to keep the keys, given the above?

**
4D Internet Users Group (4D iNUG)
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: Backup and journal file configurations

2019-03-25 Thread John DeSoi via 4D_Tech

> On Mar 25, 2019, at 5:11 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> When you are moving data files around between systems, just copy the entire 
> data file folder. That will have the .4DD, .4DIndx, .Match and .journal 
> files. If they are all in the same folder you can open that data file with 
> another structure and it will not ask you for the location of the .journal. 
> The key is to have all these files in the same folder and to always move the 
> entire folder between machines. 

Having the .journal file next to the database file defeats the main benefit of 
having the journal. If the drive crashes, you could could recreate the database 
from the last backup and the journal file (assuming both are on another drive).

> Now if you copy that datafile folder back to your development machine, you 
> have to copy the .journal file too. I believe .journal file usage is 
> internally stored in a .4DD, so once you have it set up, they must stay 
> together, or you get the messages you are talking about.

If your log file is on a second volume in production and your development 
machine has only one drive, there is no way to automate the restore of the 
backup without the log file prompts. I also wanted a fully automated restore 
with no log file or prompts to allow users to test experimental features. This 
is possible in every database I'm aware of, except for 4D.

See feature request from Jeff Kain and other discussion here:

https://forums.4d.com/Post/EN/22296877/1/22296878


John DeSoi, Ph.D.

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

Re: Getting a collection created from 4D function to work in Storage.

2019-03-20 Thread John DeSoi via 4D_Tech
The first line does nothing because you don't do anything with the function 
result of the call. The second line assigning $myTempVolumeCol to a copy 
returns a regular collection (see documentation). The error is because you 
can't assign a regular collection to a shared collection 
(Storage.serverVolumes:=$myTempVolumeCol).

To duplicate an object or collection as a shared object/collection you have to 
iterate over all of the values and then recursively convert to shared any 
object/collection.

John DeSoi, Ph.D.


> On Mar 20, 2019, at 12:16 PM, Eric Naujock via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> New shared collection($myTempVolumeCol)
> $myTempVolumeCol:=$volumeData.copy()  
>   Use (Storage)
>   Storage.serverVolumes:=New shared collection
>   Use (Storage.serverVolumes)
>   Storage.serverVolumes:=$myTempVolumeCol
>   End use 
>   End use 
> 
> This code gives me the following error. “Not supported value type in a shared 
> object or a shared collection” This seems to be preventing me from using the  
> Storage. I can just assign the variable as an interprocess variable but I was 
> trying to get away from using interprocess variables. Any suggestions?

**
4D Internet Users Group (4D iNUG)
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: Apple Notary Service

2019-03-16 Thread John DeSoi via 4D_Tech
Does this really work (or might it break in the future) as 4D modifies the 
application package at runtime? I noticed that the code signature is no longer 
valid once you run the application (codesign --verify --verbose 
/path/to/application).

John DeSoi, Ph.D.


> On Mar 15, 2019, at 9:29 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Notarisation goes one step further than a normal code sign.

**
4D Internet Users Group (4D iNUG)
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 John DeSoi via 4D_Tech
Hi Chip,

> 
> On Feb 28, 2019, at 9:12 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> I see the issue -- The time array is NOT an array of Time
> using v13 (no Time array)
> so I had to use a longint array, or a time variable which points out 
> the problem.

Version 13 is long dead and this has nothing to do with any version before 
ARRAY TIME was added. The problem is simple enough to work around, but the 
point of my post and (and Jeremy's) is that type handling and pointer 
dereferencing should be consistent and handled correctly by 4D. And the results 
between interpreted and compiled should be consistent unless it is documented 
not to be.


> I believe it is:
> Even though there is a TIME ARRAY() command, the underlying array is 
> not actually time but longint.

But the code works as expected in interpreted mode. So 4D knows it is a time 
array in interpreted mode, but not compiled mode?

John DeSoi, Ph.D.

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

Re: "Attempting to retype using a pointer"

2019-02-28 Thread John DeSoi via 4D_Tech
4D has improved over the years, but there is still a number of type handling 
inconsistencies. Only option seems to be to work around them by moving data 
into different variable types.

The method below (_TEST) works interpreted but gives a runtime error in 
compiled mode. Reported as a bug in 2016 for 4D 15. Still fails in 17.1


C_POINTER($1)
C_TEXT($val)

If (Count parameters>=1)
$val:=String($1->;HH MM SS)
ALERT($val)
Else 
ARRAY TIME(ah_Time;1)
ah_Time{1}:=Current time
_TEST (->ah_Time{1})
End if 



Here is another issue in 4D 17.

C_OBJECT($object)
C_POINTER($field)

$object:=New object("tableNumber";1;"fieldNumber";1)

$field:=Field($object.tableNumber;$object.fieldNumber)

The above works but the Field command won't compile: Too many parameters have 
been passed to this method.


John DeSoi, Ph.D.


> On Feb 28, 2019, at 1:53 AM, Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I get no errors, interpreted or complied. 
> 
> That seems to me to be a fault somewhere in 4D’s handling of pointers.

**
4D Internet Users Group (4D iNUG)
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: Build Application “No License is Installed" and ...

2019-02-26 Thread John DeSoi via 4D_Tech
Maybe. I never worried about it before for custom and personal applications, 
but each version of macOS is getting more restrictive. With 10.14 certain 
commands called by 4D with LAUNCH EXTERNAL PROCESS stopped working. The error 
said you had to give access to the app in security and privacy preferences. I 
did that and it seemed to work for a day or two and then it would start giving 
the error again even though nothing had changed. I rebuilt with a developer 
certificate and it seems to have solved the issue.

John DeSoi, Ph.D.


> On Feb 26, 2019, at 10:56 AM, John J Foster via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> If I have no intention of placing my standalone (w/engine) app in the Apple 
> store do I need to concern myself with an app certificate?

**
4D Internet Users Group (4D iNUG)
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 17.1 duplicate constant

2019-02-20 Thread John DeSoi via 4D_Tech
Just killed a bunch of time trying to figure out why some menu actions were not 
working for a host menu duplicated by a component. It turns out the "Associated 
standard action" constant is duplicated with different values and 4D does not 
use the same one in all cases.


John DeSoi, Ph.D.



  Associated standard action
  Associated standard action



  Associated standard action
  Associated standard action

**
4D Internet Users Group (4D iNUG)
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: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-09 Thread John DeSoi via 4D_Tech
I always use singular table names and the relationship names are singular or 
plural based on their type. For example, I have a structure that imports 4D 
code and builds a database of each method path and the related methods it 
directly calls:

[Method_Call]ID

[Method_Call]Caller_Method_ID -> [Method]ID
M to 1: Caller
1 to M: Method_Callers

[Method_Call]Callee_Method_ID -> [Method]ID
M to 1: Callee
1 to M: Method_Callees

John DeSoi, Ph.D.



> On Feb 8, 2019, at 12:50 PM, Ed Hammond via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hey all of you ORDA pioneers and converts!
> 
> 
> Have any of you come up with a convention for naming relations for use with 
> ORDA? What have you found that works? or doesn't?

**
4D Internet Users Group (4D iNUG)
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 built client on windows a few issues

2019-02-06 Thread John DeSoi via 4D_Tech

> On Feb 6, 2019, at 11:15 AM, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am using v17.2 64 bit client. On a variety of windows machines, entering a 
> enter from extended keyboard is causing volume desktop has stopped working 
> and of course 4D just quits. Anyone else having these issues. 

I think you mean 17R2? As far as I know 17.0 is still the latest mainline 
version released the middle of last year. I'm hoping 17.1 comes out soon and 
solves issues with macOs 10.14 Mojave among other issues. But full credit to 4D 
for increasing quality of .0 releases.

> 
> Also ins Reading quick report documentation the normal menus are not there so 
> we can not sort columns. I am sure this one is some setting I do not 
> understand

Quick Reports is rewritten (as a component?) in 64 bit implementations and has 
a lot of feature differences from previous 32 bit versions. You are probably 
not missing a setting that will make it work like the previous version.

John DeSoi, Ph.D.

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

Re: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
Hi Neil,


> On Jan 30, 2019, at 3:40 PM, Dennis, Neil  wrote:
> 
>> If a shared method is marked as preemptive capable, any shared method it 
>> uses must also be marked as preemptive capable. Otherwise 4D says the method 
>> further down in the call chain is not thread safe even if it has no thread 
>> unsafe commands.
> 
> Wait, If the parent is marked preemptive the children can be marked 
> indifferent and still run preemptive.
> 
> I have been wrong once today, am I wrong again?

Yes, twice in one day if we are talking about components and shared methods :). 
I have a component that includes a lot of different libraries. I can 
selectively build different versions of the component by choosing which method 
groups to make shared. I built a Postgres client component, tested in 
preemptive mode, and all was good.

Next, I went to save all of the source in my version control system. My method 
to do this makes all project methods shared because I don't want the version 
history to be changed by the component build which only makes specific method 
groups shared. Otherwise, methods would show up as changed just because the 
shared attribute was changed. 

After not changing a single line of code and changing all methods to shared, I 
suddenly had 300+ compiler errors. This took hours to sort out. Any shared 
method called by a preemptive capable method must also be marked as preemptive 
capable. Otherwise 4D compiler generates an error but gives no clue as to why 
it is an error.

John DeSoi, Ph.D.


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

Re: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
Hi Christian,

That is really impressive since they seem like complex plugins that need a lot 
of 4D interaction and there are currently very few plugin API calls that are 
thread safe. 

Are you really saying that I can mark a 4D method as preemptive capable and use 
significant functionality of the plugins in a preemptive process?

John DeSoi, Ph.D.


> On Jan 30, 2019, at 4:10 PM, Christian Sakowski 
>  wrote:
> 
>> I'm not aware any commercial 4D plugin that works in preemptive mode.
> 
> hmCal and hmReports are thread safe.

**
4D Internet Users Group (4D iNUG)
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: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
Chip,

This is true, but there is some extra complexity involved with components:

If a shared method is marked as preemptive capable, any shared method it uses 
must also be marked as preemptive capable. Otherwise 4D says the method further 
down in the call chain is not thread safe even if it has no thread unsafe 
commands. 

John DeSoi, Ph.D.


> On Jan 30, 2019, at 3:05 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> there was no mention of components.
> I assume, as components are effectively 4D methods, that a thread safe 
> method (call chain) in a component, would make a call to the component 
> method from the host system thread safe as well.

**
4D Internet Users Group (4D iNUG)
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: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
Yes, I was not trying to imply that all plugins are thread safe, only that it 
is possible to create one following the direction outlined in the SDK. It is 
supported and there are significant speedup benefits if you can make it work.

I'm not aware any commercial 4D plugin that works in preemptive mode.

John DeSoi, Ph.D.


> On Jan 30, 2019, at 3:00 PM, Timothy Penner  wrote:
> 
> In either case, it would appear that although the SDK has been updated, the 
> individual plugin developers would still need to update their plugins and 
> make those preemptive versions available... and even then, there are still 
> certain plugin calls that are not thread safe, so it shouldn’t be expected 
> that plugins will just work in preemptive mode unless they are using the 
> latest SDK and specifically coded as such.
> 
> Just because the SDK is being made preemptive does not mean that all plugins 
> are inherently preemptive also.

**
4D Internet Users Group (4D iNUG)
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: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
Hi Tim,

The header file in the publicly available SDK indicates which plugin API entry 
points are thread safe (currently a small number).

https://github.com/4d/4D-Plugin-SDK

See further discussion here including input from 4D France:

> Yes the 4d plugin sdk allows to build preemptive ready plugins.
> see https://github.com/4d/4D-Plugin-SDK/releases/tag/v17.0.1


https://forums.4d.com/Post/FR/17981754/2/28184397

Also

https://github.com/miyako/4d-plugin-migration-to-v17

John DeSoi, Ph.D.


> On Jan 30, 2019, at 2:32 PM, Timothy Penner  wrote:
> 
> Plugin development is not something 4D Tech Support usually handles, so I may 
> have missed that - in either case, the docs seem like it is not possible...

**
4D Internet Users Group (4D iNUG)
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: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
In version 17 you can use plug-ins in preemptive mode if the plugin call is 
marked as thread safe. I converted my Postgres component/plugin to work in 
preemptive mode. Tests show 300% to 400% improvement over single core execution.

See this lengthy thread on the forum for issues in converting code to work in 
preemptive mode.

https://forums.4d.com/Post/EN/27444918/2/27983967

John DeSoi, Ph.D.


> On Jan 30, 2019, at 1:04 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> No, not at all. You have to first mark the method that's called first from 
> New Process as preemptive. That method, plus all methods called by that 
> method, and all methods called by those methods, must be written in a 
> preemptive-safe manner (i.e. no UI, no unsafe commands, no plug-ins).

**
4D Internet Users Group (4D iNUG)
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: Does 4D 64-bit Volume desktop use more than 1 core?

2019-01-30 Thread John DeSoi via 4D_Tech
No, a normal process can be preemptive (started with New process or Executed on 
server) as long as the starting method is preemptive capable.

John DeSoi, Ph.D.


> On Jan 30, 2019, at 2:14 PM, Dennis, Neil via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I thought for a process to work on a separate core it needed to be a WORKER 
> process and preemptive capable. So if you call new process it will not be 
> preemptive. If you call worker it can be preemptive if the code is 
> preemptive. I was also under the assumption is that each worker process does 
> not use multiple cores, but a worker process can use a different core from 
> other worker processes

**
4D Internet Users Group (4D iNUG)
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: XLS plugin - format number with leading zero

2019-01-30 Thread John DeSoi via 4D_Tech
I don't know anything about the plugin you were attempting to use, but one way 
to create formatted documents for Excel is to use XML. You specify the type for 
each cell. I'm sure you could figure out the format option you want by saving a 
document with Excel and looking at the XML.

John DeSoi, Ph.D.


> On Jan 30, 2019, at 1:42 AM, 4dialog via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> The problem is not i 4D, i get the leading zero but only in a text cell.
> In excel you can format manualy a column as number with fixed numbers
> preformated (selfdefined format). In my case, 11 numbers, "000". If
> you put 10 numbers in a cell it gets leading zero.
> 
> But is there a way to do this formating from 4d?

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

Re: listbox commands and collection variables

2019-01-23 Thread John DeSoi via 4D_Tech
Hi Kirk,

> I'm not able to replicate all of the issues you mention with a collection
> based listbox. To test I made a form and added a collection based listbox
> with two columns. To open it I made a method, created a collection with 10
> elements comprised of objects and had the listbox displace the data. I
> added a button, selected a row and ran the following code:

Thanks for taking the time to test. Perhaps there is something strange about my 
structure. But I'm directly testing by commenting out the dereference pointer 
method (does not work) and then using the named object method (works). This is 
converting previous code with the other types of listboxes that had no issues. 
In all cases I'm building the listboxes dynamically, maybe that has something 
to do with it.

I just tested this again in the debugger stepping through both cases:

ARRAY TEXT($colNames;0)
ARRAY TEXT($hdrNames;0)
ARRAY POINTER($colVars;0)
ARRAY POINTER($hdrVars;0)
ARRAY BOOLEAN($visible;0)
ARRAY POINTER($styles;0)

If (True)  //Bug in 17 - does not work with collection based listbox pointer.
  $name:=Pointer_name ($1)
  LISTBOX GET 
ARRAYS(*;$name;$colNames;$hdrNames;$colVars;$hdrVars;$visible;$styles)
Else 
  LISTBOX GET 
ARRAYS($1->;$colNames;$hdrNames;$colVars;$hdrVars;$visible;$styles)
End if 

$1 is a pointer to the collection listbox variable and the debugger shows it 
has 10 elements. The object name on the form is the same as the variable name. 
If I execute it with the name, $hdrVars has 4 elements. But all arrays have 
zero elements if I use the dereferenced pointer.


> The listbox correctly fired an On column moved event and *LISTBOX MOVED
> COLUMN NUMBER*(*;"listBox";$pos1;$pos2) correctly populated.

You tried this using a dereference pointer? This was the one that was not 
working last night that made me decide to post something.

Thanks,

John DeSoi, Ph.D.


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

listbox commands and collection variables

2019-01-22 Thread John DeSoi via 4D_Tech
17.0 HF4 Mac

I've noticed that a lot of generic listbox code fails with collection 
variables. For example, in passing a listbox pointer to a method such as

LISTBOX SELECT ROW($arrayListbox->;$row) `works

LISTBOX SELECT ROW($selectionLisbox->;$row) `works

LISTBOX SELECT ROW($collectionLisbox->;$row) `does not work

Other commands that don't seem work the same with collection list boxes include:

LISTBOX GET ARRAYS
LISTBOX MOVED COLUMN NUMBER
OBJECT GET COORDINATES
OBJECT MOVE

Something to watch out for if you are converting code to work with collection 
listboxes. You have to change everything to use the object name instead of the 
variable.

John DeSoi, Ph.D.

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

Re: Apple Push Notification Servers (APNS)

2019-01-15 Thread John DeSoi via 4D_Tech
I have seen this error which I thought was related to a keep-alive error (* as 
the last parameter) in the HTTP client implementation, but it appears you are 
not using that option. My work-around was to just retry the request which 
seemed to work. Might be worth a try.

John DeSoi, Ph.D.




> On Jan 15, 2019, at 6:41 PM, Tom-Lists via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> in v17.0:
> Error code: 17 (4DRT)
> Unimplemented control instruction.

**
4D Internet Users Group (4D iNUG)
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: Socket Communication

2019-01-15 Thread John DeSoi via 4D_Tech
Polling does not have to be an immediate request/response. See long polling:

https://www.pubnub.com/blog/2014-12-01-http-long-polling/

With websockets your are going to have a connection open all the time anyway, 
so long polling is no more resource intensive. I would not use it for the 
public web, but for 50 to 100 clients on a local network it seems pretty 
straight forward.


John DeSoi, Ph.D.


> On Jan 15, 2019, at 3:40 PM, Stephen J. Orth  
> wrote:
> 
> This is just "polling" logic and won't work for us, which is why I am asking 
> about web sockets.
> 
> In our world, when a machine goes down we have to immediately contact the 
> browser managing the machine.  In polling logic, it would mean we only check 
> every X interval.  Before anyone says "well just make it a short interval" 
> take into account I may have 50 - 100 browsers all polling continuously.  
> This is a lot of traffic which simply asks the server "anything for me".  
> Keep in mind 99% of the time the answer from the server will be no.  This is 
> a lot of overhead for the 4D Server to be dealing with continually.
> 
> It's much more efficient, considerably less taxing, to just have the server 
> push a request to the shop floor browser only when some action is required...

**
4D Internet Users Group (4D iNUG)
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: Socket Communication

2019-01-15 Thread John DeSoi via 4D_Tech
Steve,

> On Jan 15, 2019, at 3:08 PM, Stephen J. Orth  
> wrote:
> 
> Not sure I understand what you are saying, would you be able to provide me 
> with a high level overview of what you are thinking?

HTTP is a request/response protocol where the server only responds to requests 
from the client. Websockets are full duplex and bi-directional meaning either 
side of the connection can both send and receive asynchronously. See

http://blog.arungupta.me/rest-vs-websocket-comparison-benchmarks/

> 
> Our Server will be performing analytics' and at some point it will trap on a 
> condition that needs to be communicated to the shop floor.  For example, a 
> machine has been idle for more than 5 minutes.
> 
> When this event is flagged, the server needs to tell the browser on the 
> floor, associated with this machine, to take a specific action. Basically the 
> browser will need to present a different window for the operator to respond 
> into.
> 
> So I'm just trying to understand how the HTTP idea you presented would work 
> in this situation...

This can be achieved in a HTTP/browser interface without much trouble. I think 
all you would need to do is set a timer for your web interface to periodically 
check with the server for a change in state. Probably not as efficient as 
websockets, but a fraction of the development effort unless you already have a 
websocket server implementation ready to go.

Here is an example of using a JavaScript timer to perform some action, e.g. a 
periodic http call to your server.

https://javascript.info/settimeout-setinterval

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

Re: Socket Communication

2019-01-15 Thread John DeSoi via 4D_Tech
Do you really need the ability for the server to send data asynchronously to 
the client (browser)? If not, then HTTP should work and is already supported in 
the browser and on 4D Server.

John DeSoi, Ph.D.


> On Jan 15, 2019, at 1:30 PM, Stephen J. Orth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Very much appreciated.  I swear I saw something at a Summit, or read 
> something about 4D supporting web sockets?

**
4D Internet Users Group (4D iNUG)
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: Sales Tax Solutions for 4D

2019-01-04 Thread John DeSoi via 4D_Tech
What 4D version are you using and how are you sending the request? What you 
have below does not correspond to any recent 4D HTTP client interface which 
passes the headers/values as two text arrays.

Why are you sending a content-length header for GET request?

John DeSoi, Ph.D.


> On Jan 4, 2019, at 2:44 PM, JasonH via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Trying out Taxjar, but need a little help to get started.
> 
> I'm currently sending the following to https://api.taxjar.com (or
> api.sandbox.taxjar.com)
> $vt_HTTP_Request:=\
> "GET /v2/rates/"+$vt_Zip+<>CRLF+\
> "Host: "+$vt_Service_URL+<>CRLF+\
> "Connection: close"+<>CRLF+\
> "Cache-Control: no-cache"+<>CRLF+\
> "Content-type: text/html; charset=utf-8"+<>CRLF+\
> "Content-length: "+String($vi_Content_Length)+<>CRLF+\
> "Authorization: Bearer "+$vt_API_Key+<>CRLF+<>CRLF+\
> $vt_HTTP_Request

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

list box column width on resize

2018-12-29 Thread John DeSoi via 4D_Tech
I have code since the advent of list boxes that allows a column other than the 
last one to grow and shrink as the window is resized. It works for array based 
list boxes, but I just noticed it is no longer working for (named) selection 
list boxes in version 16 or 17. The last column always changes size with the 
window even if I give it fixed min and max size.

I also tried using the Auto-Column Resize option (version 17), but that seems 
buggy as well. I set a minimum size for all columns yet it pushes columns down 
to a few pixels when the window shrinks. The only way it only sort of worked is 
to make all of the columns a fixed size except one. All the columns are added 
when the form is loaded, maybe that is part of the issue.

John DeSoi, Ph.D.

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

Re: How to process all WritePro area expressions for replacement / update?

2018-12-21 Thread John DeSoi via 4D_Tech
This may help you get started:


ARRAY LONGINT($aPos;0)
ARRAY LONGINT($aLen;0)
$start:=1

While (Match regex("\\s*)";$text;$start;$aPos;$aLen))
  $expr:=Substring($text;$aPos{2};$aLen{2})
  $expr:=Substring($expr;10)  //Strip off leading -d4-ref:'
  $expr:=URL_Decode ($expr)


End while

John DeSoi, Ph.D.


> On Dec 21, 2018, at 12:28 PM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Editing a WritePro area using the WP Get text returns stylized text, and all 
> expressions have a “-d4-ref:’expression_here’”, but these are html and 4D 
> command number added expressions.

**
4D Internet Users Group (4D iNUG)
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: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
There is no such command SET ALLOWED COMMANDS, only SET ALLOWED METHODS which 
only works on methods. If you allow users to enter "QUERY" then they can also 
enter DELETE SELECTION. The documentation says:

> If you would like the user to be able to call 4D commands that are 
> unauthorized by default or plug-in commands, you must use specific methods 
> that handle these commands. 
> Note: The mechanism for filtering access to commands and methods in the 
> Formula editor can be disabled for all users or for the Designer and 
> Administrator via an option on the "Security" page of the Database Settings. 
> If the "Disabled for all" option is checked, the SET ALLOWED METHODS command 
> will have no effect.


John DeSoi, Ph.D.


> On Dec 20, 2018, at 2:15 PM, David Ringsmuth  wrote:
> 
> SET ALLOWED COMMANDS should also work for 4D commands, since if a user is 
> allowed to enter expressions, than those expressions should be restrictable.

**
4D Internet Users Group (4D iNUG)
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: Storing Dates and Times From Different Time Zones

2018-12-20 Thread John DeSoi via 4D_Tech
I use the code below to determine the number of seconds offset from GMT for the 
current time zone. This could be added back to a GMT time stamp to get the 
local time.

John DeSoi, Ph.D.


C_LONGINT($0)

C_DATE($zDate;$gmtDate)
C_TIME($zTime;$gmtTime)
C_TEXT($str)

$zDate:=Current date

$str:=String($zDate;ISO date GMT;$zTime)  //2010-09-13T16:11:53Z
$str:=Substring($str;1;Length($str)-1)  //Remove the Z or it gives us back 
local time.
$gmtDate:=Date($str)
$gmtTime:=Time($str)

Case of 
  : ($zDate=$gmtDate)
$0:=$zTime-$gmtTime
  : ($zDate>$gmtDate)
$0:=(?24:00:00?-$gmtTime)+$zTime
  : ($gmtDate>$zDate)
$0:=0-((?24:00:00?-$zTime)+$gmtTime)
End case 


> On Dec 20, 2018, at 11:54 AM, Nate Rheaume via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We have clients that are accessing the same server database from different 
> time zones. We would like to store date/time using GMT and then display it in 
> the users local time zone.
> 
> Using the String command it's easy to convert to GMT but I'm not sure what 
> the best way is the convert GMT back to the local time zone.
> 
> Has anyone else dealt with this issue? Any feedback is appreciated.

**
4D Internet Users Group (4D iNUG)
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: WA Evaluate JavaScript in 16.4

2018-12-20 Thread John DeSoi via 4D_Tech
Try turning 'Use embedded rendering engine' off for the web area. And verify 
your JavaScript code works outside of 4D in Safari when using Mojave.

John DeSoi, Ph.D.


> On Dec 20, 2018, at 11:10 AM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> The parent form:
> Case of
>: (Form event=On Load)
>WA OPEN URL(wa;"https://google.com/;)
>WA SET PREFERENCE(wa;WA enable JavaScript;True)
>WA SET PREFERENCE(wa;WA enable Web inspector;True)
> End case
> 
> 'Use embedded rendering engine' is checked.
> 
> Has anyone else experienced this? Any suggestions?

**
4D Internet Users Group (4D iNUG)
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: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
I see two options:

1. Submit a bug/feature request to 4D and hope they change it to return nothing 
instead of "Undefined".

2. Replace all of your QUERY commands with a method that returns an empty 
string.

I don't use 4D Write Pro, but I think automating the replacement in 4D Write 
before conversion should not be too difficult. I also think it would be a win 
over the way you are doing it because having the project method shows the 
queries, tables, and fields in the design environment referencing. You lose 
that visibility by embedding queries directly in 4D Write documents.

Maybe that does not work if you have end users writing their own queries for 4D 
Write. That seems dangerous to me.

John DeSoi, Ph.D.


> On Dec 20, 2018, at 11:01 AM, David Ringsmuth  wrote:
> 
> We have hundreds of converted documents with queries in them that worked 
> correctly in 4D Write. There they executed and did not display “Undefined” in 
> the 4D Write document. These should not have to be wrapped commands to work 
> without an “Undefined” appearing in the WritePro document.
>  
> This in new and apparently wrong behavior in WritePro.
>  
> If this is not an error in WritePro, and if it is the intended operation of 
> WritePro, then it is a warning to everyone converting from 4D Write documents.
> 

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

Re: WritePro expression undefined

2018-12-20 Thread John DeSoi via 4D_Tech
SET ALLOWED METHODS specifies project methods allowed, not 4D commands. So 
unless you named a project method the same as the 4D command QUERY, you are 
using it wrong. And the 4D command QUERY does not return a result, so I'm not 
sure how you would use that in an expression. Of course, you can write a 4D 
project method that uses QUERY and returns a result in $0 as the result of the 
4D Write expression.

John DeSoi, Ph.D.


> On Dec 20, 2018, at 9:30 AM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> WP PRINT(Rpt_ob;wk 4D Write Pro layout)
> SET ALLOWED METHODS included “QUERY”
> 
> 4D Query command expressions appear as “Undefined” in the printed document. 
> The command appears successful.
> 
> Please help!

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

Re: 4D Write for v17

2018-12-15 Thread John DeSoi via 4D_Tech
Maybe 4D Write version 16 plugin will work with 32 bit 4D 17? Not sure, never 
tried it. As long as you don't need to run 4D Write in version 17 (just need to 
compile/load with the old code), you can create a 64 bit plugin stub that just 
has the 4D Write resources. I can send you one if you need help on that.

John DeSoi, Ph.D.


> On Dec 14, 2018, at 8:38 PM, Mitchell Shiller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> In process of migrating from v16 32 bit to v17 64 bit all on Mac.
> Converted my interpreted database, but can’t find a copy of 4D Write for v17. 
> The v16 version won’t load in v 17.
> I wanted to convert all my 4D Write to 4D WritePro in 32 bit. Once stable 
> then jetison the old 4D Write and compile for 64 bit.
> 
> Any idea where I can find the plug in (It is not in the Mac complete 
> installer)? Or do I have to do this in v16 first?
> 

**
4D Internet Users Group (4D iNUG)
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: Native 4D to make REST request to Django application

2018-12-10 Thread John DeSoi via 4D_Tech
I'm not familiar with Django, but here are some suggestions after a quick look 
at their API. They show an examples here with curl. 

https://www.django-rest-framework.org/tutorial/quickstart/

https://www.django-rest-framework.org/api-guide/authentication/

If you run these adding the --verbose option you should be able to get an 
accurate picture of what is sent and received. From there you can probably 
figure out what is going wrong with your 4D implementation. 

John DeSoi, Ph.D.


> On Dec 10, 2018, at 5:52 PM, Olson, Brad via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am looking for assistance with developing a REST interface to a Django 
> application using native 4D v16R6 commands.  Is it possible to do this?  I 
> have been given a username, Password, and Basic Authorization token and  I 
> have tried using the HTTP AUTHENTICATE command to set username and password, 
> and then adding the Authorization to the http header but I am not getting 
> back the expected JSON results using the HTTP Get function.

**
4D Internet Users Group (4D iNUG)
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 Structure Export...

2018-12-07 Thread John DeSoi via 4D_Tech
> 
> On Dec 7, 2018, at 1:07 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I'm not familiar with VC_Framework but the big improvement in R3 is the
> addition of Form convert to dynamic. This allows you to export all the
> forms  - not just the object and form methods. The objects created are
> fully functional dynamic form objects. This is the last piece we needed to
> be able to fully build a database from exported files.


17 R3 is not quite there for exporting forms in a way that can easily be moved 
to another structure. Form convert to dynamic does not include the form or 
object method paths. I'm hoping that will change, see the recent discussion on 
the forum.

If you export the forms from the structure (not using Form convert to dynamic), 
the form/object method references are there. But I don't think you can use that 
to reload the form in another database because the method property can only be 
a project method. So to use the form in another database you would have to 
translate the form/object methods into a project methods somehow.


> It's easy to diff
> folders with methods or form definitions. I've done this with folders
> containing thousands of methods in a couple of minutes.

The other way to do it is to just export all the files to the same version 
controlled directory. The commit for each release. The version control tool 
will show exactly which files are changed since the last release and tracks all 
changes over time. For 4D, you'll just need to add something to remove methods 
that have been deleted or renamed. Git automatically figures out when a file 
has been renamed instead of deleted.


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

Re: Calling java

2018-12-04 Thread John DeSoi via 4D_Tech
Creating a plugin would be pretty involved. If LAUNCH EXTERNAL PROCESS is too 
slow, I would look into something like JSON RPC. For example,

https://www.jsonrpc.org/archive_json-rpc.org/implementations.html

https://github.com/briandilley/jsonrpc4j

John DeSoi, Ph.D.


> On Dec 4, 2018, at 1:48 AM, Piotr Chabot Stadhouders via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> We need to call some java classes from within 4D.
> These classes deliver an interface to interact with a smart card connected to 
> the local PC
> Does anybody have an opinion how to handle this?
> I don't see any other way than to use these java classes, and one way or the 
> other call this java in 4D

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

Re: ORDA to get "record number" value

2018-11-28 Thread John DeSoi via 4D_Tech
If you only need to emulate the Record number function for a particular entity, 
you could use getKey() to get the primary key and then Find in field to get the 
record number.

John DeSoi, Ph.D.



> On Nov 23, 2018, at 11:10 AM, Gianluca Rigotti via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Hi all,
> anyone know if there is a way to get the same value returned by “Record 
> Number” using an ORDA query?

**
4D Internet Users Group (4D iNUG)
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.2 to v17.0HF3 conversion problem

2018-11-23 Thread John DeSoi via 4D_Tech
You could write something to load each form and then use OBJECT Get action to 
find the problem check boxes. 

Or open a copy of the structure in 17R and export all the forms to search them 
with your favorite text editor.

John DeSoi, Ph.D.


> On Nov 22, 2018, at 9:36 PM, Keith Goebel via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Wish I could say I found an easy way to locate the “bad" ones by using Find 
> in Design, but I can’t - sorry - it was a purely manual “check every checkbox 
> on every form” chore.
> I found only 7 forms out of over a hundred that were affected, and only some 
> of the checkboxes on those forms.

**
4D Internet Users Group (4D iNUG)
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: Explorer bottom toolbar not displaying...

2018-11-21 Thread John DeSoi via 4D_Tech
I'm happy there is a simpler work-around than finding some obscure file to 
delete. But it would be better if 4D just fixed the issue. If you use multiple 
monitors and change configurations this is an ongoing issue. Other Mac 
applications have no problems, but I'm often surprised by how 4D windows end 
up. I try to remember to quit 4D before unplugging my external monitor because 
of all the problems.

John DeSoi, Ph.D.


> On Nov 21, 2018, at 6:47 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Thanks so much for telling everyone about this keyboard fix. And I’m sure 
> it’s probably documented somewhere with a single sentence that most of us 
> never bothered to read. 
> 
> As least now we all know… when a 4D window opens in a stupid location, close 
> it and then open it again with the shift key down to fix it. A simple, 
> elegant solution. No more wandering to the preferences folder and deleting a 
> file to fix it. 
> 
> Do we know what version this was implemented in?
> 

**
4D Internet Users Group (4D iNUG)
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: Audit File Updates via Triggers...

2018-11-20 Thread John DeSoi via 4D_Tech
Just note that you won't be able to see any of the data in an object field if 
you are displaying records in a list box. Some possible options now in version 
17 if you are using collections/entity selections.

John DeSoi, Ph.D.


> On Nov 20, 2018, at 2:56 PM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Wow, you guys are the best—GREAT idea! I think we all need to use objects 
> more often and this is a great example—thanks 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
**

Re: Format of MySql data file

2018-11-15 Thread John DeSoi via 4D_Tech
Pat,

> 
> On Nov 15, 2018, at 5:18 PM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I want to break this file down into individual files for each table, to
> make it more manageable. So I created a method to parse the file and create
> a new file for each table.
> But ...
> The content all looks like gobbledygook when opened in 4D - eg:
> ,'xÃÃÃÂ
> 

You did not say how you opened it in 4D. If you used Document to text, you need 
to specify right character set. If you used BLOB commands or RECEIVE PACKET, 
all the possible parameters involved can lead to the problems you are seeing.


> The character set is UTF-8.
> If I open it in BBEdit it looks fine (readable text).

And the popup at the bottom in BBEdit says "UTF-8"? 

John DeSoi, Ph.D.

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

Re: What is the "REST" process for?

2018-11-14 Thread John DeSoi via 4D_Tech
I'm not seeing what ACI0098723 has to do with this issue. I'm not doing 
anything here with ORDA.

After some further testing I discovered the issue is related to saving records 
on tables with triggers enabled in a preemptive process. If I disable all the 
triggers, no REST process shows up. Also a big difference in performance. In a 
one minute test, I could create 55,000 more records with the trigger disabled. 
All the trigger does is set a timestamp value.

John DeSoi, Ph.D.


> On Nov 13, 2018, at 9:38 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> search for ACI0098723 on
> 
> https://bugs.4d.fr/fixedbugslist?branch=17_R3
> 
> I think it is the same issue.

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

What is the "REST" process for?

2018-11-13 Thread John DeSoi via 4D_Tech
4D 17.0 HF3 Mac 64bit. I'm experimenting with creating a lot of records 
concurrently (different tables) in 5 preemptive processes. As soon as each 
process launches, 4D launches a second process named "REST". It has origin -3 = 
Web process with no context. The web server is not on and I can't see anything 
in my code that would cause this. The processes are only there in 
compiled/preemptive mode. On the server the REST processes go away after each 
process completes. But in 4D Mono, they all stay alive in idle mode. 

Did I miss the details about this in the documentation?

John DeSoi, Ph.D.



"11": {
  "process": 11,
  "name": "Label",
  "state": 0,
  "time": 36,
  "visible": true,
  "preemptive": true,
  "processId": 18,
  "origin": 4
},
"12": {
  "process": 12,
  "name": "REST",
  "state": 2,
  "time": 136,
  "visible": true,
  "preemptive": false,
  "processId": 19,
  "origin": -3
},
**
4D Internet Users Group (4D iNUG)
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 get a list of all user windows?

2018-11-08 Thread John DeSoi via 4D_Tech
You could use the Window process function find the process number. Then use the 
"origin" parameter of PROCESS PROPERTIES to determine which processes belong to 
the design process.

John DeSoi, Ph.D.


> On Nov 8, 2018, at 1:46 PM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The WINDOW LIST function creates a list of ALL open windows, including
> method windows. Is there any way to get a list of only the user windows?
> (IE, ones that are open in the runtime environment).

**
4D Internet Users Group (4D iNUG)
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 MENU BAR glitch

2018-11-03 Thread John DeSoi via 4D_Tech
Have you checked the "Active Menu Bar" property on the form? If you don't do 
that, none of the main menu items will work. I don't think you can check this 
option unless you specify an appended menu. I always use an empty appended menu.

John DeSoi, Ph.D.


> On Nov 3, 2018, at 3:06 AM, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The correct menu bar is used, but not a single option on it works — UNTIL THE 
> WINDOW IS CLOSED!

**
4D Internet Users Group (4D iNUG)
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: Linefeed option not working for v16 emails

2018-11-02 Thread John DeSoi via 4D_Tech
I just ran some tests using a web mail program and confirm the issue you 
reported. I have been using 4D 16 in production since late 2017 and no one has 
complained, I suppose since most use Apple Mail where everything seems OK. 

As a work-around, I turned off that default and ensured the body uses CRLF. 
Seems to work, but not tested extensively.


C_TEXT($0;$1)

C_LONGINT($err)

$err:=SMTP_SetPrefs (0;-1;-1)
$0:=Replace string($1;CRLF;CR;*)
$0:=Replace string($0;LF;CR;*)
$0:=Replace string($0;CR;CRLF;*)

John DeSoi, Ph.D.



> On Nov 1, 2018, at 9:25 PM, Janet Jonas via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> In any case, like you, I have never used the LF character. However, as soon 
> as we implemented v16, we started having these issues. We are using a Gmail 
> hosted mail server, and we do not have these issues when the recipient 
> receives the email when it is first sent and they have an Apple Mail client, 
> but it is wrong on our Gmail webmail client, and any users that are not using 
> Apple Mail have the same problems now.
> 
> Quite a mystery. I'm wondering if we can still use the v15 plugin with v16.4 
> of 4D, I think Keisuke Miyako mentioned this for someone else having issues 
> with the Internet Commands plugin.

**
4D Internet Users Group (4D iNUG)
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: Linefeed option not working for v16 emails

2018-11-01 Thread John DeSoi via 4D_Tech

> On Nov 1, 2018, at 3:22 PM, Janet Jonas via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We recently switched to v16 and found out today that our plain text emails 
> are no longer getting a linefeed added to the carriage returns in the body of 
> plain text we send out. After looking at the commands, specifically 
> SMTP_SetPrefs, adding a linefeed is the default setting still in this 
> version, but it does not work as it did in v15. In fact, I was depending upon 
> the defaults, and all was fine. I just explicitly added the SMTP_SetPrefs 
> command to try to overcome this problem, but it did not work, either.

I have never used SMTP_SetPrefs and did not see any changes or problems 
upgrading from 15 to 16. I have always generated email text using carriage 
return only. 

What you stated above seems counter to what the documentation says it does: "A 
value of 1 (default setting) will replace all carriage return/line feed 
pairings with carriage returns for you."

To me that says CRLF will be replaced with CR. What line endings are you using 
when you generate the body text?

John DeSoi, Ph.D.


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

Re: Using 4D with Git...

2018-10-31 Thread John DeSoi via 4D_Tech
Yes, it can do those things plus just manage local repositories if you don't 
publish anywhere. I thought that was one of the questions in this thread - a 
usable git GUI client.

John DeSoi, Ph.D.


> On Oct 31, 2018, at 2:05 PM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> John, just clarify… Fork is simply a GUI client to access GitHub or BitBucket 
> repositories?

**
4D Internet Users Group (4D iNUG)
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: Using 4D with Git...

2018-10-31 Thread John DeSoi via 4D_Tech
I like Fork. Nice interface, open source, free. I tried to find a donation 
page, but did not see one.

https://git-fork.com

John DeSoi, Ph.D.


> On Oct 31, 2018, at 2:01 AM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Ill give the client a try. There is defiantly a gap in market for a client
> simple easy to use client. 

**
4D Internet Users Group (4D iNUG)
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: Setting up an entity / collection listbox in code

2018-10-30 Thread John DeSoi via 4D_Tech
Maybe it could work if you adopted the convention that the collection 
properties are based on the listbox object name, e.g.

Form.listbox1__currentItem
Form.listbox1__selectedItems
etc.

You would have to adjust these properties after the first listbox, but I assume 
the component could manage the selection just by knowing the listbox object 
name. Not tested.

The other way to do it is to generate the entire form including the list boxes 
with code. A lot more work up front, but hopefully worth it in the long run.

John DeSoi, Ph.D.


> On Oct 30, 2018, at 3:21 AM, Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> It seems to me that that won’t work with entity boxes unless I put them in 
> subforms or set up the variables (your Form.xx variables) myself. Even then, 
> the component can’t “know” which variables to use unless I tell it directly, 
> because it can’t read the box to determine what they are.
> 
> That seems to me a retrograde step, a step back from “everything about a 
> listbox is readable and configurable in code” which we had reached before.

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

Re: text characters in blob or text to document

2018-10-30 Thread John DeSoi via 4D_Tech

> On Oct 30, 2018, at 2:24 PM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> OK I will try and explain. I qwas working at a customer who has code that
> uses send packet. This is really old code and I do not think they have ever
> used USE CHARACTER SET.

So that is likely generating Latin-1/ISO-8859-1 especially if the old version 
does not have unicode mode enabled.


> We are upgrading to v16, so I tried filling a text
> variable and with the data and then doing a text top document. This di
> not work  I then tried text to blob and then blob to document. This did not
> work. In both cases, I used UTF8 text without length which also did not
> work. Does this make ity clearer?

UTF-8 is not iso-8859-1, so I would not expect it to work correctly. For the 
blob commands you need to use "Mac text without length" option. For the 
text/document commands use the "ISO-8859-1" character set.

John DeSoi, Ph.D.

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

Re: text characters in blob or text to document

2018-10-30 Thread John DeSoi via 4D_Tech
Not sure I'm following exactly what you are doing - difficult to know without 
seeing the commands and parameters. TEXT TO BLOB and Blob to text both allow 
you to specify the character set.

If you are using SEND PACKET with a blob you created using TEXT TO BLOB, there 
should be no problem converting it back via DOCUMENT TO BLOB and then Blob to 
text. If you are using text with SEND PACKET, you have to be sure to USE 
CHARACTER SET.

John DeSoi, Ph.D.


> On Oct 30, 2018, at 11:46 AM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Thanks I kind of figured that out, but when you got text to blob, you can
> not choose character set. According to docs. see below. How would one
> solved this problem. I wiuld guess continues to use send packet is omne
> solution. Are there others.

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

Re: text characters in blob or text to document

2018-10-30 Thread John DeSoi via 4D_Tech
The problem is likely with TEXT TO DOCUMENT/Document to text. These have 
strange defaults, so you have to be very careful about the parameters.

TEXT TO DOCUMENT defaults to UTF-8 and inserts a BOM (which I think is a bug). 
So you can't read it using DOCUMENT TO BLOB and covert to UTF-8 text without 
deleting the BOM first.

Document to text assumes MacRoman/ANSI if the document does not have a BOM and 
you don't specify the character set. So if you are saving UTF-8 with a blob, 
you need to be sure to specify the character set for Document to text to 
interpret it correctly.

John DeSoi, Ph.D.


> On Oct 30, 2018, at 11:09 AM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> When I use text to blob with utf 8
> conversion and then blob to document or text to document the bullets get
> converted to strange looking question marks. Any idea how to solvce this
> problem. I know it has something to do with character set but UTF8 text
> without length does not work.

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

Re: Longing IDs or UUIDs as primary key?

2018-10-24 Thread John DeSoi via 4D_Tech
There are other options which may be more attractive if you are willing to put 
more work in your synchronization code. I did something like this years ago 
before UUIDs existed. You need to be able to identify shared records (which can 
be a UUID field without it being the primary key) and then update the foreign 
keys with the right integer values as they are transferred into the target 
database.

John DeSoi, Ph.D.


> On Oct 24, 2018, at 11:31 AM, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> To be clearer on the purpose:
> 
> There are many customers who use my application.
> 
> What I want to achieve is that they can ’share’ data. In order to do that, I 
> really do need a UUID, because I intend to exchange the records (and related 
> records) between their individual databases.
> Obviously this will never work with LONGINT ids and foreign keys …
> 
> Another example is replication. My users, most of the time, are working 
> client-server. But often, they need a part of the datafile as a local 
> database on their laptop, so I need to replicate at least a part of 
> the data into a stand-alone database. Then, if they add records to the local 
> database, I want to replicate that new information back to the server 
> database.
> 
> The only way this would be possible is to change all the LONGINT ids to UUID, 
> and also the foreign keys ….

**
4D Internet Users Group (4D iNUG)
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 data, Constants and dot notation

2018-10-14 Thread John DeSoi via 4D_Tech
Only the bracketed expression form, e.g. myObject[constant].

John DeSoi, Ph.D.


> On Oct 14, 2018, at 1:56 AM, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Constants cannot be used with dot notation?

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

Re: 4D Write Pro (WP) Area and ST INSERT EXPRESSION

2018-10-09 Thread John DeSoi via 4D_Tech
You can use the 4D formula editor with the EDIT FORMULA command.

I don't use 4D Write, but I implemented the formula editor for styled text 
fields (used to implement a markdown editor). 

Editing (by double click) or inserting a formula is something like this:

GET HIGHLIGHT(*;$edName;$start;$end)
Case of 
  : ($start=$end)
  : (ST Get content type(*;$edName)=ST Expression type)  //Formula is selected.
$formula:=ST Get expression(*;$edName)
End case 

If ($formula#"")
  $formula:=UI_Formula_editor ($formula)
  If ($formula#"")
ST INSERT EXPRESSION(*;$edName;$formula;$start;$end)
HIGHLIGHT TEXT(*;$edName;$start;$start+1)
  End if 
End if 

John DeSoi, Ph.D.


> On Oct 9, 2018, at 11:50 AM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Insert expression and Get expression seem to not be pre-implemented in the 4D 
> v17 Write Pro area.
> 
> The documentation indicates this should be managed by the developer, along 
> with “Allowed Methods”.
> 
> I think the UI for this provide access to allowed tables, fields, methods and 
> commands.
> 
> If you have already implemented this for a 4D WP area, would you be willing 
> to share how you did it?

**
4D Internet Users Group (4D iNUG)
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 get the current time in a specified time zone

2018-09-26 Thread John DeSoi via 4D_Tech
It is really a database problem of managing all of the various rules of 
different locations. Postgres has this built in. If you don't want to use 
Postgres, you still might find the data you need to add to your 4D 
implementation. See list below of 79 distinct zones.

John DeSoi, Ph.D.




> On Sep 26, 2018, at 8:17 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The only thing I'm not sure about is how various time zones change in their
> relationship to GMT (eg Summer Time etc.) For example if Country A is
> normally on GMT -8 but they're currently on Summer Time so 7AM in that time
> zone is CurrentHourGMT-8+1, how do we account for that?



postgres=# select distinct on (abbrev) * from pg_timezone_names;
  name   | abbrev | utc_offset | is_dst 
-+++
 Atlantic/Azores | +00| 00:00:00   | t
 Etc/GMT-1   | +01| 01:00:00   | f
 Antarctica/Troll| +02| 02:00:00   | t
 Asia/Qatar  | +03| 03:00:00   | f
 Iran| +0330  | 03:30:00   | f
 Asia/Yerevan| +04| 04:00:00   | f
 Asia/Kabul  | +0430  | 04:30:00   | f
 Asia/Tashkent   | +05| 05:00:00   | f
 Asia/Colombo| +0530  | 05:30:00   | f
 Asia/Kathmandu  | +0545  | 05:45:00   | f
 Asia/Bishkek| +06| 06:00:00   | f
 Asia/Yangon | +0630  | 06:30:00   | f
 Indian/Christmas| +07| 07:00:00   | f
 Asia/Ulaanbaatar| +08| 08:00:00   | f
 Australia/Eucla | +0845  | 08:45:00   | f
 Asia/Chita  | +09| 09:00:00   | f
 Etc/GMT-10  | +10| 10:00:00   | f
 Australia/Lord_Howe | +1030  | 10:30:00   | f
 Pacific/Noumea  | +11| 11:00:00   | f
 Pacific/Wake| +12| 12:00:00   | f
 Pacific/Chatham | +1245  | 12:45:00   | f
 Etc/GMT-13  | +13| 13:00:00   | f
 Pacific/Kiritimati  | +14| 14:00:00   | f
 Atlantic/Cape_Verde | -01| -01:00:00  | f
 Atlantic/South_Georgia  | -02| -02:00:00  | f
 America/Rosario | -03| -03:00:00  | f
 America/La_Paz  | -04| -04:00:00  | f
 Etc/GMT+5   | -05| -05:00:00  | f
 Etc/GMT+6   | -06| -06:00:00  | f
 Etc/GMT+7   | -07| -07:00:00  | f
 Etc/GMT+8   | -08| -08:00:00  | f
 Pacific/Gambier | -09| -09:00:00  | f
 Pacific/Marquesas   | -0930  | -09:30:00  | f
 Etc/GMT+10  | -10| -10:00:00  | f
 Etc/GMT+11  | -11| -11:00:00  | f
 Etc/GMT+12  | -12| -12:00:00  | f
 Australia/Adelaide  | ACST   | 09:30:00   | f
 America/Moncton | ADT| -03:00:00  | t
 Australia/Hobart| AEST   | 10:00:00   | f
 US/Alaska   | AKDT   | -08:00:00  | t
 America/Guadeloupe  | AST| -04:00:00  | f
 Australia/Perth | AWST   | 08:00:00   | f
 Europe/Belfast  | BST| 01:00:00   | t
 Africa/Bujumbura| CAT| 02:00:00   | f
 America/Chicago | CDT| -05:00:00  | t
 Europe/Belgrade | CEST   | 02:00:00   | t
 Africa/Tunis| CET| 01:00:00   | f
 America/Regina  | CST| -06:00:00  | f
 Pacific/Guam| ChST   | 10:00:00   | f
 Indian/Comoro   | EAT| 03:00:00   | f
 America/Indiana/Marengo | EDT| -04:00:00  | t
 Europe/Sofia| EEST   | 03:00:00   | t
 Egypt   | EET| 02:00:00   | f
 Jamaica | EST| -05:00:00  | f
 GMT0| GMT| 00:00:00   | f
 US/Aleutian | HDT| -09:00:00  | t
 Hongkong| HKT| 08:00:00   | f
 HST | HST| -10:00:00  | f
 Asia/Jerusalem  | IDT| 03:00:00   | t
 Asia/Calcutta   | IST| 05:30:00   | f
 Japan   | JST| 09:00:00   | f
 Asia/Seoul  | KST| 09:00:00   | f
 America/Edmonton| MDT| -06:00:00  | t
 MET | MEST   | 02:00:00   | t
 W-SU| MSK| 03:00:00   | f
 America/Dawson_Creek| MST| -07:00:00  | f
 Canada/Newfoundland | NDT| -02:30:00  | t
 Pacific/Auckland| NZST   | 12:00:00   | f
 America/Ensenada| PDT| -07:00:00  | t
 Asia/Karachi| PKT| 05:00:00   | f
 Africa/Mbabane  | SAST   | 02:00:00   | f
 Pacific/Pago_Pago   | SST| -11:00:00  | f
 UCT | UCT| 00:00:00   | f
 Universal   | UTC| 00:00:00   | f
 Africa/Luanda   | WAT| 01:00:00   | f
 Africa/Casablanca   | WEST   | 01:00:00   | t
 Asia/Pontianak  | WIB| 07:00:00   | f
 Asia/Jayapura   | WIT| 09:00:00   | f
 Asia/Makassar   | WITA   | 08:00:00   | f
(79 rows)

**
4D Internet Users Group (4D iNUG)

Re: Creating a form object to use as dynamic form

2018-09-24 Thread John DeSoi via 4D_Tech
On Sep 24, 2018, at 9:44 AM, Two Way Communications via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> $page:=New object("objects";New object("myListBox";$obj)) $form:=New 
> object(“pages";New collection(Null;$page))
> 
> $form:=New object("windowTitle";"Select a 
> Map:";"windowMinWidth";500;"windowMinHeight";300;"pages";New 
> collection(Null;$page))
> 
> Now, this dynamic form only shows a listbox, and I want to add a button to 
> the form. I assume this button object has to be added to the ‘Objects’ object 
> in $page.

Yes, each object on the page is represented by the unique name you give it, 
then the the page is part of a collection of pages for the form. Something like

$oPage:=New object
$oPage.myButton:=$oButton1
$oPage.myListbox:=$oListbox

$oForm.pages:=New collection
$oForm.pages[1]:=New object
$oForm.pages[1].objects:=$oPage

Your code will be more readable and maintainable if you write methods to 
generate each object type.


> Secondly, the listbox displays an entity selection. How do I get the row 
> number that has been selected?

You specify the currentItemSource property for the dynamic listbox. I use Form 
and specify a property based on the object name like this:


$form:=Command name(1466)+"."  //Form command

$0:=New object
$0.type:="listbox"
$0.listboxType:="collection"

$0.currentItemSource:=$form+$name+"__currentItem"
$0.currentItemPositionSource:=$form+$name+"__currentItemPosition"
$0.selectedItemsSource:=$form+$name+"__selectedItems"


John DeSoi, Ph.D.

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

Re: v13-v16 thread safe component

2018-09-20 Thread John DeSoi via 4D_Tech

> On Sep 20, 2018, at 11:40 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> I have been looking through the v16 and v17 documentation, I do not see 
> where it says that pasteboard commands do not work with/inside 
> pre-emptive threads.

Every command that supports preemptive mode has a CPU icon under the 
"PROPERTIES" header (where it has the command number). You can click on that 
icon to get the full list:

http://doc.4d.com/4Dv17/4D/17/Preemptive_3726273.999-2878208.en.html


> 
> Also, IP sets, I also do not see any specific reference (one way or the 
> other) regarding IP sets and preemptive threads. I would assume, may be 
> the problem :), that since an IP set can be changed from outside the 
> preemptive thread that it would be a problem, just like an IP variable.


I have not seen a discussion about it, but I assume IP sets and IP variables 
are totally different in this regard. All changes to sets are made through 4D 
commands which enables 4D to ensure they are thread safe. IP variables are 
memory references that code directly modifies.

I did a simple test creating an IP set in a preemptive process and it seems to 
work. The compiler will generate errors if any method in the call chain has an 
IP variable.

John DeSoi, Ph.D.

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

Re: v13-v16 thread safe component

2018-09-20 Thread John DeSoi via 4D_Tech
Chip,

> On Sep 20, 2018, at 9:24 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was going to use the pasteboard to pass information to and from the 
> IP set tracking process, but as I discovered yesterday - this could be 
> a problem... 

The pasteboard commands don't work in preemptive mode, so not really an option 
if you want the component to work for preemptive processes.

> Where Setutl does not care if the set passed ($Setname) is local, 
> process, or IP. In Setutl's code a check is done on the set name, 
> looking for the left right arrow pairing (<>), and branches as needed 
> to manage either 'normal' sets, or IP sets. This, if I understand 
> correctly, means that the code to manage the IP sets needs to be thread 
> safe for the Setutl functions (above) to be thread safe; and this 
> extends to most of Setutl's functionality. 

I think you are confusing IP sets with IP variables. IP sets can be created and 
used in preemptive processes. 

> OR I need a way to Set and Get values across 
> processes which is thread safe. 

Prior to version 17 with Storage, I'm not aware of any option other than using 
the database or the file system.

John DeSoi, Ph.D.


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

Re: Do I want to use SELECTION TO ARRAY instead of GOTO SELECTED RECORD server-side in V17

2018-09-18 Thread John DeSoi via 4D_Tech
Dani,

Thanks for taking the time to test this and post your results. I looked at some 
document generation routines where I was caching some text before writing it 
out with SEND PACKET (to avoid lots of calls to SEND PACKET with small amounts 
of text). I changed to a blob cache and it seemed to be a little slower. I also 
tried pre-sizing the blob cache to avoid dynamic resizing with TEXT TO BLOB. 
Still a bit slower than just using text variable and writing it out when it is 
over 4K in size.

I compared your method 6 with just writing to a file, including opening and 
closing the file. The time was almost the same with writing to a file being 
slightly faster.

I'm sure there are cases where you can't use files, but if that is not a 
constraint it seems you can avoid the memory question and get good performance. 
I suspect SSD drives disk cache on modern systems are a big help these days.
 

John DeSoi, Ph.D.



$targetVarSize:=$maxSize
$innerLoopMax:=Int($targetVarSize/Length($textToAdd))

$vs6:=Milliseconds
For ($i;1;$outerLoopMax)
$result:=""
$tmpTxt:=""
SET BLOB SIZE($blob;0)
For ($j;1;$innerLoopMax)
$tmpTxt:=$tmpTxt+$textToAdd
If (Length($tmpTxt)>4096)
TEXT TO BLOB($tmpTxt;$blob;UTF8 text without length;*)
$tmpTxt:=""
End if 
End for 
TEXT TO BLOB($tmpTxt;$blob;UTF8 text without length;*)
$result:=BLOB to text($blob;UTF8 text without length)
End for 
$ve6:=Milliseconds-$vs6

C_LONGINT($ms)
C_TIME($doc)

$ms:=Milliseconds
$doc:=Create document("test1.txt")
For ($i;1;$outerLoopMax)
$result:=""
$tmpTxt:=""
SET BLOB SIZE($blob;0)
For ($j;1;$innerLoopMax)
$tmpTxt:=$tmpTxt+$textToAdd
If (Length($tmpTxt)>4096)
  //TEXT TO BLOB($tmpTxt;$blob;UTF8 text without 
length;*)
SEND PACKET($doc;$tmpTxt)
$tmpTxt:=""
End if 
End for 
  //TEXT TO BLOB($tmpTxt;$blob;UTF8 text without length;*)
  //$result:=BLOB to text($blob;UTF8 text without length)
End for 
CLOSE DOCUMENT($doc)
$ms:=Milliseconds-$ms

ALERT(String($ve6)+" - "+String($ms))



> On Sep 18, 2018, at 11:50 AM, Dani Beaubien via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Based on this test, technique #5/#6 are the fastest by far.
> Techniques 4-6 seem to have linear performance.
> 
> For 10 MB text var, the #4 came in at 1613ms and #5 came in at 290.6ms
> 
> Very interesting. I am currently using techniques #3 when I am creating 
> exports and reports to disk. Going to switch to the #5.
> 
> Downsize of the blob techniques is that you need double the amount of memory 
> if you need to convert the blob back to a text variable like I did in this 
> experiment.
> 

**
4D Internet Users Group (4D iNUG)
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: Do I want to use SELECTION TO ARRAY instead of GOTO SELECTED RECORD server-side in V17?

2018-09-15 Thread John DeSoi via 4D_Tech
With a little up front work, you can create a nice wrapper for SELECTION TO 
ARRAY/SELECTION RANGE TO ARRAY where you just pass an array of field pointers. 
You can use a process 2D array of each type to dynamically allocate/deallocate 
the necessary arrays and just manipulate the pointers. Some code fragments 
below.


For ($iParam;1;Size of array($aSource))
  $aDest{$iParam}:=PM_Variable (ARRAY_Type ($aType{$iParam}))
End for


For ($iParam;1;Size of array($aSource))
  SELECTION TO ARRAY($aSource{$iParam}->;$aDest{$iParam}->;*)
End for 


SELECTION RANGE TO ARRAY($start;$end)


John DeSoi, Ph.D.


> On Sep 15, 2018, at 2:07 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> What are the trade-offs in V17 between *GOTO SELECTED* record and *SELECTION
> TO ARRAY*? I've been using *SELECTION TO ARRAY*, but it's hard to read,
> write, and maintain. 

**
4D Internet Users Group (4D iNUG)
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 for iOS: anyone?

2018-09-11 Thread John DeSoi via 4D_Tech
I think it refers to

My Home > List of posts > R-release channel > Beta version

Then in the first box there is a Forum "4D for iOS - Preview", where you can 
further filter or click on "Create a new topic".

John DeSoi, Ph.D.


> On Sep 11, 2018, at 3:20 AM, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have been looking at the forum before but somehow I failed to find this 
> topic.

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

Re: 4D Write to 4D Write Pro

2018-08-29 Thread John DeSoi via 4D_Tech
One solution for this is to just create a "stub" plugin that does nothing 
except load properly on 64 bit. Then copy all of the 4D Write resources to it. 
That way you can keep the old code around as long as you need it for reference. 
I think I did it by finding a small 64 bit plugin and then replacing the 
resources with the files from 4D Write.

John DeSoi, Ph.D.



> On Aug 29, 2018, at 2:38 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Once you have all the code rewritten and tested and working, you can dump the 
> old code, and you’ll have to when you remove the plugin because all the 
> plugin command will no longer tokenize. So get ready to delete a bunch of 
> methods. 

**
4D Internet Users Group (4D iNUG)
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: Using local variables and set and named selection names in a recursive situation

2018-08-29 Thread John DeSoi via 4D_Tech
Hi Pat,

There is no such thing as a local named selection. That is just a named 
selection name that begins with a "$" character. A leading $ in a string has a 
meaning for a local set name, but that just means the set is only on the client 
and not the server. See 

http://doc.4d.com/4Dv17/4D/17/Named-Selections.300-3730545.en.html

which discusses both sets and named selections.

Within the scope of the process, you need to have unique names to have 
different sets or named selections. I always use a generator function rather 
than naming directly. It gives you a unique name and you can encode the table 
and other information in the name.

John DeSoi, Ph.D.





> On Aug 29, 2018, at 7:04 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> create named selection(TablePtr->;"$deletes")

**
4D Internet Users Group (4D iNUG)
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: New record numbering system and CALL WORKER

2018-08-27 Thread John DeSoi via 4D_Tech
I don't know. In some simple tests without any contention from multiple 
processes, both reading and writing took 0 ms. 

I did not know Storage was slow until this thread came up. I did not see that 
in the documentation, maybe only something you learn about if you go to the 
conference. Without some published benchmarks, it sounds like 4D folklore at 
this point.

What seems *really* slow to me is CALL FORM. I'm seeing about 100ms between 
CALL FORM and the time the method starts executing in the form process (not 
called from the same process as the form window). 

John DeSoi, Ph.D.


> On Aug 27, 2018, at 10:04 AM, Keith Culotta via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Does the speed penalty apply to reading values from Storage, or just to 
> writing values to Storage?
> 
> 
> 
>> On Aug 26, 2018, at 8:57 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Storage is the best option for interprocess communications if you want to 
>> use preemptive processes.

**
4D Internet Users Group (4D iNUG)
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: New record numbering system and CALL WORKER

2018-08-26 Thread John DeSoi via 4D_Tech
Storage is the best option for interprocess communications if you want to use 
preemptive processes. I have not done any real benchmarking but I have not 
noticed that anything seems slow. By setting up return values on a per-process 
basis you can avoid locking contention on storage. 

For example, I have a wrapper for CALL FORM which allows a return value. I'm 
using this to provide services to non-GUI (possibly preemptive) processes that 
need to call form related features. One place I'm using this is to call a 
Javascript auto-layout library (http://ijzerenhein.github.io/autolayout.js) to 
generate a form layout from a constraint specification. This approach allows me 
to load the layout library in one (hidden) process and use it from any other 
process. The call looks like this:


//Internal method to execute the auto layout request in the web/javascript 
process.

  //$0 - Object with layout specification.
  //$1 - Collection of VFL specification strings.
  //$2 - View with.
  //$3 - View height.
  //$4 - (flag) Layout window, provided by this method only.


C_OBJECT($0;$oResult)
C_COLLECTION($1;$cSpec)
C_LONGINT($2;$width;$3;$height)
C_LONGINT($4;$window)

$cSpec:=$1
$width:=$2
$height:=$3

If (Count parameters<4)
$window:=FD_Layout_window 
PM_CALL_IN_FORM_WINDOW (Current method 
name;->$oResult;0;->$cSpec;->$width;->$height;->$window)
Else 
WA EXECUTE JAVASCRIPT 
FUNCTION(fd_waLayout;"autoLayoutD5";$oResult;$cSpec;$width;$height)
End if 

$0:=$oResult


John DeSoi, Ph.D.



> On Aug 25, 2018, at 4:44 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> But lets explore other possibilities. What could “Storage” be use for in 
> other cases? Is it a good use of “Storage”?

**
4D Internet Users Group (4D iNUG)
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: New record numbering system and CALL WORKER

2018-08-25 Thread John DeSoi via 4D_Tech
Hi Pat,

Set the method property to "Execute on Server".

This shared object/collection could also have a collection of numbers that need 
to be reused if you require that there are no missing numbers in your sequence. 

Of course, you'll have to get the database involved at some level to handle 
startup and shutdown and the case where the server crashed without writing the 
last sequence number used.

John DeSoi, Ph.D.


> On Aug 25, 2018, at 10:21 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Thanks John.
> But how would that work in a multi-user setting? Whatever method is used
> for assigning the new numbers, it must run on the server, otherwise we're
> back to the problem of using semaphores, checking record locking, etc.
> Also I should point out that there could be a large number of tables for
> which the record numbering system needs to be used. We have a RecordNumbers
> table which has one record for each table that requires this function. so
> we must have ONE process that accesses and updates that table.
> PB

**
4D Internet Users Group (4D iNUG)
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: New record numbering system and CALL WORKER

2018-08-25 Thread John DeSoi via 4D_Tech

> On Aug 25, 2018, at 9:10 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> As I see it, we'll need to call a worker, which calls the worker that
> assigns the record number.
> The first worker has to wait until the second one has created the new
> number.
> Then the original method, that called the first worker, must wait until the
> first worker  gets the new number. It seems that this won't be much better
> than the old method.
> 
> Am I completely barking up the wrong tree? Is this not an appropriate use
> for workers? Or have I misunderstood something?

It would have been really nice if CALL WORKER was implemented like EXECUTE 
METHOD and could return a value. You can do this on your own, but it is quite a 
bit  of work to do it in a general way.

For your application, all you need is a shared object (no worker needed). Only 
one process at a time will be able to modify the counter. Some startup method 
could initialize the counter to the starting value.

C_LONGINT($0)

Use (Storage.myCounter)
  Storage.myCounter.value:= Storage.myCounter.value+1
  $0:= Storage.myCounter.value
End use


John DeSoi, Ph.D.

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

v17 variables not found on forms

2018-08-13 Thread John DeSoi via 4D_Tech
It appears version 17 (including HF1) no longer finds variables on forms. If I 
right click on a variable in a method, and choose "Search References", it only 
shows the variables in methods. If I do a global text search, it shows 
additional references on forms. Be careful renaming things.

Also, I'm wondering if anyone else is seeing the two frontmost methods 
automatically join into a tabbed window when switching back to 4D (Mac). I'm 
not using tabbed windows, but they seem to randomly tab together sometimes.

John DeSoi, Ph.D.

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

Re: ORDA - updating data in listboxes

2018-08-12 Thread John DeSoi via 4D_Tech
This makes me wonder why REDRAW can't do this internally instead of adding yet 
another microscopic difference between listbox types that will continue to 
elude even the most experienced 4D developers. At the very least, the REDRAW 
documentation should be updated to say that this command does not work for 
collection/ORDA list boxes and explain what you are supposed to do instead.

John DeSoi, Ph.D.



> On Aug 12, 2018, at 2:05 PM, Spencer Hinsdale via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> is this relevant?
> 
> http://kb.4d.com/resources/inug?msgid=GmailId164f73d107b663e7 
> 
> 

**
4D Internet Users Group (4D iNUG)
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: Automatic updating of built apps

2018-08-08 Thread John DeSoi via 4D_Tech
What version of 4D? I'm not having any problems with 16.3.

Are you setting the update folder to the full path of the application package? 
For example, I'm updating from a disk image with the same name as the 
application with something like:

$updateFolder:=$appName +Folder separator+$appName+".app"


John DeSoi, Ph.D.


> On Aug 8, 2018, at 10:43 AM, jeff--- via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> In other words, the update process is placing the update app inside the 
> original app instead of replacing the original app with the update app!
> 
> I must be missing something here.

**
4D Internet Users Group (4D iNUG)
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: Automated Generation of Form Variables

2018-08-06 Thread John DeSoi via 4D_Tech
I don't use the form wizard, so I'm not sure I understand what you mean about 
Form.table.dataClassAttribute. But you can certainly generate your own form 
with fields and labels in version 17. To generate a field, I use a method like 
this:


 //Create field object.

  //$0 - Field object.
  //$1 - Field pointer.

C_OBJECT($0)
C_POINTER($1)

$0:=New object
$0.type:="input"
$0.dataSource:=TB_Field_full_name ($1) `Like [Table_Name]Field_Name

John DeSoi, Ph.D.




> On Aug 3, 2018, at 9:42 AM, Guru via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Is there a way to generate the Form.table.dataClassAttribute and their labels
> to populate a form like is done for fields and labels when creating a form
> via the wizard?

**
4D Internet Users Group (4D iNUG)
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: startup progress on server

2018-08-06 Thread John DeSoi via 4D_Tech
Randy,

I'll be interested to hear if this permanently fixes the problem. I'm still 
having random crash on quit errors on 4D Server (16.3HF4, 64-bit). Never a 
problem in version 15, 32-bit. I have never connected crashing to a status 
interface, but in my case it has always run in a separate process. I just made 
a change to ensure that process is dead before QUIT 4D is called on the server. 
Maybe that will completely solve it.

Did you look at the backtrace from the crash log? I would be interested to see 
if we are experiencing the same issue. Below is what I see. I wonder if that is 
related to displaying the countdown timer - I'm quitting with QUIT 4D(60).

Thread 46 Crashed:: QUIT_SERVER (id = -11)
0   4d.com.Map Server.app   0x000108e88fbc 
V4DClientProcessManager::Clear(bool) + 128
1   4d.com.Map Server.app   0x000108e8c1eb 
V4DServer::Unpublish() + 87
2   4d.com.Map Server.app   0x000108e8d1e6 
V4DServer::_Shutdown(xbox::VTime&, xbox::VString const*, xbox::VString const*, 
VDatabaseStartupParameters*, xbox::VUUID const*) + 38
3   4d.com.Map Server.app   0x000108e8d300 
V4DServer::Shutdown(int, xbox::VString const*, xbox::VString const*, 
VDatabaseStartupParameters*, xbox::VUUID const*) + 120
4   4d.com.Map Server.app   0x00010915a636 
do_quit4d(runtime4dLink*) + 123
5   4d.com.Map Server.app   0x000108ce5028 
VDBLanguageContext::ExecuteCommand(runtime4dLink*) + 62
6   4d.com.Map Server.app   0x000108cd9530 
VDBLanguageContext_compiled::ExecuteRuntimeCommand(int, int, 
champvar_template<256>**) + 94
7   4d.com.Map Server.app   0x000108afeff1 rt_CallRuntime4D2 + 
45
8   ??? 0x00010e364a43 0 + 4533406275
9   4d.com.Map Server.app   0x00010907fbcb CallAsmPart2 + 65
10  ??? 0x7051e6e0 0 + 123145307678432
11  4d.com.Map Server.app   0x000108cd9354 
VDBLanguageContext_compiled::DoExecute(calcblock&, VCodeDescriptor*) + 164
12  4d.com.Map Server.app   0x000108ce3e18 
VDBLanguageContext::Execute(VDB4DTableProxy*, VFormContext*, short, int, int, 
champvar_template<256>**, VCodeDescriptor*) + 162
13  4d.com.Map Server.app   0x000108ce3a92 
VDBLanguageContext::ExecuteProjectMethod(VMethodInfo const*, int, 
champvar_template<256>**, VDB4DTableProxy*, VFormContext*, short, int) + 542
14  4d.com.Map Server.app   0x000108cbd08c 
V4DWorkerMessage::_Execute(VDBLanguageContext*, VFormContext*) + 110
15  4d.com.Map Server.app   0x000108cbd850 
V4DWorker::Run(V4DTaskConcrete*) + 208
16  4d.com.Map Server.app   0x000108e97da4 
Task4DStoredMethodProc(V4DTaskConcrete*, xbox::IRefCountable*) + 222
17  4d.com.Map Server.app   0x000108cb4360 
Task4DProc(V4DTaskConcrete*) + 910
18  4d.com.Map Server.app   0x000108cfb6c8 
V4DTaskManager::_Task4DProc(xbox::VTask*) + 160
19  com.4d.kernel   0x00010b0b02ee xbox::VTask::_Run() 
+ 78
20  com.4d.kernel   0x00010b0b54d6 
xbox::XMacTask_fiber::_ThreadProc(void*) + 70
21  com.4d.kernel   0x00010b0ef27f 
xbox::VMacFiber_thread::_ThreadProc(void*) + 31
22  com.apple.CoreServices.CarbonCore   0x7fff476e6072 CooperativeThread + 
282
23  libsystem_pthread.dylib 0x7fff6e6ba661 _pthread_body + 340
24  libsystem_pthread.dylib 0x7fff6e6ba50d _pthread_start + 377
25  libsystem_pthread.dylib 0x7fff6e6b9bf9 thread_start + 13




> On Aug 6, 2018, at 9:26 AM, Randy Jaynes via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Ok. So moving our STARTUP method into a stored procedure using
>   $procID:=New Process(“STARTUP”;512000;”On Server Startup)
> 
> takes care of BOTH problems.
> 
> So it looks like the Application Server process on 4D Server v16R6 and higher 
> is more sensitive to interface related commands like
>   OPEN WINDOW
>   SET MENU BAR
>   DISPLAY RECORD
> 
> For the record, this startup method was fine up through 4D v15.4 HF3.

**
4D Internet Users Group (4D iNUG)
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: selected rows for a collection listbox

2018-08-05 Thread John DeSoi via 4D_Tech
I found a solution that has good performance and does not require creating 
thousands of objects for rows that will never be displayed.

- The listbox collection is initially setup as a collection of row numbers. 
Using ARRAY TO COLLECTION seems to be the fastest way to do this. About 30 
milliseconds to create a collection with 500,000 rows.

- Any listbox row that is a number and not an object needs to be loaded from 
the remote server. The On Display Detail method detects this condition and 
fetches the subset of rows to be displayed. The row number in the collection 
element is replaced with the object to display. Something like:

ListBox[$row]:=New object("rowNumber";$row+1;"row";$rowObject) `Column display 
formulas based on This.row

- I can now determine the row numbers of the selected rows, even if the row has 
never been displayed. Every element of the selectedItems collection will be a 
row number or an object with a rowNumber property.

John DeSoi, Ph.D.


> On Jul 31, 2018, at 12:07 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think this is exactly what the new For each
> structure is meant to do - iterate over the selected elements. You don't
> need to know the indices
> if all you need is the elements. But it sounds like you want the row
> numbers to sync with the other data. In that case I don't think you have a
> choice besides an array based listbox.

**
4D Internet Users Group (4D iNUG)
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: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread John DeSoi via 4D_Tech
Try bringing up the "User Interrupt" menu and select the Go to Design Mode 
option. On the Mac it is control-option-click. Not sure about Windows.

John DeSoi, Ph.D.
 

> On Aug 2, 2018, at 10:55 AM, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Puzzling. That doesn’t work on my Windows machine. It’s not a licensing issue 
> because I am developing in v16.  :(

**
4D Internet Users Group (4D iNUG)
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: v13 - Record to Blob?

2018-07-30 Thread John DeSoi via 4D_Tech
I think this would be very useful as a native command and trivial to implement 
(already in the plugin API, I think). If you agree, here is the feature request:

http://forums.4d.com/Post/EN/17757394/1/17757547

John DeSoi, Ph.D.


> On Jul 30, 2018, at 2:40 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> if you must use native commands only, then
> 
> http://doc.4d.com/4D-Language-Reference-17/Communications/SEND-RECORD.301-3729974.en.html
> http://doc.4d.com/4D-Language-Reference-17/BLOB/DOCUMENT-TO-BLOB.301-3730325.en.html

**
4D Internet Users Group (4D iNUG)
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: selected rows for a collection listbox

2018-07-30 Thread John DeSoi via 4D_Tech
Hi Kirk,

Great summary, thanks for posting.


> On Jul 30, 2018, at 10:27 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Eventually I got the concept of manipulating the data in the collection
> instead of in the listbox is the key. This is why it doesn't really matter
> which rows are selected but rather which elements are. You don't need to
> know what the row numbers are to update the associated collection you just
> need the selected items Miyako pointed to.

I promise not to post any more about it after this, but I'll say it one more 
time. The selected row numbers matter if you are not using ORDA or a fully 
materialized collection of objects. There are a lot of cool things possible 
outside of 4D data if you know the size of the result set and can load on 
demand. I have mentioned Postgres, but I'm also implementing display and 
manipulation of an ORDA selection from a remote 4D database instance over HTTPS.

I have 4D 16 interfaces for Spotify and Apple Music that implemented lazy 
loading using a "fake" selection of records. Collection based list boxes make 
it possible to eliminate the table and support very powerful generalized code 
(e.g. components).

I also find it strange that I can select rows with a single API call, but 
determining the selected rows takes 3 different methods depending on the type 
of list box. With the selected rows, I can easily iterate over the rows for any 
of the different listbox types.


John DeSoi, Ph.D.

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

Re: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech


> On Jul 29, 2018, at 9:41 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> the beauty of working with collections (in ORDA) is that
> when you operate via member methods or "For each",
> the elements are loaded on demand.
> there is no need to work with the "On Display Detail" event.

Yes, nice model and works great if you are using ORDA. I'm not using ORDA here 
and want to take advantage of the same type of on demand loading. 4D thought it 
was important enough to tell you the row number of the selected collection 
item, but only the first one, not all of them. We have LISTBOX SELECT ROW which 
can work with any kind of listbox, but to get the selected rows there are 3 
different methods depending on what type of listbox is used. Would be nice to 
have LISTBOX SELECTED ROWS(array or collection) that would work on any listbox 
type. 

> how exactly did you populate the collection that you display in the listbox?
> it sounds like you have a place holder object for each line.

Yes.

> 
> why not use the "map" member function to add a custom "position (offset)" 
> property?

I want to leave the collection elements as Null and only load them on demand 
(displayed or the user selected them to do something). I'm trying to avoid 
creating objects for thousands of rows that will never be displayed or used.


John DeSoi, Ph.D.

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

Re: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
It is not ORDA. I'm displaying a server side cursor from PostgreSQL. The select 
result may have hundreds of thousands of rows. I can scroll that nicely in 4D 
using On Display Detail to load only the visible data. But to operate on the 
selected rows as a collection implies that every row has to be loaded. If I 
could get just the selected *row numbers*, I could load those on demand.

John DeSoi, Ph.D.
 



> On Jul 29, 2018, at 8:47 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> a collection of objects rather than the row numbers makes this impractical.
> 
> impractical how?
> 
> ORDA is lazy loading by nature, so it doesn't matter if the row is visible or 
> not.

**
4D Internet Users Group (4D iNUG)
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: selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
How does the third one give me the *row numbers* of the highlighted rows other 
than sequentially searching for each item? That was my original question.

I want to use a collection based list box to represent data from a remote 
source. I only need to load enough data to display the visible rows. But the 
selection model that returns a collection of objects rather than the row 
numbers makes this impractical. 

I'll make a feature request.

Thanks,

John DeSoi, Ph.D.



> On Jul 29, 2018, at 7:28 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> there are 3 properties you can have 4D manage automatically (that is, 
> read-only by code)
> 
> current item (typically an object)
> current item position (typically numeric), and
> selected items (typically a collection)
> 
> http://doc.4d.com/4Dv17/4D/17/List-box-specific-properties.300-3743666.en.html
> 
> use the 3rd one.
> 
> 2018/07/30 0:27、John DeSoi via 4D_Tech 
> <4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:
> 
> Is there a way to get all of the highlighted row numbers for a collection 
> listbox? It seems you can only get the first highlighted row number via the 
> currentItemPosition property. The selectedItems property would return a 
> collection of highlighted items, but at best you would have to sequentially 
> search the collection to determine the position for each object.

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

selected rows for a collection listbox

2018-07-29 Thread John DeSoi via 4D_Tech
Is there a way to get all of the highlighted row numbers for a collection 
listbox? It seems you can only get the first highlighted row number via the 
currentItemPosition property. The selectedItems property would return a 
collection of highlighted items, but at best you would have to sequentially 
search the collection to determine the position for each object.

John DeSoi, Ph.D.

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

Re: First ORDA runtime error - just like SQL

2018-07-27 Thread John DeSoi via 4D_Tech

> On Jul 27, 2018, at 1:52 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> It's also annoying that an error handler is running, yet a runtime error 
> appears instead of calling the error method. Also the lack of a call chain 
> makes this really hard to track down.

So. Incredibly. Annoying. I'm not aware of any other server product that stops 
a process and shows an end user error dialog for a database server or web 
server.

John DeSoi, Ph.D.

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

Re: Special characters in ftp filenames

2018-07-27 Thread John DeSoi via 4D_Tech
Options I see are:

1. Report as a bug and hope for a fix. Since it is a beta version, maybe your 
chances are better?

2. Parse the output strings for non-ascii characters and try to correct them. I 
have not tried it, but it might be possible using Convert to text/CONVERT FROM 
TEXT.

3. Use something else. I ended up using CURL to deal with servers were 
FTP_GetDirList did not work correctly.

John DeSoi, Ph.D.

> On Jul 27, 2018, at 6:21 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> using v17r2:
> 
> I get a list of files in a directory on a remote server with
> *FTP_GetDirList.*
> Then I loop through the list and download each file, if I don't already
> have the latest version of it.
> A problem occurs when a filename contains a character such as a quote mark,
> copyright symbol, etc. Whilst these filenames look correct when viewed via
> an ftp program such as FileZilla, I get an error when trying to download
> them because it doesn't like those codes - e.g.
> 
> 250-Bay Bulls 2-Gatherall’s Puffin & Whale Watch Cruise.jpg.
> 
> instead of
> 250-Bay Bulls 2-Gatherall's Puffin & Whale Watch Cruise.jpg.
> How to deal with this?

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

Re: standard action for design mode not working in 17.0

2018-07-26 Thread John DeSoi via 4D_Tech
Hi Jody,

The button had the action assigned to it, not done with code in any way. As you 
said, I think the name changed and that was reflected in the button action in 
the form editor. I never use the "user mode" features to access the database 
and find it rather annoying when that window shows up. I seem to recall having 
an issue like this in some previous versions but not with all structures. My 
speculation is that it has something to do with older structures brought 
forward from much earlier 4D versions.

Thanks,

John DeSoi, Ph.D.

> On Jul 26, 2018, at 5:17 PM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I encountered this too. I believe the command changed from the v16R series to 
> a slight difference in v17. The constant had changed. I looked it up in v17 
> and just used the new command.

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

Re: Does MSC database compact work for large data files?

2018-07-26 Thread John DeSoi via 4D_Tech
Chuck,

> On Jul 26, 2018, at 11:50 AM, Charles Miller via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I did not. I meanty sql calls, but you are correct, object fields need to
> be handled in a different way. That is why I never use object fields. I do
> not think 4D should ever create field types that work in 4D but not in SQL
> or vice versa. I will not use them no matter how cool they may be. There
> are also SQL data types that 4D does not know about. In case of table with
> object data type, I would export that table in 4D format in then import.

Yes, I agree. Type consistency across features and APIs continues to be a 
problem. ORDA in version 17 can't do anything with BLOB fields.


> 
> Whether you use import or sql calls to get at data, you can use database
> setting to turn off indexing while saving the data. I would do this and
> then turn on indexing between each table

Dealing with exporting/importing, manipulating indexes, and so on is a lot more 
work than what I outlined using compact. The key question is if the compacted 
database is viable after force quitting it during the compacting indexing 
process. I convinced myself it is by writing a method that exports the primary 
key and md5 hash of every record in the database. I compared this export before 
and after the compact and did not find any differences.

John DeSoi, Ph.D.


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

Re: Does MSC database compact work for large data files?

2018-07-26 Thread John DeSoi via 4D_Tech


> On Jul 26, 2018, at 11:21 AM, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Sometimes it is better to use sql to recreate data file. Now that v16 handles 
> blob arrays it is very fast.

If you mean SQL EXPORT DATABASE, it will not work if the database has object 
fields.

John DeSoi, Ph.D.

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

Re: Does MSC database compact work for large data files?

2018-07-26 Thread John DeSoi via 4D_Tech
Hi Jeff,

> On Jul 26, 2018, at 11:05 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> No longer needed in v16.  A compact will reorganize the data file, and then 
> do a complete reindex.

This is what I'm trying to do that is not working without forcing 4D to quit 
and reindex separately after compacting. 

What do you mean by "no longer needed in 16"? There is a Get table 
fragmentation command that might be saying compaction is needed.

> 
> We do our compacts on 4D Server 64-bit on Windows. We do it on a machine that 
> has enough RAM so that the cache never gets used up. Since version 16 and the 
> latest new-and-improved cache manager on Windows, there's a huge performance 
> problem when 4D has to release memory from the cache.

So perhaps Windows does not have the same problem. This is 64-bit Mac (16 and 
17). Reindexing/cache is not a problem unless it is done as part of the compact 
process. It appears MSC does not use the cache at all when it opens for 
compacting mode.


Thanks,

John DeSoi, Ph.D.

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

Does MSC database compact work for large data files?

2018-07-26 Thread John DeSoi via 4D_Tech
I  had a very stable 16 user database with 4D 15 32-bit Mac. After upgrading to 
4D 16 64-bit Mac (on 16.3HF4), 4D server has been crashing about twice a month. 
There is no consistency on the process or records involved in the crash. The 
only consistency is the backtrace of the internal 4D routines involved. Here 
are some samples.

Thread 93 Crashed:: Import (id = 133091)
0   libsystem_kernel.dylib  0x7fff7f337b6e __pthread_kill + 10
1   libsystem_pthread.dylib 0x7fff7f502080 pthread_kill + 333
2   libsystem_c.dylib   0x7fff7f2931ae abort + 127
3   libsystem_malloc.dylib  0x7fff7f39cad4 szone_error + 596
4   libsystem_malloc.dylib  0x7fff7f39e0eb 
small_free_list_remove_ptr_no_clear + 790
5   libsystem_malloc.dylib  0x7fff7f392061 
small_malloc_from_free_list + 171
6   libsystem_malloc.dylib  0x7fff7f390859 
szone_malloc_should_clear + 1600
7   libsystem_malloc.dylib  0x7fff7f3901bd malloc_zone_malloc + 
103
8   libsystem_malloc.dylib  0x7fff7f38f4c7 malloc + 24
9   com.4d.component.db4d   0x00010f052e19 
VDBCacheMgr::NewPtr(unsigned long, unsigned char, int, int) + 25
10  com.4d.component.db4d   0x00010f399c00 
TreeMem::PutInto(int, int, void*, OccupableStack*) + 256
11  com.4d.component.db4d   0x00010f39e26c 
TreeMemHeader::PutIntoTreeMem(int, int, void*, OccupableStack*) + 428
12  com.4d.component.db4d   0x00010f125e2d 
DataTableRegular::LoadRecord(int, unsigned long long&, DB4D_Way_of_Locking, 
BaseTaskInfo*, unsigned char, unsigned char, ReadAheadBuffer*, unsigned char*) 
+ 1053


Thread 77 Crashed::  CWR Export (id = 170783)
0   com.4d.component.db4d   0x00010f95ea6b 
TreeMem::RetainFrom(int, int, OccupableStack*) + 139
1   com.4d.component.db4d   0x00010f95ea9e 
TreeMem::RetainFrom(int, int, OccupableStack*) + 190
2   com.4d.component.db4d   0x00010f9636eb 
TreeMemHeader::RetainFromTreeMem(int, OccupableStack*) + 75
3   com.4d.component.db4d   0x00010f6eb7f7 
DataTableRegular::LoadNotFullRecord(int, unsigned long long&, 
DB4D_Way_of_Locking, BaseTaskInfo*, unsigned char, ReadAheadBuffer*, unsigned 
char*, unsigned char*) + 583
4   com.4d.component.db4d   0x00010f6df737 
DataTable::Search(unsigned long long&, RechNode*, Bittab*, 
xbox::VProgressIndicator*, BaseTaskInfo*, DB4D_Way_of_Locking, Bittab*, int, 
Bittab&, LocalEntityModel*) + 3239
5   com.4d.component.db4d   0x00010f8389d3 
RechNode::Perform(OptimizedQuery*, Bittab**, Bittab*, 
xbox::VProgressIndicator*, xbox::VValueBag*, BaseTaskInfo*, 
DB4D_Way_of_Locking, Bittab*, int, Bittab&, RechNode*&) + 163
6   com.4d.component.db4d   0x00010f8469ca 
RechNodeMultiOperator::Perform(OptimizedQuery*, Bittab**, Bittab*, 
xbox::VProgressIndicator*, xbox::VValueBag*, BaseTaskInfo*, 
DB4D_Way_of_Locking, Bittab*, int, Bittab&, RechNode*&) + 2058
7   com.4d.component.db4d   0x00010f84da5f 
OptimizedQuery::Perform(Bittab*, xbox::VProgressIndicator*, BaseTaskInfo*, 
unsigned long long&, DB4D_Way_of_Locking, int, Bittab*) + 1903
8   com.4d.component.db4d   0x00010f6e0f12 
DataTable::ExecuteQuery(SearchTab*, QueryOptions*, QueryResult&, BaseTaskInfo*, 
xbox::VProgressIndicator*) + 322
9   com.4d.component.db4d   0x00010f690933 
VDBMgr::ExecExecuteQuery(IRequestReply*, CDB4DBaseContext*) + 259
10  com.4d.component.db4d   0x00010f688253 
VDBMgr::ExecuteRequest(short, IRequestReply*, CDB4DBaseContext*) + 1475
11  com.4d.component.db4d   0x00010f697697 
VDBMgr::ExecuteRequest(short, xbox::IStreamRequestReply*, CDB4DContext*) + 311
12  com.4d.component.db4d   0x00010f9a4a64 
DB4DConnectionHandler::Handle(unsigned long long&) + 2036


So it appears that 4D is crashing shortly after loading a record 
(DataTableRegular::LoadRecord, DataTableRegular::LoadNotFullRecord). The 
database is validated every night and reports no errors. Manual check in MSC 
reports no errors. With no other solution in sight, it is time to compact the 
database (70+ GB) and see if it makes a difference. Here is what happens.

1. Open MSC, click on Compact, click on Advanced. Check "Force updating of the 
records" and "Compact address table". Click the compact button.

The first bit of confusion is the path under "Original files backup folder" is 
*not* a backup of the original database. It is the new compacted database.

2. Wait for hours and the progress bar finally reaches the last table and is 
pixels away from the end. Wait for many more hours, nothing seems to be 
happening even though 4D is using 100% CPU. Finally discover that 4D is 
indexing the database, but the indexing progress window is hidden behind the 
MSC window.

3. Wait many more hours, progress bar for 

standard action for design mode not working in 17.0

2018-07-14 Thread John DeSoi via 4D_Tech
I converted a structure from 16.3HF4 to 17.0. A button that worked in version 
16 to open design mode (standard action = design), does not work in version 17. 
It shows the list of files application window, but keeps the startup menubar 
set for the runtime environment. 

Anyone seen or solved this? For now, I changed the database setting to startup 
in Design instead of Runtime as a work-around. 

Thanks

John DeSoi, Ph.D.

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

Re: How to protect JS Source Code?

2018-07-14 Thread John DeSoi via 4D_Tech
There is not much you can do. Javascript can be minimized and obfuscated, but 
there are plenty of tools to reverse that.

John DeSoi, Ph.D.


> On Jul 13, 2018, at 11:38 PM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> One of the beauties of 4D is that the source code can be delivered in a 
> compiled form which more than obfuscates the code. So, if you have a full 
> JavaScript stack application running on the customers server, not merely 
> hosted solution, how can the source code (mostly JS) be protected?

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

Re: Macro question - using project methods in a macro

2018-07-05 Thread John DeSoi via 4D_Tech
Kirk,

I think you are looking for GET MACRO PARAMETER and SET MACRO PARAMETER. In the 
method called by your macro, that allows you to get/set the selection or the 
entire method.

John DeSoi, Ph.D.



> On Jul 5, 2018, at 5:08 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I haven't tinkered with my macros in quite a while. Today I was trying to
> write a project method that returns some text. The idea being to run the
> method from a macro and plug the result directly into the method being
> edited. Here's the what I was working with:
>  version="2"
> in_menu="true"
> type_ahead="true"
> type_ahead_text="rd1">
> resdoc_macro()
> 

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

Re: Extra characters

2018-07-03 Thread John DeSoi via 4D_Tech
The extra characters are the Byte Order Mark (BOM) - see the documentation. A 
BOM is useless with UTF-8, but there is no way to prevent 4D from inserting it 
when using TEXT TO DOCUMENT. 

I use this method instead:


C_TEXT($1;$2)
C_BLOB($blob)

TEXT TO BLOB($1;$blob;UTF8 text without length)
BLOB TO DOCUMENT($2;$blob)

John DeSoi, Ph.D.



> On Jul 3, 2018, at 10:31 PM, Robert McKeever via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> TEXT TO DOCUMENT($MyDocs1{$n};$MyReplacedDoc;"UTF-8";0)
> 
> Seemed to work. Except each modified file has three extra leading characters, 
> so the java scripts won’t run.If I remove the weird characters, the scripts 
> run fine. The documents were created with UTF-8. 
> 
> In hex, the characters are ‘EFBBBF’. How do I prevent the characters from 
> being added?

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

Re: Creating Tables by running a method

2018-06-23 Thread John DeSoi via 4D_Tech
Pat,

Not in the XML, but you could import the table structure (with trigger 
properties enabled) and then set the trigger code using METHOD SET CODE. My 
approach would be to enable all the trigger properties even if there is not an 
immediate need to have a trigger. I don't think there is any other way to set 
the table trigger properties once the table is created. I don't believe there 
is any performance penalty unless the trigger method is defined for the table.

John DeSoi, Ph.D.




> On Jun 23, 2018, at 3:14 PM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> John,
> Can you set the trigger code that way as well (using XML)?
> Pat

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

Re: Creating Tables by running a method

2018-06-23 Thread John DeSoi via 4D_Tech
The triggers won't run until you set the trigger properties on the table. I'm 
not aware there is any way to do that via SQL. You can set the trigger 
properties if you create the tables via XML and use IMPORT STRUCTURE.

John DeSoi, Ph.D.


> On Jun 23, 2018, at 11:52 AM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am using 16R6. I tried creating a trigger in the tables that I created 
> using SQL. I can go in and write code in the table triggers. They are saved. 
> I didn’t see if they actually ran though. Maybe 4D resolved this issue.

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

Re: Musing on creating PDFs in 4D

2018-06-14 Thread John DeSoi via 4D_Tech
To make the upgrade to 4D 16 64-bit, I replaced 4D Write with a Markdown editor 
using a rich text area with some expression editing features. HTML generated 
from Markdown is converted to PDF using PhantomJS. Seems to work well and no 
complaints from users. 

PhantomJS is losing future support, but both Google Chrome and Firefox support 
headless mode for generating PDFs. And there is all kinds of open source 
software for driving that on a server including some HTTP APIs.

https://github.com/RelaxedJS/ReLaXed

https://github.com/mozilla/geckodriver

https://w3c.github.io/webdriver/

John DeSoi, Ph.D.


> On Jun 14, 2018, at 10:22 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> ​Making PDFs is hard. True - with a Mac or Win10 it's become pretty easy to
> print-to-PDF. This is really a user-interface feature though. If you need
> to build a PDF in code and want to work with the BLOB of that document
> using the OS print features starts to fall apart. If you want to do this on
> the server it's a complete non starter in my view. ​

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

Re: How does one detect that Cookies are disabled?

2018-06-05 Thread John DeSoi via 4D_Tech
I don't know anything about Xojo, but from the code you posted all it seems to 
do is set a value on the server and immediately read it back. There is no way 
for the browser to have it yet. The browser only sets a local cookie from a 
HTTP response containing a "Set-Cookie" header. If cookies are enabled, the 
*next* request to the same server (with conditions related to the url) will 
have a "Cookie" header with the value from the previous request.
 
If you wanted to do this in what *appears* to be a single page request, your 
initial request to the server could return some Javascript that immediately 
calls back to the server with the cookie value (or reports it not found). Of 
course, via Javascript, you could also check for the cookie and complain to the 
user directly that cookies are off without ever reporting the status back to 
the server.

John DeSoi, Ph.D.


> On Jun 5, 2018, at 3:51 PM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I will be exploring further why Xojo is seeing the cookie when in fact it has 
> not been set. I suspect that it is not really reading the cookie from the 
> browser but instead storing the cookie value for the duration of the current 
> request. Perhaps it has to, since it really cannot be read from the browser 
> yet.

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

Re: How does one detect that Cookies are disabled?

2018-06-05 Thread John DeSoi via 4D_Tech

> On Jun 5, 2018, at 12:28 PM, Jim Labos - infobase via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I think that it's a question of the Browser not actually creating the Cookie
> until 4D ends the connection/method. If one traces the browser's actions one
> only sees the Cookie existing only after 4D sends the response but not
> before that. Upon the next connection there is no problem reading the
> Cookie.

The browser does not create the cookie until it receives your first response 
that contains a Set-Cookie header. There is no way for you to verify they have 
cookies enabled/disabled until they make a *second* request where you can see 
if your value is in the Cookie header.

John DeSoi, Ph.D.


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

  1   2   3   >