HOWTO return the difference between two strings? 
Author Message
 HOWTO return the difference between two strings?

I want to do a scan in program code to see whether there were changes (that
I forgot to document, yes indeed). Or just to see what I've done in a
certain project, supposing I kept the original file of course.
I know how to navigate all these objects. But I want to do the following:

supply two strings to a function
return the parts that are only in one string, or only in the other, I think
as ByRef parameters (I'd like the function result to be a boolean, or an
Integer)

I remember there is a DOS utility that does just this. But when trying to
design an algorithm, I got quite stuck in the possibilities. Anyone done
this?

--
Thank you. Regards,
Bas Cost Budde, Holland
website at http://www.*-*-*.com/
email at the same domain as utopia, but I don't like spam



Tue, 10 Jun 2003 04:38:53 GMT  
 HOWTO return the difference between two strings?

Hi,

The specs are not very clear, but I will say that a replace of the shortest
string into the longest one with vbNullString can implement a possible
INTERPRETATION of your description:

? Replace("This is a string with agagaga in it, and indeed there is the word
agagaga in this string.", "agagaga" , vbNullString,,,vbBinaryCompare)
This is a string with  in it, and indeed there is the word  in this string.

Replace is available in VB6/VBA6. You can consult "VBA Developers Handbook"
for a very good implementation of it if you are using a less recent version.

Hoping it may help,
Vanderghast, Access MVP



Quote:
> I want to do a scan in program code to see whether there were changes
(that
> I forgot to document, yes indeed). Or just to see what I've done in a
> certain project, supposing I kept the original file of course.
> I know how to navigate all these objects. But I want to do the following:

> supply two strings to a function
> return the parts that are only in one string, or only in the other, I
think
> as ByRef parameters (I'd like the function result to be a boolean, or an
> Integer)

> I remember there is a DOS utility that does just this. But when trying to
> design an algorithm, I got quite stuck in the possibilities. Anyone done
> this?

> --
> Thank you. Regards,
> Bas Cost Budde, Holland
> website at http://utopia.knoware.nl/users/hegedu
> email at the same domain as utopia, but I don't like spam



Tue, 10 Jun 2003 19:22:39 GMT  
 HOWTO return the difference between two strings?
There is a custom replace function available at www.master-office.com under
"Developers" if you don't have one already.

--
Regards Hans-Chr. Francke
www.master-office.com


Quote:
> Hi,

> The specs are not very clear, but I will say that a replace of the
shortest
> string into the longest one with vbNullString can implement a possible
> INTERPRETATION of your description:

> ? Replace("This is a string with agagaga in it, and indeed there is the
word
> agagaga in this string.", "agagaga" , vbNullString,,,vbBinaryCompare)
> This is a string with  in it, and indeed there is the word  in this
string.

> Replace is available in VB6/VBA6. You can consult "VBA Developers
Handbook"
> for a very good implementation of it if you are using a less recent
version.

> Hoping it may help,
> Vanderghast, Access MVP



> > I want to do a scan in program code to see whether there were changes
> (that
> > I forgot to document, yes indeed). Or just to see what I've done in a
> > certain project, supposing I kept the original file of course.
> > I know how to navigate all these objects. But I want to do the
following:

> > supply two strings to a function
> > return the parts that are only in one string, or only in the other, I
> think
> > as ByRef parameters (I'd like the function result to be a boolean, or an
> > Integer)

> > I remember there is a DOS utility that does just this. But when trying
to
> > design an algorithm, I got quite stuck in the possibilities. Anyone done
> > this?

> > --
> > Thank you. Regards,
> > Bas Cost Budde, Holland
> > website at http://utopia.knoware.nl/users/hegedu
> > email at the same domain as utopia, but I don't like spam



Tue, 10 Jun 2003 22:30:37 GMT  
 HOWTO return the difference between two strings?
Thanks to both of you. I will readily admit that my specs are vague. But
although good for another idea, I cannot really use this answer.

Scenario:

I have a database. I create a copy of it, in which I make changes. Many
changes do not interest me. But changes in code modules, to begin with, and
possibly later in form code too, needs my attention. So, I want to see
whether code has changed. I can make out for myself if a procedure has
ceased, or been born; but if it exists both in the original and modified
version, chances are that it has changed.

I imagine a two-column output, both procedures each in their own column; on
each row, a line of code is either present or absent. The result of this is
a clear visual clue as to what has happened to the code.

My first problem arose when I realized that it can be difficult to see where
the start of the code is. I mean, maybe there [stops suddenly, thinking] I
think I just answered that part: the start of the code, that is the one to
look in, is the original of course. Challenge is to write something that
does not rely on this assumption, but that is not necessary now.

I think I can write this now. Thinking aloud often helps. So then, thanks
for listening.

With this description at hand, did you ever see such a thing before?

--
Thank you. Regards,
Bas Cost Budde, Holland
website at http://utopia.knoware.nl/users/hegedu
email at the same domain as utopia, but I don't like spam

Quote:

>There is a custom replace function available at www.master-office.com under
>"Developers" if you don't have one already.



>> The specs are not very clear, but I will say that a replace of the
>shortest
>> string into the longest one with vbNullString can implement a possible
>> INTERPRETATION of your description:



Wed, 11 Jun 2003 04:05:00 GMT  
 HOWTO return the difference between two strings?

Hi,

in C and C++, yes, but VB is terrible with strings...

Furthermore, it is very hard if both copies have add a line:

Public Sub A()            Public Sub A()
MyFirstLine                MyFirstLine
MyThirdLIne               SomeOtherLineHere
MyFourthLIne              YetAnotherLine
End Sub                        MyFourthLine
                                    End Sub

it is simple to see where both start to differ, but it is hard to detect
where they merge again to the same path (note this is a simple scenario,
starting from the End Sub and going up won't help much in a real case).

If I have saw something like that, yes, Visual Safe Source ( but I don't use
it anymore) and FMS inc has a tool for that too.

Vanderghast, Access MVP



Quote:
> Thanks to both of you. I will readily admit that my specs are vague. But
> although good for another idea, I cannot really use this answer.

> Scenario:

> I have a database. I create a copy of it, in which I make changes. Many
> changes do not interest me. But changes in code modules, to begin with,
and
> possibly later in form code too, needs my attention. So, I want to see
> whether code has changed. I can make out for myself if a procedure has
> ceased, or been born; but if it exists both in the original and modified
> version, chances are that it has changed.

> I imagine a two-column output, both procedures each in their own column;
on
> each row, a line of code is either present or absent. The result of this
is
> a clear visual clue as to what has happened to the code.

> My first problem arose when I realized that it can be difficult to see
where
> the start of the code is. I mean, maybe there [stops suddenly, thinking] I
> think I just answered that part: the start of the code, that is the one to
> look in, is the original of course. Challenge is to write something that
> does not rely on this assumption, but that is not necessary now.

> I think I can write this now. Thinking aloud often helps. So then, thanks
> for listening.

> With this description at hand, did you ever see such a thing before?

> --
> Thank you. Regards,
> Bas Cost Budde, Holland
> website at http://utopia.knoware.nl/users/hegedu
> email at the same domain as utopia, but I don't like spam

> >There is a custom replace function available at www.master-office.com
under
> >"Developers" if you don't have one already.



> >> The specs are not very clear, but I will say that a replace of the
> >shortest
> >> string into the longest one with vbNullString can implement a possible
> >> INTERPRETATION of your description:



Wed, 11 Jun 2003 06:13:55 GMT  
 HOWTO return the difference between two strings?
Yes, both do compare. Neither will do exactly what you want though. Perhaps with
some modification/combination of their abilities you can achieve your goals. You
might also check out some of the AI programs, natural language or neural
network.

David Whitmore

Quote:

> Hi,

> in C and C++, yes, but VB is terrible with strings...

> Furthermore, it is very hard if both copies have add a line:

> Public Sub A()            Public Sub A()
> MyFirstLine                MyFirstLine
> MyThirdLIne               SomeOtherLineHere
> MyFourthLIne              YetAnotherLine
> End Sub                        MyFourthLine
>                                     End Sub

> it is simple to see where both start to differ, but it is hard to detect
> where they merge again to the same path (note this is a simple scenario,
> starting from the End Sub and going up won't help much in a real case).

> If I have saw something like that, yes, Visual Safe Source ( but I don't use
> it anymore) and FMS inc has a tool for that too.

> Vanderghast, Access MVP



> > Thanks to both of you. I will readily admit that my specs are vague. But
> > although good for another idea, I cannot really use this answer.

> > Scenario:

> > I have a database. I create a copy of it, in which I make changes. Many
> > changes do not interest me. But changes in code modules, to begin with,
> and
> > possibly later in form code too, needs my attention. So, I want to see
> > whether code has changed. I can make out for myself if a procedure has
> > ceased, or been born; but if it exists both in the original and modified
> > version, chances are that it has changed.

> > I imagine a two-column output, both procedures each in their own column;
> on
> > each row, a line of code is either present or absent. The result of this
> is
> > a clear visual clue as to what has happened to the code.

> > My first problem arose when I realized that it can be difficult to see
> where
> > the start of the code is. I mean, maybe there [stops suddenly, thinking] I
> > think I just answered that part: the start of the code, that is the one to
> > look in, is the original of course. Challenge is to write something that
> > does not rely on this assumption, but that is not necessary now.

> > I think I can write this now. Thinking aloud often helps. So then, thanks
> > for listening.

> > With this description at hand, did you ever see such a thing before?

> > --
> > Thank you. Regards,
> > Bas Cost Budde, Holland
> > website at http://utopia.knoware.nl/users/hegedu
> > email at the same domain as utopia, but I don't like spam

> > >There is a custom replace function available at www.master-office.com
> under
> > >"Developers" if you don't have one already.



> > >> The specs are not very clear, but I will say that a replace of the
> > >shortest
> > >> string into the longest one with vbNullString can implement a possible
> > >> INTERPRETATION of your description:



Wed, 11 Jun 2003 11:43:46 GMT  
 HOWTO return the difference between two strings?
Still many thanks. They are fruitful attributions. I will come up with
whatever I will have made (put it on my site!)

--
Thank you. Regards,
Bas Cost Budde, Holland
website at http://utopia.knoware.nl/users/hegedu
email at the same domain as utopia, but I don't like spam

Quote:

> Hi,

> in C and C++, yes, but VB is terrible with strings...

> Furthermore, it is very hard if both copies have add a line:

> If I have seen something like that, yes, Visual Safe Source ( but I don't
use
> it anymore) and FMS inc has a tool for that too.

>Yes, both do compare. Neither will do exactly what you want though. Perhaps
with
>some modification/combination of their abilities you can achieve your
goals. You
>might also check out some of the AI programs, natural language or neural
>network.

good remark. That was a strong point in my study, too.


Wed, 11 Jun 2003 18:55:10 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Return the first two chars of variable (string)

2. How to calculate the difference between two dates (time elapsed between two program starts)

3. Differences between NULL, Empty String, Null String?

4. Difference between string and string$

5. difference between Const As String and As String?

6. BinaryRead - howto convert binary string back to string array

7. ADODB Connection String- Two Diff Examples - Two Diff Errors

8. Looking for two strings in a string

9. difference between two dates ,in years,months,and days

10. Difference between two dates

11. Difference Between Two Dates - Including Holidays

12. Difference between two dates gives bad results

 

 
Powered by phpBB® Forum Software