Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Justin Carr via 4D_Tech
Hi Chris

Is the relationship (UnitType) definitely drawn to the primary key field in the 
one table (the one with the underline in the structure editor)? If not, then 
you cannot do what you want. As I said, 4D will always query the one table's 
primary key for the value you enter into the relation, regardless of which 
field the relation is drawn to.

cheers
Justin

> On 19 Nov 2019, at 6:50 pm, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi Chris
> 
> Short answer is that if the many table is related to a field in the one table 
> which is NOT the primary key of the one table, the you should ***ABSOLUTELY 
> NOT USE ORDA*** to set the value of the many table field.
> 
> There is a horrible bug in ORDA where regardless of which field the relation 
> is drawn to in the one table, it will always locate the one record by 
> querying on the primary key field of the one record using the value you have 
> entered into the many field.
> 
> Worse still, when you save the many record, the value you have entered in the 
> related many field will automatically and silently be changed to the related 
> one field value of the now incorrectly loaded one record, thus permanently 
> linking the wrong two records together without any way of knowing that it has 
> happened or of how to undo it!!
> 
> To the best  of my knowledge this bug exists in all versions of 4D since ORDA 
> was introduced, on both Mac and Windows, and both 32- and 64-bit.
> 
> Regards
> Justin
> 
>> On 19 Nov 2019, at 6:16 pm, Chris Belanger via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a challenge,
>> I have a CBOX technique that lets me set the correct related KEY into a 
>> record’s field.
>> It sets the correct value.
>> But that related record is not ‘loaded’ after this correct value is loaded 
>> into that field.
>> 
>> For example:
>> 
>> Two tables (in classic 4D nomenclature)
>> [Units][UnitType]
>> Many-to-one relation is  [Unit]UType
>> 
>> In ORDA, this relation is defined as  Units.UnitType
>> 
>> (   Units.UType  is the foreign key to the [UnitType] master record   )
>> 
>> When the record is first loaded, Units.UnitType is the correct — it has the 
>> related master record from [UnitType]
>> 
>> However, If Units.UType is ever set to another unique key from the 
>> [UnitType] table, the related record is not re-loaded; and Units.UnitType is 
>> null {i.e. no related master record}.
>> 
>> 
>> I do not see any way to trigger the re-load [i.e. CORRECT load] for the 
>> related record  Units.UnitType  {the relation name for Units.UType’s 
>> many-to-one to [UnitType]  }
>> 
>> ——
>> 
>> Is there a way to trigger the related ONE record to re-load in ORDA?  [i.e.  
>> Units.UnitType to be correctly showing the [UnitType] record]
>> 
>> Confused?
>> 
>> Thanks,
>> Chris
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  
>> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=utlfdnTMt5rhAY%2FU0XmUjszk9IpEBlP2CRC0zYHGIJg%3Dreserved=0
>> Options: 
>> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Et1yUOqJN2dh1sbRZkuYuriYl%2BzB76%2BGRGszjAdkYE4%3Dreserved=0
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  
> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=utlfdnTMt5rhAY%2FU0XmUjszk9IpEBlP2CRC0zYHGIJg%3Dreserved=0
> Options: 
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cf5d2127a009c404dfd8008d76cd89513%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Et1yUOqJN2dh1sbRZkuYuriYl%2BzB76%2BGRGszjAdkYE4%3Dreserved=0
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: V17.6 How to getting a newly-related record to load in ORDA

2019-11-19 Thread Justin Carr via 4D_Tech
Hi Chris

Short answer is that if the many table is related to a field in the one table 
which is NOT the primary key of the one table, the you should ***ABSOLUTELY NOT 
USE ORDA*** to set the value of the many table field.

There is a horrible bug in ORDA where regardless of which field the relation is 
drawn to in the one table, it will always locate the one record by querying on 
the primary key field of the one record using the value you have entered into 
the many field.

Worse still, when you save the many record, the value you have entered in the 
related many field will automatically and silently be changed to the related 
one field value of the now incorrectly loaded one record, thus permanently 
linking the wrong two records together without any way of knowing that it has 
happened or of how to undo it!!

To the best  of my knowledge this bug exists in all versions of 4D since ORDA 
was introduced, on both Mac and Windows, and both 32- and 64-bit.

Regards
Justin

> On 19 Nov 2019, at 6:16 pm, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a challenge,
> I have a CBOX technique that lets me set the correct related KEY into a 
> record’s field.
> It sets the correct value.
> But that related record is not ‘loaded’ after this correct value is loaded 
> into that field.
> 
> For example:
> 
> Two tables (in classic 4D nomenclature)
> [Units][UnitType]
> Many-to-one relation is  [Unit]UType
> 
> In ORDA, this relation is defined as  Units.UnitType
> 
> (   Units.UType  is the foreign key to the [UnitType] master record   )
> 
> When the record is first loaded, Units.UnitType is the correct — it has the 
> related master record from [UnitType]
> 
> However, If Units.UType is ever set to another unique key from the [UnitType] 
> table, the related record is not re-loaded; and Units.UnitType is null {i.e. 
> no related master record}.
> 
> 
> I do not see any way to trigger the re-load [i.e. CORRECT load] for the 
> related record  Units.UnitType  {the relation name for Units.UType’s 
> many-to-one to [UnitType]  }
> 
> ——
> 
> Is there a way to trigger the related ONE record to re-load in ORDA?  [i.e.  
> Units.UnitType to be correctly showing the [UnitType] record]
> 
> Confused?
> 
> Thanks,
> Chris
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  
> https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cad4c01f6c81f44014ba608d76cc8d450%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=LFYdvJLcBHQeE1DrCsTMNgHcMHrJz9KLWyG7MATewUk%3Dreserved=0
> Options: 
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=01%7C01%7Cjustincarr%40geniesolutions.com.au%7Cad4c01f6c81f44014ba608d76cc8d450%7Cf9523ca0a897457dac3a9b46a9648991%7C0sdata=Vtu4KP5emmfMa7hTiSXxA5Hk6mt1%2B3x18Lw4Wyz9sGk%3Dreserved=0
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

[ANN] 4D Developer Positions Available

2019-11-10 Thread Justin Carr via 4D_Tech
Hi All

Just a reminder that we are always on the lookout for new developers to join 
our team here at Genie Solutions.

If you want to grow and unleash your passion for development in innovative and 
interesting ways in a friendly, supportive and professional environment, then 
look no further.

We are particularly interested in experienced 4D developers but are also open 
to new developers or those with experience in other languages.

Genie Solutions provides practice management software for medical 
practitioners. With over 3,800 practices around the country using our software, 
we are the market leader for medical specialists and also a 4D Gold Partner.

The positions available are for full-time permanent roles based in our head 
office in Australia's sunshine capital, Brisbane. We are willing to sponsor the 
right candidates with a working visa if required.

If you're interested in finding out more you can contact 
employeeexperie...@geniesolutions.com.au or feel free to email me directly.

cheers!

Justin Carr
Senior Developer
Genie Solutions Pty Ltd
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Running v16.6 built application as a service on Windows SBS 2011

2019-08-27 Thread Justin Carr via 4D_Tech
> On 28 Aug 2019, at 10:23 am, Mike Beatty via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> All-
> 
> Running into an issue trying to get a v16.6 built application to run as a 
> service, wondering if anyone has this in place before we ramp up the 
> troubleshooting.
> 
> A few notes — this is on a client remote server, which is administered
> by a third party that will not allow us to have administrative access. The 
> machine does have a 2003 app running as a service. We can run the application 
> outside of services without an issue. We have switched between running as the 
> local account to use interactive desktop, but when we try to view the 
> message, we get kicked out of machine — the third party group loses 
> connection for roughly 60 seconds, then reports seeing both a power shell 
> window and a command prompt. When running as an administrator account, as is 
> the 2003 version, the service will start, then inexplicably stop. Windows 
> logs don’t shed much light on the issue.
> 
> We are going to start trying other means to find cause/resolution, just 
> wanted to see if anyone is running this config successfully.

Hi Mike

We're not running v16.6 specifically but it's probably worth checking how the 
server locates the data file it needs to use. If the server can't find the 
right data file when running as a service, it won't start.

This is a semi-complicated area. One way to control it is to use the Default 
Data mechanism but this causes crashes for us in the versions we've tested it 
with (v17.0, 17.1, 17.2, 17R4). The crashes occur when 4D is trying to open the 
Default.4DD data file so it is before any of our code runs so there's not much 
we can do about it. For that reason we can't use this mechanism on Windows, 
although we use it successfully on Mac.

The other option revolves around how the path to the last used data file is 
stored (set using the LastDataPathLookup key in the BuildApp.xml). There are 
three options:
1. InDbStruct (store the path in the 4DC)
2. ByAppName (store the path in user preferences, indexed by the structure name)
3. ByAppPath (store the path in user preferences, indexed by the full path to 
the server executable)

On Windows the latter two options reference the file here: 
%APPDATA%\Roaming\\lastDataPath.xml

If you use either option 2 or 3 you muct have the "Use new architecture for 
application deployments" option ticked in the Compatibility page of the 
Structure Settings.

You would use option 3 over option 2 if you have more than one instance of the 
same application on the server.

If you are running the service under the local system account rather than a 
user account, the path to the lastDataPath.xml file is actually at:

C:\Windows\System32\config\systemprofile\AppData\Roaming\\

unless you're running a 32-bit server application on a 64-bit Windows OS, in 
which case replace System32 with SysWOW64 above.

Once the server has started successfully once, it will remember the path to the 
data file using one of these mechanisms and will continue to open sucessfully 
thereafter. Unless you use option 1 (InDbStruct) in which case the next time 
you deploy a new 4DC file you will lose the path to the data file and be back 
in the same boat. For this reason I would recommend using option 2 or 3 in your 
situation.

Hope that helps!

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

Re: Form and DIALOG

2019-04-29 Thread Justin Carr via 4D_Tech
Jeremy,

That's definitely one of the supported/encouraged behaviours as far as I am 
aware.

cheers
J

> On 29 Apr 2019, at 6:05 pm, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is it safe to use the object returned by the Form command as a means of 
> passing data back to the caller? That is, should the method of the form 
> opened in DIALOG regard its Form object as read-only, or is it allowed to 
> alter it?
> 
> At present, changing the values of the object passed by DIALOG works: the new 
> values are available to the caller when the DIALOG command returns. It’s 
> quite handy. But there’s nothing in the documentation, as far as I can see, 
> to indicate whether this is sanctioned or likely to change.
> 
> Jeremy
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: Custom Form Events

2019-04-23 Thread Justin Carr via 4D_Tech
Hi Chris

We use SET TIMER(-1) a lot for this purpose. It is ideal when you want to do 
something as part of On Load but you need the On Load execution cycle to finish 
first before you do the next thing, e.g. you need to know the size and position 
of an object on a form before you take some other action.

POST OUTSIDE CALL can also be used for this purpose, particularly if you're 
sending the event from another process. CALL FORM is the the "new way" to do 
this sort of thing but you have to be aware that it does not always run in its 
own execution cycle, i.e. you can't rely on it to perform the sort of On Load 
workflow I just described because the chances are it will run in the same 
exection cycle as the original On Load. Even when the CALL FORM is made from a 
separate process it won't necessarily run in its own execution cycle. That 
said, if I'm not relying on some previous execution cycle to have finished and 
want to "send an event" to the form then CALL FORM is definitely the way to go.

I haven't tried New formula yet so can't comment on that.

cheers
J

> On 24 Apr 2019, at 1:24 am, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Douglas, that is an ingenious way to facilitate it. I suppose one could use a 
> Form object (Form.myEvent) to specify the ‘event’ to perform.
> But it seems that SET TIMER(-1) is what needs to be done [trigger as soon as 
> possible] and then SET TIMER(0) disables the triggering?
> 
> — Chris
> 
>> On Apr 23, 2019, at 9:19 AM, Douglas von Roeder via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Chris:
>> 
>> Set timer (0) and then catch it in On timer.
>> 
>> --
>> Douglas von Roeder
>> 949-336-2902
>> 
>> 
>> On Tue, Apr 23, 2019 at 8:17 AM Chris Belanger via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>> 
>>> I have been using New formula too.
>>> In the context of ORDA-based forms, I have set up  Form.onSave(),
>>> Form.onLoad(), Form.onNew() etc. I like it because the code for record
>>> selection and change can be generic with these ’nubs’.
>>> I wish that one did not have to create a project method [for other than
>>> the most rudimentary use] to use ’New Formula’, but still it is a great new
>>> feature.
>>> 
>>> In any case, back to my question about form events. Is the only mechanism
>>> to do an ‘Outside Call’ with POST OUTSIDE CALL? What have you found that
>>> works, if anything.
>>> 
>>> 
 On Apr 23, 2019, at 9:05 AM, Keisuke Miyako via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
 
 I think the future is to use New formula.
 
 it is like a function pointer in other languages,
 it allows the callee to invoke a callback function at a later time.
 
 https://blog.4d.com/new-formula-more-power-behind-simplicity/
 
 alternatively, one could say that CALL FORM is like a custom form event.
 
 regarding subforms,
 CALL SUBFORM CONTAINER can only convert an event in the subform context
 to another event in the host's context,
 it does not generate a new event.
 
 2019/04/23 23:32、Chris Belanger via 4D_Tech <4d_tech@lists.4d.com
>>> >のメール:
 
 I remember — but cannot find again — some documentation that talked
>>> about using negative-numbered values for events to facilitate custom
>>> events. However, I seem to remember it only was in the context of subforms.
 
 
 
 **
 4D Internet Users Group (4D iNUG)
 Archive:  http://lists.4d.com/archives.html
 Options: https://lists.4d.com/mailman/options/4d_tech
 Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
 **
>>> 
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

[ANN] 4D Developer Position Available

2019-04-16 Thread Justin Carr via 4D_Tech
Hey Everyone

Ever dreamed of living and working in Australia? Better yet, in Australia's 
sunshine capital Brisbane?

If so, this may be the oppourtunity you've been waiting for!

We are looking for an experienced and passionate 4D developer to join our great 
team here in a full time permanent role. You will be using the latest 4D 
products in innovative and interesting ways in a friendly, supportive and 
professional environment. The primary focus is our medical practice management 
software which is installed in over 3,800 practices around the country.

We are willing to sponsor the right candidate with a working visa if that is 
required.

All the details you need to get started are in this link:

https://www.seek.com.au/job/38609196

Feel free to email me directly with any questions.

Thanks for reading!

Justin Carr
Senior Developer
Genie Solutions Pty Ltd
Brisbane, Australia
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Write Hex Bytes

2019-02-21 Thread Justin Carr via 4D_Tech
On 22 Feb 2019, at 10:30 am, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> it sounds like you are over-thinking :)
> 
> you could just do
> 
> SET BLOB SIZE($bytes;4)
> 
> $bytes{0}:=78
> $bytes{1}:=48
> $bytes{2}:=75
> $bytes{3}:=00
> 
> then BLOB TO DOCUMENT.
> 
> not need to go through hex.

Or even easier:

C_BLOB($vX_Data)
C_LONGINT($vL_Offset)

$vL_Offset:=0
LONGINT TO BLOB(78487500;$vX_Data;PC byte ordering;$vL_Offset)

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

Re: Set Time question

2019-02-14 Thread Justin Carr via 4D_Tech
On 14 Feb 2019, at 10:18 pm, Arnaud de Montard via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> 
>> Le 10 févr. 2019 à 18:41, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
>> écrit :
>> 
>> Just to add a little more to this.
> 
> Me too, forgot to mention CALL FORM: has a message queue, can receive 
> parameters, can call its own window, allows to execute almost any method in 
> the context of the form… In a recent 4d training, someone told me he had 
> replaced a lot of "On timer" old code with it. 


True, but sometimes you may need to still use On Timer since CALL FORM doesn't 
always execute in a new cycle, i.e. if you make a change which needs the form 
to be redrawn before the things you want to do with CALL FORM run, you still 
need to use On Timer (or POST OUTSIDE CALL) instead as it is possible the CALL 
FORM will execute in the current cycle.

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

Re: 4Dv15 applications as a Service in Windows Server 2012

2018-09-13 Thread Justin Carr via 4D_Tech
On 13 Sep 2018, at 5:14 pm, Ronnie Teo via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi David,
> 
> Thanks for your tip.
> I have conducted the test as per your suggestion and from the results of the 
> test, it does not appear to be a firewall problem.
> 
> a)  4Dv15.5 (32-bit) - server app launched directly - database server appears 
> on Available tab on Client (works OK)
> b)  4Dv15.5 (32-bit) - server app run as Windows service - database server 
> appears on Available tab on Client (works OK)
> c)  4Dv15.5 (64-bit) - server app launched directly - database server appears 
> on Available tab on Client (works OK)
> 
> d)  4Dv15.5 (64-bit) - server app run as Windows service - Available tab on 
> Client is empty  (does NOT work)
> 
> For the failed service (d), when I highlight the service it shows that the 
> service is running.
> Further examination of the service properties shows that the service is NOT 
> running or has stopped.  
> I have to click the Start button again and even then, the available tab on 
> the client is still blank, connection fails.

I'm also chiming in late on this one but it sounds similar to an issue we 
encountered with v16R3. The application would crash when run as a service when 
calling SET ABOUT during the server startup. I think you could avoid the crash 
by ticking the "Allow service to interact with desktop" checkbox, or by 
removing the call to SET ABOUT.

cheers
J
**
4D Internet Users Group (4D iNUG)
Archive:  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 Justin Carr via 4D_Tech
On 28 Aug 2018, at 11:52 am, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> It does, but remember if you already have multiple transactions, you will 
> have to keep track and may have to suspend that many times

I don't think that is true. When you SUSPEND TRANSACTION, the effective 
Transaction level goes back to 0, so no matter how many levels deep you are, 
when you call START TRANSACTION after SUSPEND TRANSACTION, the Transaction 
level function always returns 1.

I'm pretty sure calling SUSPEND TRANSACTION more than once without resuming in 
between causes a run time error.

I just tried this and my changes are saved as I would expect:

QUERY([SomeTable];[SomeTable]UniqueId=1)
[SomeTable]Value:="ABC"
SAVE RECORD([SomeTable])
UNLOAD RECORD([SomeTable])

START TRANSACTION  ---> Transaction level = 1, In transaction = True, 
Active transaction = True
START TRANSACTION  ---> Transaction level = 2, In transaction = True, 
Active transaction = True
START TRANSACTION  ---> Transaction level = 3, In transaction = True, 
Active transaction = True

SUSPEND TRANSACTION  ---> Transaction level = 3, In transaction = True, 
Active transaction = False

START TRANSACTION  ---> Transaction level = 1, In transaction = True, 
Active transaction = True

QUERY([SomeTable];[SomeTable]UniqueId=1)
[SomeTable]Value:="XYZ"
SAVE RECORD([SomeTable])
UNLOAD RECORD([SomeTable])

VALIDATE TRANSACTION---> Transaction level = 3, In transaction = True, 
Active transaction = False

RESUME TRANSACTION---> Transaction level = 3, In transaction = True, 
Active transaction = True

CANCEL TRANSACTION  ---> Transaction level = 2, In transaction = True, 
Active transaction = True
CANCEL TRANSACTION  ---> Transaction level = 1, In transaction = True, 
Active transaction = True
CANCEL TRANSACTION  ---> Transaction level = 0, In transaction = False, 
Active transaction = False


QUERY([SomeTable];[SomeTable]UniqueId=1)

// [SomeTable]Value is now "XYZ"


**
4D Internet Users Group (4D iNUG)
Archive:  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 Justin Carr via 4D_Tech
On 28 Aug 2018, at 6:08 am, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Hey guys - the very issue with the record counter is sketched out in the
> discussion about Suspending Transactions:
> 
> http://doc.4d.com/4Dv16/4D/16.3/Suspending-transactions.300-3652126.en.html
> 
> 
> I had missed this - it's quite a feature.

It is and it works well. One gotcha is if you are potentially allocating more 
than 1 ID for the same table within the transaction, you must allocate the new 
IDs within their own transaction, otherwise you just keep getting the same 
(initial) value returned for the next ID,

i.e. in the method that is allocating your new IDs you need to do something 
like:

C_BOOLEAN($vB_InTransaction)

$vB_InTransaction:=Active transaction
If ($vB_InTransaction)
SUSPEND TRANSACTION
START TRANSACTION
End if

// allocate the new ID here

If ($vB_InTransaction)
VALIDATE TRANSACTION
RESUME TRANSACTION
End if

This requires having the "Allow Nested Transactions" compatibility checkbox 
ticked.
**
4D Internet Users Group (4D iNUG)
Archive:  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.0 HF1 Bug Fix delayed process not waking fix

2018-08-13 Thread Justin Carr via 4D_Tech
On 14 Aug 2018, at 2:18 am, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Got an email about v17.0 HF1 being released. This fixed bug caught my eye:
> 
> 
> ACI0098368 A delayed processes do not wake up if paused and then resumed: 
> it stays in pause mode.
> 
> Could this be a fix for the Stored Procedure problem many have reported here 
> where they get paralyzed and refuse to wake up and run again until you 
> restart 4D Server?
> 
> Anyone know if this is a fix for that bug. 

Hi Tim

I don't whether this fix will also fix the other bug many of us are 
experiencing. Just to be clear there is no pause/resume process involved when 
it happens (to us at least). And you don't need to restart the 4D Server to 
resolve it. Just calling RESUME PROCESS gets it going again.

So no explicit pausing and resuming - it's just that the DELAY PROCESS doesn't 
wake up at the appropriate time.

J
**
4D Internet Users Group (4D iNUG)
Archive:  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, pictures in page, frozen document, to 4D Write Pro

2018-06-24 Thread Justin Carr via 4D_Tech
Just a a guess John, but is it possible the pictures that don't convert were 
inserted in PICT format? Maybe you could select one of the letters with 
troublesome images and convert one of those images in place to PNG (using 
CONVERT PICTURE). Then try opening that letter again in 4D Write Pro.


On 24 Jun 2018, at 12:09 pm, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Still trying to get my head around converting 4D Write documents that contain 
> images in page to 4D Write Pro. I have moved on from the templates which I 
> think I have working and am now dealing with correspondence that has been 
> printed and most have references frozen.
> 
> These document have up to 16 phots inserted with WR INSERT PICTURE using 
> variables (ptoto1, photo2, etc) populated from records, one record per 
> variable.  There are over 56,000 documents that need to be converted to Pro 
> so doing this manually is not an option. I am using the table’s input form to 
> test the code I plan to use for the batch conversion. I have a 4D Write Pro 
> area, WP_WriteProArea,  on page 1 and have moved the original 4D Write area, 
> Letter, that was on page 1 to page 2.
> 
> Using the following code, I have gotten mixed results...
> 
>   WR EXECUTE COMMAND (Letter;wr cmd freeze references)
>   SAVE RECORD([Letter]) // save the record because in batch mode 
> there will not be an input form. Making sure that the pictures are saved in 
> the picture field.
>   
>   $wrOffscreenArea:=WR New offscreen area   //this is how it will 
> be done in batch mode
>   WR PICTURE TO AREA ($wrOffscreenArea;[Letter]Letter_)
>   C_BLOB($letterBlob)
>   $letterBlob:=WR Area to blob ($wrOffscreenArea;1)
>   WP_WriteProArea:=WP New($letterBlob)  //In batch mode this will 
> be changed to the c_object field in the table
>   FORM GOTO PAGE(1). //not to be used in batch mode
> 
> Some documents convert nicely but for others every thing but the photos do 
> not make to the pro area. No sign of the photos at all, otherwise the 
> document looks perfect. In still some other documents some of the photos make 
> it and some are there but not visible. If I click where it should be it may 
> show the photo or select a rectangle that is completely blank, just the 4 
> handles.
> 
> I tired converting the write area directly, but got the same result…
> 
>   WR EXECUTE COMMAND (Letter;wr cmd freeze references)
>   C_BLOB($letterBlob)
>   $letterBlob:=WR Area to blob (Letter;1)
>   WP_WriteProArea:=WP New($letterBlob)
>   FORM GOTO PAGE(1)
> 
> This is very discouraging. I cannot see anything different between the 
> documents that work and those that do not. I could programmatically reinsert 
> all the pictures found in the write document, but these documents are 
> supposed to be frozen. The photos should not be changed if the photo was 
> changed at a later date…. HIPPA.
> 
> Perhaps it’s time to call tech support?
> 
> John
> 
> 
> 
> 
> 
> John Baughman
> 1331 Auwaiku Street
> Kailua, Hawaii  96734
> (808) 262-0328
> john...@hawaii.rr.com
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: Write Pro: programmatically manipulate text expertise needed

2018-06-21 Thread Justin Carr via 4D_Tech
On 21 Jun 2018, at 4:49 pm, Piotr Chabot Stadhouders via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Hi Justin, Pat,
> 
> Using WP SELECT that is called in a method via CALL FORM seems to work, 
> thanks for that!
> 
> I must say, I can't believe it's 4D's intention that we constantly have to 
> use CALL FORM for thinks to work.
> Maybe they implement a more sophisticated way for doing this.

I have to say it's annoying. What's even more annoying is that most of the time 
CALL FORM isn't enough. You have to use SET TIMER(-1) and set some info 
somewhere to let the timer know what to do when it triggers. I don't find it 
anwhere near as simple or intuitive as working with 4D Write was. I live in 
hope that things will become easier to manage as the product improves. 
Certainly there are steps forward with each new release.

**
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: Delay process bug

2018-06-18 Thread Justin Carr via 4D_Tech
On 18 Jun 2018, at 4:39 pm, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Justin,
> I do use DELAY PROCESS but as I said it's only for a minute or two.
> And like I said maybe I've simply been lucky. As my business mentor used to
> say, "sometimes it's better to be lucky than smart."
> 

Hi Kirk

We are only delaying for 10 seconds but our users were still experiencing this 
problem from time to time. We have worked around it now using a method similar 
to those already posted on this thread but it would sure be nice to once again 
be able to trust a delayed process to wake up when it's supposed to!

J
**
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: Delay process bug

2018-06-17 Thread Justin Carr via 4D_Tech
On 18 Jun 2018, at 1:31 pm, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> according to the bug description for ACI0098368 ("Delayed processes do not 
> wake up if paused/resumed while already delayed"),
> 
> it's not that the DELAY P. has a problem resuming,
> the problem manifests itself when the codes pauses a process that is already 
> in "delay" status.
> a double resume is required to cancel a delay-double combo.
> 
>> In v16 the runtime explorer shows the following:
>> 
>> - start process: Executing
>> - delay process (3600 ticks): Delayed
>> - pause process (within the delay time): Delayed
>> - resume process (within the delay time): Paused (!)
>> - resume process or delay process (0 ticks): Executing
>> 
>> So in v16, there is an additional RESUME PROCESS that is required to kick 
>> the process back into gear.
> 
> so as long as you use pause & resume, or delay (with no interference), 
> everything should be OK.
> 
> but mixing delay, pause, resume in a complex sequence could mean trouble.
> the good news is that the bug described above is on course to be fixed.

I think that is a different bug from the one many of us are experiencing. There 
is no PAUSE PROCESS called on the delayed process. It simply doesn't wake up at 
the allocated time.
**
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: Write Pro: programmatically manipulate text expertise needed

2018-06-17 Thread Justin Carr via 4D_Tech
On 15 Jun 2018, at 10:01 pm, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Hi Piotr,
> I think you can use WP SELECT to do this -
> WP SELECT ( {* ;} wpArea {; targetObj} | {; startRange ; endRange} )
> 
> Let me know if you can't get that to work and I'll take a closer look at it.
> 
> HTH
> 
> Pat
> 
> On Wed, 13 Jun 2018 at 07:35, Piotr Chabot Stadhouders via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Hi Pat,
>> 
>> Your tips seem to work, but I am hoping you also know the answer to the
>> next problem.
>> See example 1 : After replacing the text with ST SET
>> TEXT($wp_obj;$text;$start_pos;$end_pos) the cursor must be set after the
>> last inserted character. This replacing is done in the On After Keystroke
>> event of the Write Pro area and is triggered when the user types a space.
>> However, I don't succeed in setting the cursor at the end of the inserted
>> text, it stays at the position where it was (position after the original
>> space)
>> 
>> Do you also have a tip how to set the cursor to a different position in
>> the "On After Keystroke" event of the Pro Area?

WP SELECT is the way to go but, like many things in 4D Write Pro, you need to 
do it in a separate execution cycle (from the ST SET TEXT).

CALL FORM will work in this instance (it doesn't work in most of the instances 
where 4D Write Pro needs to complete the current execution cycle before any new 
changes can be applied).

So, have a separate method to which you pass your 4D Write Pro object and your 
$endpos and run the WP SELECT from there. Call the method after your ST SET 
TEXT using CALL FORM.

J
**
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: Delay process bug

2018-06-17 Thread Justin Carr via 4D_Tech
On 16 Jun 2018, at 12:20 am, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have never had an issue with DELAY PROCESS. Maybe I'm lucky. I don't
> think I've ever used it to delay something more than a matter of seconds,
> though. It would never have occurred to me to DELAY PROCESS for minutes or
> hours.



> The other tool I have for such situations is a really simple stored method
> launcher. It requires 1 table, a background loop (which delays 1 minute)
> and the idea is to create a record for each method that I want to run at
> some interval.

Hi Kirk

Just curious... how do you delay your background loop for a minute without 
using DELAY PROCESS? If you're using it for this then you'll be potentially 
affected by this bug and, as you pointed out, just lucky it hasn't bitten you 
yet.

J
**
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: Build with code signing

2018-06-11 Thread Justin Carr via 4D_Tech
Building on Cannon's code, rather than calling codesign directly with the 
--deep flag we use the shell script that is distributed in the 4D app bundle, 
which takes care of the signing of all of the subcomponents for you. You still 
need to remove the extended attributes first (with xattr -cr) as Cannon does, 
but the codesigning would do something like this instead:

C_BLOB($vX_StdIn;$vX_StdOut;$vX_StdErr)

$vT_AppPath:=Convert path system to POSIX($vT_AppPath)
 //Make sure the path to the app does not end with a path delimiter - this 
breaks the SignApp.sh script
If (Substring($vT_AppPath;Length($vT_AppPath))="/")
$vT_AppPath:=Substring($vT_AppPath;1;Length($vT_AppPath)-1)
End if 

$vT_SignScriptPath:=Convert path system to POSIX(Application 
file+":Contents:Resources:SignApp.sh")

LAUNCH EXTERNAL PROCESS(\
"\""+$vT_SignScriptPath+"\" "+\
"\""+$vT_CertificateName+"\" "+\
"\""+$vT_AppPath+"\"";$vX_StdIn;$vX_StdOut;$vX_StdErr)

Success is determined by:
* OK=1
* last line of $vX_StdErr = $vT_AppPath+": signed @bundle with Mach-O@"
* ERREUR not found in $vX_StdOut



> On 12 Jun 2018, at 3:45 am, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi Jeff,
> 
> I can’t give you a step by step guide, especially including getting the 
> signing certificate. But here is a code snippet which I use for signing my 
> apps which works. The takeaways will be in the comments as well as the two 
> commands that are run using LEP.
> 
> Hopefully that is enough to get you pointed in the right direction.
> 
> P.S. Apple just introduced the idea of notarizing apps at WWDC last week. 
> That will be additional steps and required in the future, but I haven’t tried 
> it yet. Sigh.
> 
> 
> //If on Mac and a certificate is provided, we now code sign the app. Nothing 
> inside the
> //application package should be changed after this point.
> //Use "codesign --verify --verbose /pathtoapp.app" to see if the application 
> signing is still valid.
> //Use "codesign -dv /pathtoapp.app" to get the code signing information.
> //See http://kb.4d.com/assetid=77078 if we need to skip signing certain 
> folders in the future.
> //Also, see 
> http://stackoverflow.com/questions/39652867/code-sign-error-in-macos-sierra-xcode-8-resource-fork-finder-information-or
> //which explains that code signing no longer works with extended attributes 
> on files in the app. It seems easiest to simply
> //use a command to strip all extended attributes before signing. We don't 
> seem to need them anyway.
> If (OS_IsMac =True)
>   $tCertificate:=BuildApp_Hook_MacCodeSign 
>   If ($tCertificate#"")
>   BuildAppP_Log_Action ("Stripping files of extended attributes.")
>   $tCommand:="xattr -cr "+FilePath_ConvertTo (OBJ_Get_Text 
> (voBuildInfo;"PathToBuiltStandaloneApp");kFilePath_LEP)
>   LAUNCH EXTERNAL PROCESS($tCommand;$tIn;$tOut;$tError)  //If 
> error, $tOut will be filled
>   
>   BuildAppP_Log_Action ("Code signing standalone.")
>   $tCommand:="codesign -s \""+$tCertificate+"\" -fv --deep "+\
>   FilePath_ConvertTo (OBJ_Get_Text 
> (voBuildInfo;"PathToBuiltStandaloneApp");kFilePath_LEP)
>   LAUNCH EXTERNAL PROCESS($tCommand;$tIn;$tOut;$tError)  //If 
> error, $tOut will be filled
>   If ($tOut#"")
>   BuildAppP_Log_Action ("Code signing error: "+$tOut;True)
>   End if 
>   End if 
> End if 
> 
> 
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Hill Spring, AB Canada
> 403-626-3236
> 
> 
> 
> 
>> Can someone please direct me to documentation on how to code sign apps for
>> MacOS with 4D.  I need the entire process in a step-by-step guide from
>> explaining how to obtain the code signing certificate from Apple through
>> adding it to the 4D XML build files and building.
> 
> **
> 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
> **

**
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: procedurally delete anchored image in 4D Write Pro

2018-05-23 Thread Justin Carr via 4D_Tech
On 24 May 2018, at 10:01 am, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I think you need to first change the layout to inline (by UI or code), in 
> order to delete an image.
> 
> but the attribute "wk anchor layout" is not settable with WP SET ATTRIBUTES
> http://doc.4d.com/4Dv16R6/4D/16-R6/4D-Write-Pro-Attributes.300-3605889.en.html
> 
> so you need to use INVOKE ACTION instead.
> 
> syntax: anchorLayout?value=inline
> http://doc.4d.com/4Dv16R6/4D/16-R6/Using-4D-Write-Pro-standard-actions.200-3605850.en.html#3610756
> 
> only then can you clear the selected image.

Seems to make no difference to me? The INVOKE ACTION(ak clear;ak current form) 
works regardless of the images being forced inline or left as anchored. The 
main "trick" is that the Write Pro area MUST have the focus, i.e. if you're 
trying to execute this code from a button, then that button must not be 
focussable.

cheers
J
**
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: procedurally delete anchored image in 4D Write Pro

2018-05-23 Thread Justin Carr via 4D_Tech
> On 18 May 2018, at 11:21 pm, Piotr Chabot Stadhouders via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> How can I procedurally delete an anchored image in a 4D Write Pro document?
> 
> I know how to select the image with
> WP SELECT(*;"WParea";$image_object)
> 
> But then what?

Try:

INVOKE ACTION(ak clear;ak current form)

cheers
J
**
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: Find and Replace Component for 4D Write Pro

2018-03-07 Thread Justin Carr via 4D_Tech
On 8 Mar 2018, at 1:46 am, Jeff Grann via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> I had the need to add find and replace to my 4D Write Pro areas. So I created 
> a generic component. It easily shows and hides itself at the top of a Write 
> Pro area and can resize itself automatically. You can download it and a demo 
> at:
> 
> http://www.successware.net/downloads/4d-components/FindAndReplace.zip

Very elegant piece of work, Jeff. Thanks for sharing!

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

Re: 4D 15R5 Feedback

2018-02-27 Thread Justin Carr via 4D_Tech
Hi Sujit

I never dug that deeply into it. Customers who are handling "significant" 
numbers of SOAP requests are crashing intermittently but typically at least 
once every few days. "Significant" is probably in the order of 80+ per minute. 
It was super easy to create a reproducible test database so I didn't do more 
detailed diagnostics. The test case is submitting (on my system) in the order 
of 700 requests per minute, and it would typically crash after 15-20 minutes or 
so.

J

On 28 Feb 2018, at 12:54 pm, Sujit Shah via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Justin,
> 
> Was it the volume of SOAP calls or the frequency that caused the crashes?
> 
> We are clocking around 400 per minute at peak times.
> 
> 
> 
> On Wed, Feb 28, 2018 at 9:39 AM, Justin Carr via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> That one was raised by me but in our case, it is only happening on 32-bit
>> Mac server.
>> 
>> But it's very easy to test. Just create a server application that has
>> nothing at all except for exposing a single web service. That web service
>> does nothing other than return a value of 0. Then from another application
>> fire continual requests at that server.
>> 
>> In my case the server would crash anywhere after 10,000 requests. After
>> using a version containing the fix, on macOS 10.12 the server responded to
>> around 3,000,000 requests before I stopped it. On macOS 10.11 it still
>> crashed but not until sometime after 500,000 requests.
>> 
>> J
>> 
>> On 28 Feb 2018, at 8:29 am, Keisuke Miyako via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>> 
>>> that would be: ACI0097539
>>> 
>>> 
>>> https://bugs.4d.fr/fixedbugslist?branch=16_R6
>>> https://bugs.4d.fr/fixedbugslist?branch=16
>>> 
>>>> 2018/02/28 3:07、Stephen J. Orth via 4D_Tech <4d_tech@lists.4d.com>
>> のメール:
>>>> I recall reading (recently) a fix in V16.3 specifically dealing with a
>> server crash problem due to many SOAP calls.
>>> 
>>> 
>>> 
>>> **
>>> 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
>>> **
>> 
>> **
>> 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
>> **
>> 
> 
> 
> 
> -- 
> 
> xxx
> "There must be ingenuity as well as intention, strategy as well as
> strength. "
> **
> 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
> **

**
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: New Log Parser says : this doesnt make sense

2017-12-01 Thread Justin Carr via 4D_Tech
On 1 Dec 2017, at 5:44 pm, Piotr Chabot Stadhouders via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Hi,
> 
> I am trying to use the new Log Parser, but without success
> 
> First of all, when I start logging I have 10 files of 10MB each within 1 
> minute, but that's not the problem (or is it)
> 
> After loading the log files, I open the Process with the most (+200.000) 
> debug entries.
> After a while a get into a TRACE at the following code :
> 
> (alOpType{$a}<0) // stack level increase // negative operation means closing 
> a previous call TRACE // this doesnt make sense
> 
> Does anybody know what this means?
> Does it point to a problem in My code, or it it a problem of the Log Parser 
> itself?
> 
> Gr,
> 
> Piotr

At a guess I'd say you the parser is reading a close operation for which it 
didn't find an open previously in the logs. This could easily happen if you 
don't have all of the log files for the whole debug session (and if you run 
logging for any length of time and care about disk space you probably won't), 
or if you started logging during an existing process and then started winding 
out of it. In either case it's not really an issue although I don't know if the 
new log parser will then have problems rendering the hierarchical list. The log 
parser I wrote caters for this situation by creating dummy opening calls at the 
appropriate depth(s). These will be given names like "Unlogged call at depth n".

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

Re: 4D Debug Log Reader - Plugin Commands

2017-11-29 Thread Justin Carr via 4D_Tech
On 30 Nov 2017, at 10:41 am, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> to clarify:
> 
> - command number
> 
> the command number explained in this example corresponds to the right side of 
> e.g. "3;1"
> and it can be derived from manifest.json inside the plugin bundle (v14 SDK),
> or a specific resource rsrc inside resources (mac) or RSR adjacent to the 4DX 
> (windows) in legacy architecture.
> 
> - plugin number
> 
> the left side, which was the focus of this thread,
> evidently corresponds to their position in PLUGIN LIST (bumped by the number 
> of preinstalled legacy plugins)
> 
> - plugin ID
> 
> plugins are identified by their name.
> they also have an internal integer ID,
> but they are evidently not used for identification unless the value is lower 
> than 15000.
> 
> - event ID
> 
> sometimes in the log file you see entry point numbers, normally negative,
> which tells which event was process by the plugin.
> they way plugins work is that the scheduler yields to every plugin for every 
> defined event,
> and the plugin may or may not take the opportunity to do something.
> (like form objects, except the plugin does not assert in which set of events 
> it is interested,
> so it is called every time even though it may pass on the majority of events)
> 
> http://sources.4d.com/trac/4d_4dpluginapi/wiki/EntryPoints.h.htm

This is exactly how the Debug Log Reader works, assuming the PLUGIN LIST 
returns the plugins in alphabetical order.

What isn't clear (and I don't expect you to be able to answer) is under what 
circumstances the preinstalled "legacy" plugins come into play. We receive huge 
numbers of log files from our customers and most but not all of the time the 
plugin numbering starts from 3. What the two hidden plugins are and why they 
are loaded in some situtaions and not others is a mystery.

What would be enormously beneficial would be to have the plugin IDs and names 
logged in a separate file wherever the logging is being run, ie. server, client 
or single user.

It would also be extremely helpful if the process info log that gets created on 
the server was also created for clients and single users, given that we don't 
always have logging on the server if we're investigating an issue that 
manifests itself only at the front end.

cheers
J

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

Re: Symlinks in Windows

2017-11-08 Thread Justin Carr via 4D_Tech
On 9 Nov 2017, at 10:19 am, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> On a Mac, when I want apache to front my 4D web server, I create a symlink
> in the Apache document directory to my web folder in the database directory.
> 
> That way, I only have to install and maintain the web folder in one place.
> 
> (The purpose of using apache is to have 4D only deal with database stuff
> and to have apache serve static content.)
> 
> What's the Windows equivalent? Shortcuts don't seem to be it.

MKLINK should do what you're after.

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

Re: LEP - and Batch files

2017-11-08 Thread Justin Carr via 4D_Tech
On 9 Nov 2017, at 4:44 am, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have tried all of the offered suggestions:
> Start ?b
> running without a call to cmd
> \batchfilename\
>  extended this to cover the file paths in the batch file
> 
> none of these result in file copying when started with LEP.
> HOWEVER the batch file contains a redirect of stderr to a disk file, 
> when run though LEP the error file is created.
> The error file is empty... but it is created.
> SO.. LEP is actually executing the batch file, just not doing anything.
> 
> any more ideas??

Hey Chip

What is in the batch file? Are you calling a Windows .exe from the System32 
folder? Don't forget that even if you give a full path to the 
C:\Windows\System32\some.exe on a 64-bit OS from a 32-bit application what will 
actually be run is C:\Windows\SysWOW64\some.exe and there are a lot of exe 
files that *only* exist in the System32 folder, i.e. they don't have a 32-bit 
counterpart.

cheers
J

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

Re: TEXT TO DOCUMENT With Special Characters

2017-08-30 Thread Justin Carr via 4D_Tech
On 31 Aug 2017, at 8:53 am, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I’m having trouble with saving Unicode characters to a file. For example, the 
> following code saves a file to disk:
> 
> C_TEXT($tText;$tFilepath)
> 
> $tText:=“©” //Copyright symbol
> $tFilepath:=System folder(Desktop)+"test.txt"
> TEXT TO DOCUMENT($tFilepath;$tText;UTF8 text without length)
> 
> When I open the file again, it only contains a “?” character.
> 
> If I use:
> 
> TEXT TO DOCUMENT($tFilepath;$tText)
> 
> it saves correctly, but then the file has a BOM character at the beginning 
> which is wreaking havoc with other systems that aren’t expecting it.
> 
> Does anyone know what I should be doing here? Thanks.

Hi Cannon

The first thing I notice is that you are using the old BLOB to text and TEXT TO 
BLOB constant (UTF8 text without length) with the TEXT TO DOCUMENT command. 
This command uses either strings such as "UTF-8" or the corresponding MIBEnum 
ID (the documentation for CONVERT FROM TEXT lists these out). The UTF8 text 
without length constant has a value of 6 which corresponds to ISO-8859-3 using 
MIBEnum IDs.

Also I'm pretty sure if you use TEXT TO DOCUMENT to produce UTF-8 (or any other 
charset that has a BOM specified for it), 4D will insert the BOM in the 
document. So you could use CONVERT FROM TEXT with the "UTF-8" charset to create 
a BLOB (which won't have the BOM) and then BLOB TO DOCUMENT to write the BLOB 
to disk

Regards
Justin

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

Re: 4D Write PRO how to ...

2017-08-21 Thread Justin Carr via 4D_Tech
On 21 Aug 2017, at 9:55 pm, Two Way Communications via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Using the old 4D Write, I loop through all the frames (frames 1-> 7), using 
> ‘WR SET FRAME’ . Then I resolve the expressions.
> This way, all the references in the headers, text frames and footers are 
> resolved before printing.
> 
> I have opened an 4D Write document in 4D Write PRO, and everything is there, 
> including headers and footers.
> 
> However, I can’t find out how to select the headers and footers, so, when I 
> use the command ST FREEZE EXPRESSIONS, and pass the 4D Write PRO area as 
> object, only the references in the text part are resolved. The header keeps 
> showing the references.
> 
> How do I select the header frame in 4D Write PRO?

Hi Rudy

Unfortunately I don't think that is possible yet with 4D Write Pro. It's one of 
the remaining things stopping us from being able to use it.

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

Re: Set_Exists() function: Simple version

2017-07-17 Thread Justin Carr via 4D_Tech
On 17 Jul 2017, at 5:03 pm, Robert Livingston <rlivings...@me.com> wrote:
> 
> 
>> On Jul 16, 2017, at 9:09 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com 
>> <mailto:4d_tech@lists.4d.com>> wrote:
>> 
>> Are you able to provide a link to where the documentation states this?
> 
> I really have to totally retreat here. Talk about faulty memory| When I wrote 
> that note, I was "convinced" that I had just read in the documentation that   
> Is In setreturned an error when the set did not exist.
> 
> Then I went back to find it in the current documentation. No luck.
> 
> I was SO convinced that I had seen this, that I then looked at multiple old 
> versions of the documentation thinking that perhaps it was there but I could 
> not find it anywhere. 

Phew! That's actually a relief for me. I did the same as you, searching back 
through older versions of the language ref, so I was starting to wonder if the 
way I use the documentation set was somehow incomplete/lacking.

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

Re: Set_Exists() function: Simple version

2017-07-16 Thread Justin Carr via 4D_Tech
On 17 Jul 2017, at 5:07 am, Robert Livingston via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> On Jul 14, 2017, at 5:10 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
>> 
>> I was just consolidating some old code and ran across something that I
>> wrote some time back called Set_Exists. No clue. It seems to work, but I
>> can't say why.
> 
> No clue??  I cannot say why?? I am not sure whether this is a joke that I 
> don't get or what.
> 
> It would seem to be fairly clear that the basic logic here is to use the 
> 
> Is in set()Command to test for whether a set exists. The documentation 
> says that if a set does not exist, then this will throw an error. So the code 
> is taking advantage of this

Hi Robert

Are you able to provide a link to where the documentation states this?

> Then he asks us to confirm if the code is reliable. But there are three 
> methods included in the code
> 
> ErrorHandler_Install
> ErrorHandler_SuppressError
> ErrorHandler_InstallPrevious
> 
> that we are not given. How am I supposed to test it?

I think David is asking us to confirm whether trapping for an error on "Is in 
set" is a reliable means for determining whether the set exists. It "seems ok" 
but I wasn't able to find the 4D documentation that asserts that an error is 
thrown if the set doesn't exist. I don't think he necessarily wants us to run 
his code as provided, although given the pretty descriptive names of those 
methods it's not to hard to work out what they do.


> Now I assume that from the names of these methods that basically that if an 
> error occurs that 
> 
> ErrorHandler_SuppressError is called and that this method turns the process 
> variable Error to a number other than zero and that is how you figure out 
> whether the error was thrown and thus whether 
> 
> Is in set()threw an error.

To be fair the Error process variable is a built-in 4D system variable so it 
would be 4D that is setting its value rather than David's error handler. I 
suspect David's method could actually contain nothing, although knowing him it 
probably contains some sort of logging. That said, 4D do suggest copying the 
Error variable into your own process variable if you need to reference it 
outside of the error handler method: 
http://livedoc.4d.com/4D-Language-Reference-16-R3/Interruptions/ON-ERR-CALL.301-3217504.en.html


> For those who might have been confused in the fashion that I was, I would 
> offer this version of what I think David's code is that I think is clearer. 
> You might disagree:
> The method "ErrorIgnore" sets a inter-process variable (<>fErrorHappened) to 
> True

I don't know that the code is necessarily clearer but I would strongly 
discourage the use of an interprocess variable here. You could end up with an 
impossible to debug situation where two or more processes are updating/reading 
the state of this interprocess variable. Error handling is process-specific so 
should really use process-level variables.

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

Re: Array Range Check Issue

2017-07-02 Thread Justin Carr via 4D_Tech
On 1 Jul 2017, at 12:12 am, Stephen J. Orth via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I am getting an array range check error on the following line:
> 
> If (Size of array(as_function)>=1)
> 
> This is a compiled application, so how does this type of error even exist
> for this line?
> 
> The details on the error are blank, it simply says:
> 
>Error when executing the method "Get Data Changes" at line #119
>Array Range Check Error
> 
> Anyone know what might result in this issue?

Hey Steve

Have you initialised the array somewhere in the current process before using it 
here? Having a compiler declaration isn't enough - process level arrays have an 
indeterminate initial state, so Size of array is meaningless until you have 
explicitly initialised it in your code. For this reason all of our new 
processes start with a call to Compiler_Arrays.

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

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Justin Carr via 4D_Tech
On 28 Jun 2017, at 12:01 pm, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Wed, Jun 28, 2017 at 11:54 AM, Wayne Stewart via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Hi,
>> 
>> I did it with help from Dave Batton (so you can imagine how fresh this
>> solution is)!
>> 
>> The way it works is this and you will laugh/wince.
>> 
> 
> Dang, I'm kind of impressed. That's actually a lot easier than a lot of
> solutions would be! I guess that you could set it up to be pretty easy to
> copy and paste between forms and then just tweak it a bit for the target
> object. Hmmm.

Hey David

We do it using ON EVENT CALL to trap the keystrokes. Slightly less clunkier 
than Wayne's approach but to be fair I'm not a huge fan of ON EVENT CALL. Its 
scope is application wide so you need to take care to disable it or uninstall 
it when the window you need it for no longer has the focus. Which way to go 
depends on your particular situation. We use an event handler pretty much 
continuously in our appointments book and we found that it was better to 
enable/disable it (with accessor methods on an IP var) rather than uninstall it 
and re-install it every time the window loses/gains focus. The event handler is 
actually instantiated by 4D as a separate local process so we were creating and 
destroying the process more or less continuously, i.e. every time the user did 
anything other than type a keystroke.

Certainly if 4D were to make it a listbox option we would breathe a little 
easier. :)

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

Re: Programmatically scroll a web area

2017-06-11 Thread Justin Carr via 4D_Tech
We do this all the time and don't see this issue. Mind you we never deployed 
with v15. What works for us with at least v12-14 and v16R2 is to use an 
internal webarea and open a blank URL first before opening the path to the PDF, 
i.e.

WA OPEN URL(*;"webarea_name";"about:blank")
WA OPEN URL(*;"webarea_name";)

This is also using the built-in Preview viewer rather than Adobe or some other 
viewer.

cheers
J

On 12 Jun 2017, at 5:00 am, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Just tried that... no luck. Also tried from a timer that fires shortly after 
> the form loads.
> 
> Jeff
> 
>> On Jun 11, 2017, at 2:49 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
>> 
>> maybe -
>> Post Key - Home or command/control Home 
>> 
>>> Stupid question I hope --
>>> 
>>> I'm displaying a PDF in a web area (4D 15.4/Mac) but the web area 
>>> always scrolls to the end of the document when it initially displays.
>>> 
>>> How can I have it display at the start of the PDF (scroll bar all the 
>>> way to the top)?
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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

Re: How do you force resources to download these days?

2017-06-04 Thread Justin Carr via 4D_Tech
On 5 Jun 2017, at 12:32 pm, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Mon, Jun 5, 2017 at 10:22 AM, Justin Carr via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> NOTIFY RESOURCES FOLDER MODIFICATION
> 
> Thanks J. Hmmm. Added in V11. Hmm. I'm clearly the last to know.
> 
> Any words of wisdom from the field on use of this command in
> multi-developer mode? I'm trying to update constants around the joint.
> Right now I'm doing EXECUTE ON CLIENT and Execute on client to have each
> machine run the right code locally.

I'm pretty sure that's exactly what this command is for. Not sure about 
constants though. I think they only get loaded at startup. So this command will 
probably put them in each developer's Resources folder but they won't see them 
till they restart. If only there was a feature request which asks for a way 
around this... :)

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

Re: How do you force resources to download these days?

2017-06-04 Thread Justin Carr via 4D_Tech
On 5 Jun 2017, at 9:50 am, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Grrr. Didn't figure out how to find this in the docs. There used to be a
> tickbox.

Could be but I don't think I ever used it. We just run a method with the EOS 
bit checked which contains the NOTIFY RESOURCES FOLDER MODIFICATION command. 
That's been pretty solid.

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