Re: Extra characters

2018-07-03 Thread Robert McKeever via 4D_Tech
Thanks, John.

> On Jul 3, 2018, at 8:48 PM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 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
> **

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.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: 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
**

Extra characters

2018-07-03 Thread Robert McKeever via 4D_Tech
4D V15, on a Mac. Once this works, the PC version is next.

I have nine text files that contain java scripts. They contain the users 
password (not my idea). The health authority has decided that each site (maybe 
45+ users) must change their passwords. So, I did the following:

$MyRawDoc:=Document to text($MyDocs1{$n};"UTF-8";0)
$MyReplacedDoc:=Replace string($MyRawDoc;$OldPassword;$NewPassword)
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?

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.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: Application Metrics

2018-07-03 Thread Jody Bevan via 4D_Tech
Taking you back to JonokeMed days Dani circa ~ 2010. Jonoke did all of that so 
we could know what was used or not. I used the results a lot.

Jody


> On Jul 3, 2018, at 2:17 PM, Dani Beaubien via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Probably the easiest way to do this is to create a new table and and create a 
> new row per event. Easy to conceptualize and easy to implement. And you can 
> then run queries against it easily.
> 
> For feature requests, it can help if you know that a feature request is being 
> made against an area that is almost never used vs a feature request that is 
> made against an area that is heavily used. It helps with the assessment of 
> priority and potential impacts.
> 
> Dani
> 
>> On Jul 3, 2018, at 2:09 PM, Robert ListMail  wrote:
>> 
>> Dani, how might the app be reporting this data back to the mothership? 
>> Imagine, 4D client server not a web app. 
>> 
>> Also, how would this help with feature requests...? Wouldn’t you need the 
>> feature available to the user before you could track it?
>> 
>> Thanks,
>> 
>> Rob
>> 
>> Sent from my iPhone
>> 
>>> On Jul 3, 2018, at 2:07 PM, Dani Beaubien 
>>>  wrote:
>>> 
>>> This kind of information can really help you understand what aspects of the 
>>> program are being used and those that are not. Really helps when you are 
>>> trying to work through a long list of feature requests.
>> 

**
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: problems with SEND RECORD

2018-07-03 Thread Noah via 4D_Tech
Many thanks, that was a silly oversight, explicitly saving to and moving to
the next record in the Approvals table fixes the problem.
I appreciate the suggestions for more efficient code!

On Tue, Jul 3, 2018 at 3:52 PM npdennis  wrote:

>
>
>  // THIS DOESN'T work! it approves the records but does append to the log
>
>
>
> Try this loop instead, you need a save record in the loop, and since you
> are saving each you don’t need the apply to selection and first record… the
> loop below will take less execution time and only modify the records once:
>
>
>
> CONFIRM(Current user+": Are you sure you want to approve these"+\
> String($selectedCount)+"records?";"Approve";"Don't Approve")
>
> If (OK=1)
>   For ($i;1;$selectedCount)
> [Approvals]approved_by:=Current user+" (4D Client)"
> [Approvals]approved_date:=Current date(*)
> [Approvals]notes:=[Approvals]notes+Char(13)+txtApprovalNotes
> [Approvals]log:=[Approvals]log+"4D client ("+Current user+") approved
> this record on"+\
> String(Current time(*))+" "+\
> String(Current date(*);" | Short")+Char(13)
> [Approvals];[Approvals]approved:=True
>
> SAVE RECORD([Approvals])
> NEXT RECORD([Approvals])
>   End for
> Else
>   ALERT("Operation canceled.")
> End if
>
>
>
>
>
>
>
> On Jul 3, 2018, at 4:00 PM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote:
>
> Thank you all for the quick feedback!
>
> The approvals table has all records with Approved defaulting to False.
> The problem was with not including Set Channel (which is not really what I
> wanted to be doing anyways). I must have taken a fork in the road (while
> reading the documentation this morning) which lead to a place I should not
> have been.
>
> First problem was that looping over records in selection was not limiting
> it to one record inside the loop.
>
> http://doc.4d.com/4Dv15/4D/15.6/Records-in-selection.301-3817584.en.html
>
> When I tried an alternate approach, I ended up looking at sockets
>
> Here is a snippet from the original code that I was trying to get working:
>
> CONFIRM(Current user+": Are you sure you want to approve these
> "+String($selectedCount)+" records?";"Approve";"Don't Approve")
>
> If (OK=1)
> APPLY TO SELECTION([Approvals];[Approvals]approved:=True)
>
> FIRST RECORD([Approvals])
>
>  // THIS DOESN'T work! it approves the records but does append to the log
> of each record
> For ($i;1;$selectedCount)
>  [Approvals]approved_by:=Current user+" (4D Client)"
>  [Approvals]approved_date:=Current date(*)
>
>  $current_notes:=[Approvals]notes
>  [Approvals]notes:=$current_notes+Char(13)+txtApprovalNotes
>
>  $sTime_Stamp:=String(Current time(*))+" "+String(Current date(*);"|Short")
>  $new_line:="4D client ("+Current user+") approved this record on
> "+$sTime_Stamp+Char(13)
>  $current_log:=[Approvals]log
>  [Approvals]log:=$new_line+$current_log
>  NEXT RECORD
> End for
> Else
> ALERT("Operation canceled.")
> End if
>
>
> txtApprovalNotes is the name of a text entry field on the form.
> **
> 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: problems with SEND RECORD

2018-07-03 Thread npdennis via 4D_Tech


>  // THIS DOESN'T work! it approves the records but does append to the log


Try this loop instead, you need a save record in the loop, and since you are 
saving each you don’t need the apply to selection and first record… the loop 
below will take less execution time and only modify the records once:



CONFIRM(Current user+": Are you sure you want to approve these"+\
String($selectedCount)+"records?";"Approve";"Don't Approve")

If (OK=1)
  For ($i;1;$selectedCount)
[Approvals]approved_by:=Current user+" (4D Client)"
[Approvals]approved_date:=Current date(*)
[Approvals]notes:=[Approvals]notes+Char(13)+txtApprovalNotes
[Approvals]log:=[Approvals]log+"4D client ("+Current user+") approved this 
record on"+\
String(Current time(*))+" "+\
String(Current date(*);" | Short")+Char(13)
[Approvals];[Approvals]approved:=True

SAVE RECORD([Approvals])
NEXT RECORD([Approvals])
  End for 
Else 
  ALERT("Operation canceled.")
End if 







> On Jul 3, 2018, at 4:00 PM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Thank you all for the quick feedback!
> 
> The approvals table has all records with Approved defaulting to False.
> The problem was with not including Set Channel (which is not really what I
> wanted to be doing anyways). I must have taken a fork in the road (while
> reading the documentation this morning) which lead to a place I should not
> have been.
> 
> First problem was that looping over records in selection was not limiting
> it to one record inside the loop.
> 
> http://doc.4d.com/4Dv15/4D/15.6/Records-in-selection.301-3817584.en.html
> 
> When I tried an alternate approach, I ended up looking at sockets
> 
> Here is a snippet from the original code that I was trying to get working:
> 
> CONFIRM(Current user+": Are you sure you want to approve these
> "+String($selectedCount)+" records?";"Approve";"Don't Approve")
> 
> If (OK=1)
> APPLY TO SELECTION([Approvals];[Approvals]approved:=True)
> 
> FIRST RECORD([Approvals])
> 
>  // THIS DOESN'T work! it approves the records but does append to the log
> of each record
> For ($i;1;$selectedCount)
>  [Approvals]approved_by:=Current user+" (4D Client)"
>  [Approvals]approved_date:=Current date(*)
> 
>  $current_notes:=[Approvals]notes
>  [Approvals]notes:=$current_notes+Char(13)+txtApprovalNotes
> 
>  $sTime_Stamp:=String(Current time(*))+" "+String(Current date(*);"|Short")
>  $new_line:="4D client ("+Current user+") approved this record on
> "+$sTime_Stamp+Char(13)
>  $current_log:=[Approvals]log
>  [Approvals]log:=$new_line+$current_log
>  NEXT RECORD
> End for
> Else
> ALERT("Operation canceled.")
> End if
> 
> 
> txtApprovalNotes is the name of a text entry field on the form.
> **
> 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: problems with SEND RECORD

2018-07-03 Thread Robert McKeever via 4D_Tech
You need to save each record:

[Approvals]log:=$new_line+$current_log
SAVE RECORD([Approvals])
NEXT RECORD

and, of note, just a bare NEXT RECORD command assume that [Approvals] is the 
default table. It might not be.

> On Jul 3, 2018, at 3:00 PM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Thank you all for the quick feedback!
> 
> The approvals table has all records with Approved defaulting to False.
> The problem was with not including Set Channel (which is not really what I
> wanted to be doing anyways). I must have taken a fork in the road (while
> reading the documentation this morning) which lead to a place I should not
> have been.
> 
> First problem was that looping over records in selection was not limiting
> it to one record inside the loop.
> 
> http://doc.4d.com/4Dv15/4D/15.6/Records-in-selection.301-3817584.en.html
> 
> When I tried an alternate approach, I ended up looking at sockets
> 
> Here is a snippet from the original code that I was trying to get working:
> 
> CONFIRM(Current user+": Are you sure you want to approve these
> "+String($selectedCount)+" records?";"Approve";"Don't Approve")
> 
> If (OK=1)
> APPLY TO SELECTION([Approvals];[Approvals]approved:=True)
> 
> FIRST RECORD([Approvals])
> 
>  // THIS DOESN'T work! it approves the records but does append to the log
> of each record
> For ($i;1;$selectedCount)
>  [Approvals]approved_by:=Current user+" (4D Client)"
>  [Approvals]approved_date:=Current date(*)
> 
>  $current_notes:=[Approvals]notes
>  [Approvals]notes:=$current_notes+Char(13)+txtApprovalNotes
> 
>  $sTime_Stamp:=String(Current time(*))+" "+String(Current date(*);"|Short")
>  $new_line:="4D client ("+Current user+") approved this record on
> "+$sTime_Stamp+Char(13)
>  $current_log:=[Approvals]log
>  [Approvals]log:=$new_line+$current_log
>  NEXT RECORD
> End for
> Else
> ALERT("Operation canceled.")
> End if
> 
> 
> txtApprovalNotes is the name of a text entry field on the form.
> **
> 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
> **

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.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: problems with SEND RECORD

2018-07-03 Thread Noah via 4D_Tech
Thank you all for the quick feedback!

The approvals table has all records with Approved defaulting to False.
The problem was with not including Set Channel (which is not really what I
wanted to be doing anyways). I must have taken a fork in the road (while
reading the documentation this morning) which lead to a place I should not
have been.

First problem was that looping over records in selection was not limiting
it to one record inside the loop.

http://doc.4d.com/4Dv15/4D/15.6/Records-in-selection.301-3817584.en.html

When I tried an alternate approach, I ended up looking at sockets

Here is a snippet from the original code that I was trying to get working:

CONFIRM(Current user+": Are you sure you want to approve these
"+String($selectedCount)+" records?";"Approve";"Don't Approve")

If (OK=1)
APPLY TO SELECTION([Approvals];[Approvals]approved:=True)

FIRST RECORD([Approvals])

  // THIS DOESN'T work! it approves the records but does append to the log
of each record
For ($i;1;$selectedCount)
  [Approvals]approved_by:=Current user+" (4D Client)"
  [Approvals]approved_date:=Current date(*)

  $current_notes:=[Approvals]notes
  [Approvals]notes:=$current_notes+Char(13)+txtApprovalNotes

  $sTime_Stamp:=String(Current time(*))+" "+String(Current date(*);"|Short")
  $new_line:="4D client ("+Current user+") approved this record on
"+$sTime_Stamp+Char(13)
  $current_log:=[Approvals]log
  [Approvals]log:=$new_line+$current_log
  NEXT RECORD
End for
Else
ALERT("Operation canceled.")
End if


txtApprovalNotes is the name of a text entry field on the form.
**
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: Quitting without IP var?

2018-07-03 Thread Chip Scheide via 4D_Tech
I see what you are saying, I will look at that as an alternative. Thanks
however...

the method called from exiting the program (menu_Quit)
runs the loop over the processes 

For count processes
  resume process
  call process

BEFORE calling Quit 4D, to allow all the processes to complete whatever 
action(s) they may be doing BEFORE actually quitting.
The menu_Quit method also writes info to disk, and closes log files and 
a bunch of other cleanup before actually quitting.


On Tue, 3 Jul 2018 14:11:49 -0600, Dani Beaubien wrote:
> Chip, 
> 
> Here is the documentation for “Process Aborted”:
> The Process aborted command returns True if the process in which it 
> is called is about to be interrupted unexpectedly, which means that 
> the execution of the command was unable to reach its “normal” 
> completion. For example, this can occur after calling QUIT 4D 
> .
> 
> What I am trying to point out is that “QUIT 4D” causes “Process 
> Aborted” to return true.  So using the following code might work for 
> you.
> 
> Repeat
> // do deamon stuff
> until (Process Aborted)
> 
> Dani
> 
> 
>> On Jul 3, 2018, at 1:40 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
>> 
>> Dani,
>> a 'Deamon" - a unix/linux term I believe - is a piece of code which 
>> once started does a task and then goes to sleep for a while then wakes 
>> up and does the task again.
>> for example, watching a specific folder for additions, then processing 
>> the 'new' files.
>> 
>> These tasks do not not normally exit. (see repeat loop below), and run 
>> for the entire duration of the session. However, up on quitting it is 
>> often useful/nice/best practice to exit these forever loops in a 
>> controlled manner, rather then have 4D simply quit. Additionally it is 
>> possible that one or more of the deamons are in the middle of doing 
>> their assigned task, and exiting could result in an incomplete task. 
>> So.. a flag, in my case an IP var (<>f_Quit) is used to signal that all 
>> actions should be wrapped up before the code exists.
>> 
>> The exiting code looks something like this (below written in email):
>> // Quit_method
>> <>f_Quit:=true
>> for ($i;1;count processes)
>>  resume process($i)
>>  call process($i)
>> end for
>> 
>> 
>> On Tue, 3 Jul 2018 13:27:14 -0600, Dani Beaubien wrote:
>>> Have you looked at the 4d command "Process aborted”?
>>> 
>>> 
 On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech 
 <4d_tech@lists.4d.com> wrote:
 
 My Question is:
 How are you signaling to your stored procedures (Deamons) that the user 
 is existing, without using an IP var?
 
 Currently I am using an IP Var which is set in the Quit method.
 This IP var is referenced in all of my 'Deamons' in a repeat loop
 
 Repeat
 // do deamon stuff
 until (<>f_Quit)
 
 With this IP var sitting in all my deamons - this makes all of that 
 code thread unsafe.
 I would like to re-work this code to b more multiprocessor friendly.
 
 Thanks
 Chip
 
 ---
 Gas is for washing parts
 Alcohol is for drinkin'
 Nitromethane is for racing 
 **
 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
 **
>>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
> 
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: problems with SEND RECORD

2018-07-03 Thread Chuck Miller via 4D_Tech
OK If you are going to do this, why not go all the way

C_LonGINT($RECORDSINTABLE;$ALLRECORDS;$NOTAPPROVED;$APPROVED)
$RECORDSINTABLE:=RECORDS IN TABLE([Approvals])
> ALL RECORDS([Approvals])
> ALLRECORDS:= Records in selection([Approvals])
SET QUERY DESTINATION(INTO VARIABLE;$NOTAPPROVED)
QUERY([Approvals];[Approvals]APPROVED=FALSE)
SET QUERY DESTINATION(INTO VARIABLE;$APPROVED)
QUERY([Approvals];[Approvals]APPROVED=TRUE)
Now compare results
also if boolean is indexed, I might drop and then read that index, before 
running queries
regards
 chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Jul 3, 2018, at 3:12 PM, Jeremy French via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> ALL RECORDS([Approvals])
> $count_all := Records in selection([Approvals])
> 
> QUERY([Approvals];[Approvals]approved=False)
> $count_query := Records in selection([Approvals])
> 
> Are the two counts equal?

**
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: Application Metrics

2018-07-03 Thread Dani Beaubien via 4D_Tech
Probably the easiest way to do this is to create a new table and and create a 
new row per event. Easy to conceptualize and easy to implement. And you can 
then run queries against it easily.

For feature requests, it can help if you know that a feature request is being 
made against an area that is almost never used vs a feature request that is 
made against an area that is heavily used. It helps with the assessment of 
priority and potential impacts.

Dani

> On Jul 3, 2018, at 2:09 PM, Robert ListMail  wrote:
> 
> Dani, how might the app be reporting this data back to the mothership? 
> Imagine, 4D client server not a web app. 
> 
> Also, how would this help with feature requests...? Wouldn’t you need the 
> feature available to the user before you could track it?
> 
> Thanks,
> 
> Rob
> 
> Sent from my iPhone
> 
>> On Jul 3, 2018, at 2:07 PM, Dani Beaubien 
>>  wrote:
>> 
>> This kind of information can really help you understand what aspects of the 
>> program are being used and those that are not. Really helps when you are 
>> trying to work through a long list of feature requests.
> 

**
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: Quitting without IP var?

2018-07-03 Thread Dani Beaubien via 4D_Tech
Chip, 

Here is the documentation for “Process Aborted”:
The Process aborted command returns True if the process in which it is called 
is about to be interrupted unexpectedly, which means that the execution of the 
command was unable to reach its “normal” completion. For example, this can 
occur after calling QUIT 4D 
.

What I am trying to point out is that “QUIT 4D” causes “Process Aborted” to 
return true.  So using the following code might work for you.

Repeat
// do deamon stuff
until (Process Aborted)

Dani


> On Jul 3, 2018, at 1:40 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> Dani,
> a 'Deamon" - a unix/linux term I believe - is a piece of code which 
> once started does a task and then goes to sleep for a while then wakes 
> up and does the task again.
> for example, watching a specific folder for additions, then processing 
> the 'new' files.
> 
> These tasks do not not normally exit. (see repeat loop below), and run 
> for the entire duration of the session. However, up on quitting it is 
> often useful/nice/best practice to exit these forever loops in a 
> controlled manner, rather then have 4D simply quit. Additionally it is 
> possible that one or more of the deamons are in the middle of doing 
> their assigned task, and exiting could result in an incomplete task. 
> So.. a flag, in my case an IP var (<>f_Quit) is used to signal that all 
> actions should be wrapped up before the code exists.
> 
> The exiting code looks something like this (below written in email):
> // Quit_method
> <>f_Quit:=true
> for ($i;1;count processes)
>  resume process($i)
>  call process($i)
> end for
> 
> 
> On Tue, 3 Jul 2018 13:27:14 -0600, Dani Beaubien wrote:
>> Have you looked at the 4d command "Process aborted”?
>> 
>> 
>>> On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> My Question is:
>>> How are you signaling to your stored procedures (Deamons) that the user 
>>> is existing, without using an IP var?
>>> 
>>> Currently I am using an IP Var which is set in the Quit method.
>>> This IP var is referenced in all of my 'Deamons' in a repeat loop
>>> 
>>> Repeat
>>> // do deamon stuff
>>> until (<>f_Quit)
>>> 
>>> With this IP var sitting in all my deamons - this makes all of that 
>>> code thread unsafe.
>>> I would like to re-work this code to b more multiprocessor friendly.
>>> 
>>> Thanks
>>> Chip
>>> 
>>> ---
>>> Gas is for washing parts
>>> Alcohol is for drinkin'
>>> Nitromethane is for racing 
>>> **
>>> 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
>>> **
>> 
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 

**
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: Application Metrics

2018-07-03 Thread Robert ListMail via 4D_Tech
Tom, can you give us an idea what/how this data is tabulated and how it’s 
reported back to you?

Thanks,

Rob

Sent from my iPhone

> On Jul 3, 2018, at 3:07 PM, Benedict, Tom  wrote:
> 
> We don’t keep track of features used, but we do keep track of performance 
> metrics, mostly around system response, transaction counts and concurrent 
> user counts. Feature use would be a great addition.
> 
>  
> 
> Tom Benedict
> 
> Optum
**
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: Application Metrics

2018-07-03 Thread Robert ListMail via 4D_Tech
Dani, how might the app be reporting this data back to the mothership? Imagine, 
4D client server not a web app. 

Also, how would this help with feature requests...? Wouldn’t you need the 
feature available to the user before you could track it?

Thanks,

Rob

Sent from my iPhone

> On Jul 3, 2018, at 2:07 PM, Dani Beaubien  
> wrote:
> 
> This kind of information can really help you understand what aspects of the 
> program are being used and those that are not. Really helps when you are 
> trying to work through a long list of feature requests.

**
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: Application Metrics

2018-07-03 Thread Benedict, Tom via 4D_Tech
Robert writes:

> in your 4D applications are you tracking usage levels of any kind? I suppose 
> it
>would be useful to know what features are heavily used and which are almost
>never used. What metrics does your system collect that you've found useful?

We don't keep track of features used, but we do keep track of performance 
metrics, mostly around system response, transaction counts and concurrent user 
counts. Feature use would be a great addition.

Tom Benedict
Optum
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**
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: Quitting without IP var?

2018-07-03 Thread Stephen J. Orth via 4D_Tech
Chip,

My thoughts exactly...


Steve

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip Scheide 
via 4D_Tech
Sent: Tuesday, July 03, 2018 2:56 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Chip Scheide <4d_o...@pghrepository.org>
Subject: Re: Quitting without IP var?

so.. an IP var in an object  :)

Thanks!


**
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: Application Metrics

2018-07-03 Thread Robert ListMail via 4D_Tech
Thanks Dani, that’s very helpful. 

Rob

Sent from my iPhone

> On Jul 3, 2018, at 2:07 PM, Dani Beaubien  
> wrote:
> 
> Hi Robert, since you are talking about usage patterns I suggest you approach 
> it from the actions that your user’s are performing.

**
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: Quitting without IP var?

2018-07-03 Thread Chip Scheide via 4D_Tech
so.. an IP var in an object  :)

Thanks!


On Tue, 3 Jul 2018 14:33:15 -0500, Keith Culotta via 4D_Tech wrote:
> If using v17, shared Storage solves the problem.  It takes the place 
> of IP vars.
> 
http://livedoc.4d.com/4D-Language-Reference-17/Objects-Language/Storage.301-3730714.en.html
> 
>   // 
>   // Method: setQuit
>   // INPUT1: Boolean - Quit? 
>   // 
> C_BOOLEAN($1)
> 
> Use (Storage)
>   Storage.base:=New shared object
>   Use (Storage.base)
>   Storage.base.FQUIT:=$1
>   End use 
> End use 
> 
> 
>   // 
>   // Elsewhere...
>   // 
> Repeat 
> // do deamon stuff
> Until (Storage.base.FQUIT)
> 
> Keith - CDI
> 
> 
> 
>> On Jul 3, 2018, at 2:27 PM, Dani Beaubien via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Have you looked at the 4d command "Process aborted”?
>> 
>> 
>>> On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> My Question is:
>>> How are you signaling to your stored procedures (Deamons) that the user 
>>> is existing, without using an IP var?
>>> 
>>> Currently I am using an IP Var which is set in the Quit method.
>>> This IP var is referenced in all of my 'Deamons' in a repeat loop
>>> 
>>> Repeat
>>> // do deamon stuff
>>> until (<>f_Quit)
>>> 
>>> With this IP var sitting in all my deamons - this makes all of that 
>>> code thread unsafe.
>>> I would like to re-work this code to b more multiprocessor friendly.
>>> 
>>> Thanks
>>> Chip
>>> 
>>> ---
>>> Gas is for washing parts
>>> Alcohol is for drinkin'
>>> Nitromethane is for racing 
>>> **
>>> 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
>> **
> 
> **
> 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
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: Quitting without IP var?

2018-07-03 Thread Chip Scheide via 4D_Tech
Dani,
a 'Deamon" - a unix/linux term I believe - is a piece of code which 
once started does a task and then goes to sleep for a while then wakes 
up and does the task again.
for example, watching a specific folder for additions, then processing 
the 'new' files.

These tasks do not not normally exit. (see repeat loop below), and run 
for the entire duration of the session. However, up on quitting it is 
often useful/nice/best practice to exit these forever loops in a 
controlled manner, rather then have 4D simply quit. Additionally it is 
possible that one or more of the deamons are in the middle of doing 
their assigned task, and exiting could result in an incomplete task. 
So.. a flag, in my case an IP var (<>f_Quit) is used to signal that all 
actions should be wrapped up before the code exists.

The exiting code looks something like this (below written in email):
// Quit_method
<>f_Quit:=true
for ($i;1;count processes)
  resume process($i)
  call process($i)
end for


On Tue, 3 Jul 2018 13:27:14 -0600, Dani Beaubien wrote:
> Have you looked at the 4d command "Process aborted”?
> 
> 
>> On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> My Question is:
>> How are you signaling to your stored procedures (Deamons) that the user 
>> is existing, without using an IP var?
>> 
>> Currently I am using an IP Var which is set in the Quit method.
>> This IP var is referenced in all of my 'Deamons' in a repeat loop
>> 
>> Repeat
>>  // do deamon stuff
>> until (<>f_Quit)
>> 
>> With this IP var sitting in all my deamons - this makes all of that 
>> code thread unsafe.
>> I would like to re-work this code to b more multiprocessor friendly.
>> 
>> Thanks
>> Chip
>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> **
>> 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
>> **
> 
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: Quitting without IP var?

2018-07-03 Thread Keith Culotta via 4D_Tech
If using v17, shared Storage solves the problem.  It takes the place of IP vars.
http://livedoc.4d.com/4D-Language-Reference-17/Objects-Language/Storage.301-3730714.en.html

  // 
  // Method: setQuit
  // INPUT1: Boolean - Quit? 
  // 
C_BOOLEAN($1)

Use (Storage)
Storage.base:=New shared object
Use (Storage.base)
Storage.base.FQUIT:=$1
End use 
End use 


  // 
  // Elsewhere...
  // 
Repeat 
  // do deamon stuff
Until (Storage.base.FQUIT)

Keith - CDI



> On Jul 3, 2018, at 2:27 PM, Dani Beaubien via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Have you looked at the 4d command "Process aborted”?
> 
> 
>> On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> My Question is:
>> How are you signaling to your stored procedures (Deamons) that the user 
>> is existing, without using an IP var?
>> 
>> Currently I am using an IP Var which is set in the Quit method.
>> This IP var is referenced in all of my 'Deamons' in a repeat loop
>> 
>> Repeat
>> // do deamon stuff
>> until (<>f_Quit)
>> 
>> With this IP var sitting in all my deamons - this makes all of that 
>> code thread unsafe.
>> I would like to re-work this code to b more multiprocessor friendly.
>> 
>> Thanks
>> Chip
>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> **
>> 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
> **

**
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: Quitting without IP var?

2018-07-03 Thread Dani Beaubien via 4D_Tech
Have you looked at the 4d command "Process aborted”?


> On Jul 3, 2018, at 1:18 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> My Question is:
> How are you signaling to your stored procedures (Deamons) that the user 
> is existing, without using an IP var?
> 
> Currently I am using an IP Var which is set in the Quit method.
> This IP var is referenced in all of my 'Deamons' in a repeat loop
> 
> Repeat
>  // do deamon stuff
> until (<>f_Quit)
> 
> With this IP var sitting in all my deamons - this makes all of that 
> code thread unsafe.
> I would like to re-work this code to b more multiprocessor friendly.
> 
> Thanks
> Chip
> 
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 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
**

Quitting without IP var?

2018-07-03 Thread Chip Scheide via 4D_Tech
My Question is:
How are you signaling to your stored procedures (Deamons) that the user 
is existing, without using an IP var?

Currently I am using an IP Var which is set in the Quit method.
This IP var is referenced in all of my 'Deamons' in a repeat loop

Repeat
  // do deamon stuff
until (<>f_Quit)

With this IP var sitting in all my deamons - this makes all of that 
code thread unsafe.
I would like to re-work this code to b more multiprocessor friendly.

Thanks
Chip

---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: problems with SEND RECORD

2018-07-03 Thread Jeremy French via 4D_Tech
Since you encountering more records than expected, do all records in the table 
“Approval” have False assigned assigned to the field “approved”?

Try this in your method:

ALL RECORDS([Approvals])
$count_all := Records in selection([Approvals])

QUERY([Approvals];[Approvals]approved=False)
$count_query := Records in selection([Approvals])

Are the two counts equal?


> On Jul 3, 2018, at 12:48 PM, Noah via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> … Stepping through the code I
> could see that where we were supposed to be looping over the records in the
> current selection, we were instead dealing with the whole selection.
> 
> QUERY([Approvals];[Approvals]approved=False)

**
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: Application Metrics

2018-07-03 Thread Dani Beaubien via 4D_Tech
Hi Robert, since you are talking about usage patterns I suggest you approach it 
from the actions that your user’s are performing. This can help you understand 
what the users are doing most along with some context.

A good place to start would be to track every time the user
- Selects a menu item
- Adds a new record
- Edits a record
- Runs a report
- Performs a search (f you have a custom search it can be useful to track which 
search terms are used).

If you have admin users and regular users that can be helpful as well to track 
along with the actions.

This kind of information can really help you understand what aspects of the 
program are being used and those that are not. Really helps when you are trying 
to work through a long list of feature requests.

Also, if your app is a web app, adding Google analytics (or something similar) 
is a very easy way to add page tracking.

Dani


> On Jul 3, 2018, at 12:55 PM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I just learned that Facebook is getting rid of a few apps, partially based on 
> low usage. So, in your 4D applications are you tracking usage levels of any 
> kind? I suppose it would be useful to know what features are heavily used and 
> which are almost never used. What metrics does your system collect that 
> you’ve found useful?
> 
> Thanks,
> 
> Robert
> 
> Sent from my iPhone
> **
> 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
**

Application Metrics

2018-07-03 Thread Robert ListMail via 4D_Tech
I just learned that Facebook is getting rid of a few apps, partially based on 
low usage. So, in your 4D applications are you tracking usage levels of any 
kind? I suppose it would be useful to know what features are heavily used and 
which are almost never used. What metrics does your system collect that you’ve 
found useful?

Thanks,

Robert

Sent from my iPhone
**
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: problems with SEND RECORD

2018-07-03 Thread Charles Miller via 4D_Tech
There are other issues with this loop. You must for example make sure
record is loaded and table is set to read/write. before doing something. I
have seen code where programnmer didn’t  load record and it was locked
somewhere else. Thios causes all types of problems. I always for my for
loops like this to go through records
for ($loop; 1 records in selection[table]))
goto selected record (table;$loop)
lad record(table)
do stuff
save record([table])
unoad record ([table])
end for

On Tue, Jul 3, 2018 at 1:28 PM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> as noted elsewhere:
> for Send Record to do anything (and not give the error your have
> mentioned) you have to have opened/created a file on disk with Set
> Channel.
>
> However, it is possible that there was a typo somewhere, and what you
> are trying to do is to manipulate the record (do something with the
> record)
> and then SAVE the change(s).  In that case, you are using the wrong
> command, and instead of Send Record, you should be using Save Record.
> Save Record will save, whatever changes to the record data occurred
> during the // Do something with the record part of the code.
>
>
> QUERY([Approvals];[Approvals]approved=False)
>
>  // loop through the selection of Approvals
> For ($vlRecord;1;Records in selection([Approvals]))
>  // Do something with the record
>
>  SAVE RECORD([Approvals])// Save the record <
>
>  NEXT RECORD([Approvals])   // Go to the next record
> End for
>
>
> On Tue, 3 Jul 2018 09:48:08 -0700, Noah via 4D_Tech wrote:
> > Good morning!
> > I work with a large codebase that has had many developers over the years.
> > Consequently, when building something new, I will sometimes look to see
> how
> > something was done previously. More often it has been the case that I
> will
> > go straight to the documentation to see the currently recommended 4D
> > approach to the issue.
> >
> > Today I was looking at capturing the 'approval of selected records'.
> > Selected is a boolean value in the database. Stepping through the code I
> > could see that where we were supposed to be looping over the records in
> the
> > current selection, we were instead dealing with the whole selection.
> > Stepping back from the context of the application, I created a scratchpad
> > sort of method, which contains a simple query and a code snippet directly
> > from the documentation.
> >
> > The 4th basic example in on this page:
> > http://doc.4d.com/4Dv15/4D/15.6/ForEnd-for.300-3818649.en.html produces
> an
> > -28 communication error after trying to SEND RECORD.
> >
> >
> > QUERY([Approvals];[Approvals]approved=False)
> >
> >
> > FIRST RECORD([Approvals])
> >
> > For ($vlRecord;1;Records in selection([Approvals]))
> >
> >   // Do something with the record
> >
> > SEND RECORD([Approvals])
> >
> >   // ...
> >
> >   // Go to the next record
> >
> > NEXT RECORD([Approvals])
> >
> > End for
> >
> >
> > Am I missing something in my understanding of looping over records?
> > **
> > 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
> > **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 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
> **




-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.

Re: problems with SEND RECORD

2018-07-03 Thread Chip Scheide via 4D_Tech
as noted elsewhere:
for Send Record to do anything (and not give the error your have 
mentioned) you have to have opened/created a file on disk with Set 
Channel.

However, it is possible that there was a typo somewhere, and what you 
are trying to do is to manipulate the record (do something with the 
record)
and then SAVE the change(s).  In that case, you are using the wrong 
command, and instead of Send Record, you should be using Save Record.
Save Record will save, whatever changes to the record data occurred 
during the // Do something with the record part of the code.


QUERY([Approvals];[Approvals]approved=False)

 // loop through the selection of Approvals
For ($vlRecord;1;Records in selection([Approvals]))
 // Do something with the record

 SAVE RECORD([Approvals])// Save the record <

 NEXT RECORD([Approvals])   // Go to the next record
End for


On Tue, 3 Jul 2018 09:48:08 -0700, Noah via 4D_Tech wrote:
> Good morning!
> I work with a large codebase that has had many developers over the years.
> Consequently, when building something new, I will sometimes look to see how
> something was done previously. More often it has been the case that I will
> go straight to the documentation to see the currently recommended 4D
> approach to the issue.
> 
> Today I was looking at capturing the 'approval of selected records'.
> Selected is a boolean value in the database. Stepping through the code I
> could see that where we were supposed to be looping over the records in the
> current selection, we were instead dealing with the whole selection.
> Stepping back from the context of the application, I created a scratchpad
> sort of method, which contains a simple query and a code snippet directly
> from the documentation.
> 
> The 4th basic example in on this page:
> http://doc.4d.com/4Dv15/4D/15.6/ForEnd-for.300-3818649.en.html produces an
> -28 communication error after trying to SEND RECORD.
> 
> 
> QUERY([Approvals];[Approvals]approved=False)
> 
> 
> FIRST RECORD([Approvals])
> 
> For ($vlRecord;1;Records in selection([Approvals]))
> 
>   // Do something with the record
> 
> SEND RECORD([Approvals])
> 
>   // ...
> 
>   // Go to the next record
> 
> NEXT RECORD([Approvals])
> 
> End for
> 
> 
> Am I missing something in my understanding of looping over records?
> **
> 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
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: problems with SEND RECORD

2018-07-03 Thread Charles Miller via 4D_Tech
did you use open channel before the send record

Regards
Chuck

On Tue, Jul 3, 2018 at 12:54 PM, Dennis, Neil via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Not sure what your question is... this loops through all [Approvals]
> records that have [Approvals]Approved = false
>
> QUERY([Approvals];[Approvals]approved=False)
> For ($vlRecord;1;Records in selection([Approvals])) // loop through the
> selection of Approvals
>// Do something with the record
>  SEND RECORD([Approvals]) // Save the record
>  NEXT RECORD([Approvals])   // Go to the next record
> End for
>
> Technically the First Record ([Approvals]) isn't needed as the query loads
> the first record.
>
>
> Neil
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Privacy Disclaimer: This message contains confidential information and is
> intended only for the named addressee. If you are not the named addressee
> you should not disseminate, distribute or copy this email. Please delete
> this email from your system and notify the sender immediately by replying
> to this email.  If you are not the intended recipient you are notified that
> disclosing, copying, distributing or taking any action in reliance on the
> contents of this information is strictly prohibited.
>
> The Alternative Investments division of UMB Fund Services provides a full
> range of services to hedge funds, funds of funds and private equity funds.
> Any tax advice in this communication is not intended to be used, and cannot
> be used, by a client or any other person or entity for the purpose of (a)
> avoiding penalties that may be imposed on any taxpayer or (b) promoting,
> marketing, or recommending to another party any matter addressed herein.
> **
> 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
> **
>



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

2018-07-03 Thread Bob Miller via 4D_Tech
Hi Noah,

I'm not clear if your question regards SEND RECORD or, "Am I missing 
something in my understanding of looping over records?"

Regarding SEND RECORD, the example in the documentation isn't complete, 
you first have to set up a destination for the record using SET CHANNEL. 
An error -28 means there is no open serial port, which would be consistent 
with this problem as SET CHANNEL can be used to open either a port or a 
document.

If you are inquiring about looping over records, then can you give a bit 
more detail about what you are trying to do?  Certainly discovering the 
code was scanning the entire table instead of a selection is a shock.

best regards,


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
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: problems with SEND RECORD

2018-07-03 Thread Dennis, Neil via 4D_Tech
I just noticed you use send record instead of save record, that should work too 
as long as you have an open channel using Set Channel.

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Dennis, Neil 
via 4D_Tech
Sent: Tuesday, July 03, 2018 10:55 AM
To: supp...@gus.ucsb.edu; 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Dennis, Neil 
Subject: RE: problems with SEND RECORD

This is an EXTERNAL email. Do not open attachments or click on links unless you 
have confirmed the identity of the sender. 

--
Not sure what your question is... this loops through all [Approvals] records 
that have [Approvals]Approved = false

QUERY([Approvals];[Approvals]approved=False)
For ($vlRecord;1;Records in selection([Approvals])) // loop through the 
selection of Approvals
   // Do something with the record
 SEND RECORD([Approvals]) // Send the record
 NEXT RECORD([Approvals])   // Go to the next record
End for

Technically the First Record ([Approvals]) isn't needed as the query loads the 
first record.


Neil






Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
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: problems with SEND RECORD

2018-07-03 Thread Dennis, Neil via 4D_Tech
Not sure what your question is... this loops through all [Approvals] records 
that have [Approvals]Approved = false

QUERY([Approvals];[Approvals]approved=False)
For ($vlRecord;1;Records in selection([Approvals])) // loop through the 
selection of Approvals
   // Do something with the record
 SEND RECORD([Approvals]) // Save the record
 NEXT RECORD([Approvals])   // Go to the next record
End for

Technically the First Record ([Approvals]) isn't needed as the query loads the 
first record.


Neil














Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
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
**

problems with SEND RECORD

2018-07-03 Thread Noah via 4D_Tech
Good morning!
I work with a large codebase that has had many developers over the years.
Consequently, when building something new, I will sometimes look to see how
something was done previously. More often it has been the case that I will
go straight to the documentation to see the currently recommended 4D
approach to the issue.

Today I was looking at capturing the 'approval of selected records'.
Selected is a boolean value in the database. Stepping through the code I
could see that where we were supposed to be looping over the records in the
current selection, we were instead dealing with the whole selection.
Stepping back from the context of the application, I created a scratchpad
sort of method, which contains a simple query and a code snippet directly
from the documentation.

The 4th basic example in on this page:
http://doc.4d.com/4Dv15/4D/15.6/ForEnd-for.300-3818649.en.html produces an
-28 communication error after trying to SEND RECORD.


QUERY([Approvals];[Approvals]approved=False)


FIRST RECORD([Approvals])

For ($vlRecord;1;Records in selection([Approvals]))

  // Do something with the record

SEND RECORD([Approvals])

  // ...

  // Go to the next record

NEXT RECORD([Approvals])

End for


Am I missing something in my understanding of looping over records?
**
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 Integration with Microsoft Dynamics AX 2012 "cube"

2018-07-03 Thread netandwork via 4D_Tech
Hi Dan,

I'm not sure if this may help you

I'm working on a D365 integration right now. But we decided to use a Biztalk
server in between. Our D365 consultants created the OpenData interface while
I created the Restful interface to BizTalk. We transfer PO and SO.

Best

Adrian



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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
**