Kirk

Just to throw a  curved ball to the mix…

 I use in  a different context some DIFF code in 4D-I did not write it. 

I have tried using the DIFF command (On osx) and for my purposes the DiFF code 
i have which produces arrays of differences and is more preferable for me. 

This is however being used as part of my own code control code so the 
parameters of what you want from the code may be very different. It picks up a 
document(or 2) and compares them.

 I put the code into a component because it can only run compiled-it was 
painfully slow uncompiled (and in my case i am using it in development so my 
code is not compiled).

Calling DIFF via LEP(not sure how this would be called on WIndows) is like 
this(with my notes). The problem with this is you have to write code to 
‘humanise’ the results-i started to write something for my purposes but have 
not progressed to completion.

C_TEXT($_t_NewDocumentPath;$_t_OldDocumentPath;$_txt_OSASCRIPT;$_t_InputStream;$_t_OutputStream)
C_TEXT($1;$2)
$_t_NewDocumentPath:=Convert path system to POSIX($1)//$1 is the new document 
path
$_t_OldDocumentPath:=Convert path system to POSIX($2)//$2 is the old document 
path
$_txt_OSASCRIPT:="DIFF -iwc "+Char(34)+$_t_OldDocumentPath+Char(34)+" 
"+Char(34)+$_t_NewDocumentPath+Char(34)
$_t_InputStream:=""
$_t_OutputStream:=""
LAUNCH EXTERNAL PROCESS($_txt_OSASCRIPT;$_t_InputStream;$_t_OutputStream)
  //(Information)
  //***from(Old)file with modification time(note the***)
  //---to(new)file with modfication time(note the---)
  //****line of stars(longer than this)-seperator
  //***1***this means the old file from range
  ///this will always be at least one line it gives a context the line content 
is here(this can be multiple lines
  //the context lines start with two spaces
  //the differing lines start with a char
  //! (space) means a line this part of a group of one or more lines that 
changed between the fwo files-there will be a block of lines in the to file to 
correspond
  //+ an inserted file in the (new)?? that corresponds to nothing in the (old) 
file
  //- a  deleted line in the  old file that corresponds to nothing in the new 
file


Happily provide you with source code for the 4D DIFF -I found it on one of the 
4d code sharing sites-written by David Dancy.

I have put the code into a structure. 

https://www.dropbox.com/sh/64mcnxej3nh2h2p/AAD-wgNga2x2P75rdRyast0Fa?dl=0

I too use BBedit(best text editor ever in my opinion) on the mac-never been 
able to(had the time to) work out how to call it via an OSA(Applescript) and 
get the compare results text back.

> On 25 Apr 2017, at 23:50, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Kirk:
> 
> My current thinking is to store the entire document but a PDF is harder to
> futz with and it *would* save a bit of disk space. I'm leaning toward just
> setting up a folder for each quote and dropping a changed document in it.
> Disk space is copious and free and I don't need "chain of custody" type
> practices. The issue that my client is dealing with is that some of the
> sales reps have futzed with some of the quote documents. By adding this
> feature the sales reps will know that their 4D Write documents will be
> tracked by the audit trail and that should cut out almost all of the few
> instances of mischief.
> 
> DeltaWalker might do the trick. I've been using it on the Mac for a couple
> of years and it works fine but it is a little slow. It its favor, the
> Windows version operates via the command line. Word has a compare feature,
> though I've never programmed Word to run from the command line, and then
> there's this online service <https://www.diffchecker.com>, too.
> 
> I like the idea of using diffchecker.com but who knows how long it will be
> available.
> 
> Next step is to contact the client and ask them how automagic the diff
> function needs to be.
> 
> Thanks for your suggestions.
> 
> --
> Douglas von Roeder
> 949-336-2902
> 
> On Tue, Apr 25, 2017 at 3:20 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Doug,
>> On Tue, Apr 25, 2017 at 1:32 PM, Douglas von Roeder via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>> 
>>> In addition to the hash, my thinking is to store changed documents as
>>> versions of the original ("reference") document instead overwriting the
>>> original.
>>> 
>> 
>> ​If the formatting isn't important (headers, footers, page numbers) I'd
>> just save the body text without formatting. Save them into a related table
>> of 'versions' with the hash and date and stuff. If they want the formatting
>> and the whole smash I'd save them as a PDF. ​The point is you want to
>> prevent changing that archive copy.
>> 
>> 
>>> Next step is to find an app that will do a diff that I can display for
>> the
>>> ​ ​
>>> end user.
>>> 
>> ​I found an app called Deltawalker that's pretty good. ​
>> 
>> 
>> --
>> Kirk Brooks
>> San Francisco, CA
>> =======================
>> 
>> *The only thing necessary for the triumph of evil is for good men to do
>> nothing.*
>> 
>> *- Edmund Burke*
>> **********************************************************************
>> 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
> **********************************************************************

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

Reply via email to