COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Problem with search

• Email
• Follow

```I am trying to find an efficient search algorithm for this problem. I
hasten to add this is not a homework assignment.

The problem is variable name references in COBOL. Basically you can define
nested structures consisting of names (and attributes, which I have
omitted here). Names need not be unique. However when accessing a variable
you must specify a unique path, which may be a partial path.

Let's say a path a.b.c.d exists. You could refer to "d" as "a.d" or
"a.b.c.d" or "d", as long as these paths are unique. If a path "a.x.d" also
existed, you could not use "d" or "a.d" to access either variable because
this path is now ambiguous.

Here is some sample data and a simplistic solution.

(defparameter *vars*
'((a) ;; a is a single variable
(b) ;; b is a single variable
(c (d) (e) (f)) ;; c is a variable made up of d, e and f
(c (d) (f) (g)) ;; c is a variable made up of d, f and g
(c (d) (f) (z)) ;; c is a variable made up of d, f and g
(f) ;; f is a single variable
(g) ;; g is a single variable
(h (i (j (k (l (m) (n))))))) ;; h contains i, which contains j
;; which contains k which contains l
;; which contains m and n
"Define the nested variable structures. At each level you have
a list. A list is a variable symbol followed by the symbols
for variables within it, if any. Note that multiple variables can have the
same name. It is only an error if a reference is ambiguous.")

(defun find-a-var (var-component-list)
(let ((sol (find-var-name nil var-component-list *vars*)))
(if (> (length sol) 1)
(format t "~%Ambiguous")
(if (not sol)
(format t "~%No solution")))
(dolist (el sol)
(format t "~%Solution ~S" el))
(format t "~%")
sol))

(defun find-var-name (acc search-name-left vars)
(let ((soln-acc nil))
(if (not search-name-left)
(let ((soln (list (append (reverse acc) search-name-left vars))))
soln)
(if (not vars)
nil
(progn
(dolist (var vars)
(let
((soln
(if (eq (first search-name-left) (first var))
(find-var-name (cons (first search-name-left) acc)
(rest search-name-left)
(rest var))
(find-var-name (cons (first var) acc)
search-name-left
(rest var)))))
(if soln (setf soln-acc (append soln-acc soln)))))
soln-acc)))))

The problem is how to efficiently match a qualified variable name with the
known definitions.

What I am currently doing is using a hash table for the lowest level and
then going up the structure for each match to see if it matches
completely. This is inefficient if there are many lowest level variables
with the same name.

In real programs, the same names tend to occur many times. The same
structure may be embedded in multiple different other structures. I have
seen programs where the same low level name occurs up to 100 times, so
my algorithm will be slow for such cases.

I could put all sub-paths in the hash table but this would result in a
very large hash table that would take a long time to build. The number of
subsets is 2^(n-1)+1 where n is the length of the path.

I was thinking of using my current algorithm but supplementing it with
a cache of paths that were already used. Assuming the programmer tends
to use the same name paths repeatedly, this might work reasonably well.

Another possible approach would use nested hash tables. I think the size
of the tables would order n^2 of the number of levels (which can be up to
50) and so the build time would be O(n^2).

Any suggestions about a faster algorithm would be appreciated. My ain is
that the algorithm should be O(N) where N is the length of the path
supplied.

Tim Josling
```
 0
Reply TimJ (135) 3/8/2008 12:51:19 AM

See related articles to this posting

```On Mar 7, 7:51=A0pm, tim <T...@internet.com> wrote:
> I am trying to find an efficient search algorithm for this problem. I
> hasten to add this is not a homework assignment.
>
> The problem is variable name references in COBOL. Basically you can define=

> nested structures consisting of names (and attributes, which I have
> omitted here). Names need not be unique. However when accessing a variable=

> you must specify a unique path, which may be a partial path.
>
> Let's say a path a.b.c.d exists. You could refer to "d" as "a.d" or
> "a.b.c.d" or "d", as long as these paths are unique. If a path "a.x.d" als=
o
> existed, you could not use "d" or "a.d" to access either variable because
> this path is now ambiguous.
>
> Here is some sample data and a simplistic solution.
>
> (defparameter *vars*
> =A0 '((a) ;; a is a single variable
> =A0 =A0 (b) ;; b is a single variable
> =A0 =A0 (c (d) (e) (f)) ;; c is a variable made up of d, e and f
> =A0 =A0 (c (d) (f) (g)) ;; c is a variable made up of d, f and g
> =A0 =A0 (c (d) (f) (z)) ;; c is a variable made up of d, f and g
> =A0 =A0 (f) ;; f is a single variable
> =A0 =A0 (g) ;; g is a single variable
> =A0 =A0 (h (i (j (k (l (m) (n))))))) ;; h contains i, which contains j
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; whi=
ch contains k which contains l
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; whi=
ch contains m and n
> =A0 "Define the nested variable structures. At each level you have
> =A0 a list. A list is a variable symbol followed by the symbols
> =A0 for variables within it, if any. Note that multiple variables can have=
the
> =A0 same name. It is only an error if a reference is ambiguous.")
>
> (defun find-a-var (var-component-list)
> =A0 (let ((sol (find-var-name nil var-component-list *vars*)))
> =A0 =A0 (if (> (length sol) 1)
> =A0 =A0 =A0 =A0 (format t "~%Ambiguous")
> =A0 =A0 =A0 =A0 (if (not sol)
> =A0 =A0 =A0 =A0 =A0 =A0 (format t "~%No solution")))
> =A0 =A0 (dolist (el sol)
> =A0 =A0 =A0 (format t "~%Solution ~S" el))
> =A0 =A0 (format t "~%")
> =A0 =A0 sol))
>
> (defun find-var-name (acc search-name-left vars)
> =A0 (let ((soln-acc nil))
> =A0 =A0 (if (not search-name-left)
> =A0 =A0 =A0 =A0 (let ((soln (list (append (reverse acc) search-name-left v=
ars))))
> =A0 =A0 =A0 =A0 =A0 soln)
> =A0 =A0 =A0 =A0 (if (not vars)
> =A0 =A0 =A0 =A0 =A0 =A0 nil
> =A0 =A0 =A0 =A0 =A0 =A0 (progn
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (dolist (var vars)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (let
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0((soln
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if (eq (first search-name-lef=
t) (first var))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (find-var-name (cons (=
first search-name-left) acc)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest search-name-left)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest var))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (find-var-name (cons (=
first var) acc)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0search-name-left
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest var)))))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if soln (setf soln-acc (append soln-a=
cc soln)))))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 soln-acc)))))
>
> The problem is how to efficiently match a qualified variable name with the=

> known definitions.
>
> What I am currently doing is using a hash table for the lowest level and
> then going up the structure for each match to see if it matches
> completely. This is inefficient if there are many lowest level variables
> with the same name.
>
> In real programs, the same names tend to occur many times. The same
> structure may be embedded in multiple different other structures. I have
> seen programs where the same low level name occurs up to 100 times, so
> my algorithm will be slow for such cases.
>
> I could put all sub-paths in the hash table but this would result in a
> very large hash table that would take a long time to build. The number of
> subsets is 2^(n-1)+1 where n is the length of the path.
>
> I was thinking of using my current algorithm but supplementing it with
> a cache of paths that were already used. Assuming the programmer tends
> to use the same name paths repeatedly, this might work reasonably well.
>
> Another possible approach would use nested hash tables. I think the size
> of the tables would order n^2 of the number of levels (which can be up to
> 50) and so the build time would be O(n^2).
>
> Any suggestions about a faster algorithm would be appreciated. My ain is
> that the algorithm should be O(N) where N is the length of the path
> supplied.

First thanks for the exceptionally clear problem description.  Hope I
can be equally clear.

Processing in reverse as you suggest seems like the right approach.
After that, you are essentially building a finite state machine that
processes the dotted path in reverse order and accepts appropriate
sequences of ids.  For a single path a.b.c.d, the FSM has 5 states.

If I am reading your code correctly, the transition table looks like
this:

a b c d
1        2
2* 5 4 3
3* 5 4
4* 5
5*

State 1 is the start state.  The asterisks mean that the machine is
accepting.  If you end up at an accepting state when the whole reverse
path is consumed, it's a valid variable.

As you continue to build the FSM by adding paths, states may change
from accepting to not when ambiguities are introduced.  If you add b.d
above, all stays the same except state 4 becomes non-accepting

You're right that there are 1 + N(N-1)/2 transitions, which is
O(N^2).  But the squared term is in length of the path, not the number
of paths that you have to incorporate.  Since defs will outnumber uses
and very long paths don't seem likely, this ought to be okay.

Now there are lots of ways to implement a FSM. One as you suggested is
to implement each state as a hash table for transitions and an
indicator of the state's accepting/non-accepting character.  You could
label accepting states with that path(s) that get(s) you there, for
example.

Or you could preprocess all the symbols to map each to a small
integer.  Then you can use a 2d array for the FSM as I did above.  The
array will be sparse, so you'd probably implement it with some kind of
encoded representation, which more or less takes you back to hash
tables.
```
 0
Reply gene.ressler (563) 3/8/2008 3:42:23 AM

```On Mar 7, 10:42=A0pm, Gene <gene.ress...@gmail.com> wrote:
> On Mar 7, 7:51=A0pm, tim <T...@internet.com> wrote:
>
>
>
>
>
> > I am trying to find an efficient search algorithm for this problem. I
> > hasten to add this is not a homework assignment.
>
> > The problem is variable name references in COBOL. Basically you can defi=
ne
> > nested structures consisting of names (and attributes, which I have
> > omitted here). Names need not be unique. However when accessing a variab=
le
> > you must specify a unique path, which may be a partial path.
>
> > Let's say a path a.b.c.d exists. You could refer to "d" as "a.d" or
> > "a.b.c.d" or "d", as long as these paths are unique. If a path "a.x.d" a=
lso
> > existed, you could not use "d" or "a.d" to access either variable becaus=
e
> > this path is now ambiguous.
>
> > Here is some sample data and a simplistic solution.
>
> > (defparameter *vars*
> > =A0 '((a) ;; a is a single variable
> > =A0 =A0 (b) ;; b is a single variable
> > =A0 =A0 (c (d) (e) (f)) ;; c is a variable made up of d, e and f
> > =A0 =A0 (c (d) (f) (g)) ;; c is a variable made up of d, f and g
> > =A0 =A0 (c (d) (f) (z)) ;; c is a variable made up of d, f and g
> > =A0 =A0 (f) ;; f is a single variable
> > =A0 =A0 (g) ;; g is a single variable
> > =A0 =A0 (h (i (j (k (l (m) (n))))))) ;; h contains i, which contains j
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; w=
hich contains k which contains l
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; w=
hich contains m and n
> > =A0 "Define the nested variable structures. At each level you have
> > =A0 a list. A list is a variable symbol followed by the symbols
> > =A0 for variables within it, if any. Note that multiple variables can ha=
ve the
> > =A0 same name. It is only an error if a reference is ambiguous.")
>
> > (defun find-a-var (var-component-list)
> > =A0 (let ((sol (find-var-name nil var-component-list *vars*)))
> > =A0 =A0 (if (> (length sol) 1)
> > =A0 =A0 =A0 =A0 (format t "~%Ambiguous")
> > =A0 =A0 =A0 =A0 (if (not sol)
> > =A0 =A0 =A0 =A0 =A0 =A0 (format t "~%No solution")))
> > =A0 =A0 (dolist (el sol)
> > =A0 =A0 =A0 (format t "~%Solution ~S" el))
> > =A0 =A0 (format t "~%")
> > =A0 =A0 sol))
>
> > (defun find-var-name (acc search-name-left vars)
> > =A0 (let ((soln-acc nil))
> > =A0 =A0 (if (not search-name-left)
> > =A0 =A0 =A0 =A0 (let ((soln (list (append (reverse acc) search-name-left=
vars))))
> > =A0 =A0 =A0 =A0 =A0 soln)
> > =A0 =A0 =A0 =A0 (if (not vars)
> > =A0 =A0 =A0 =A0 =A0 =A0 nil
> > =A0 =A0 =A0 =A0 =A0 =A0 (progn
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 (dolist (var vars)
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (let
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0((soln
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if (eq (first search-name-l=
eft) (first var))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (find-var-name (cons=
(first search-name-left) acc)
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest search-name-left)
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest var))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (find-var-name (cons=
(first var) acc)
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0search-name-left
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0(rest var)))))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if soln (setf soln-acc (append soln=
-acc soln)))))
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 soln-acc)))))
>
> > The problem is how to efficiently match a qualified variable name with t=
he
> > known definitions.
>
> > What I am currently doing is using a hash table for the lowest level and=

> > then going up the structure for each match to see if it matches
> > completely. This is inefficient if there are many lowest level variables=

> > with the same name.
>
> > In real programs, the same names tend to occur many times. The same
> > structure may be embedded in multiple different other structures. I have=

> > seen programs where the same low level name occurs up to 100 times, so
> > my algorithm will be slow for such cases.
>
> > I could put all sub-paths in the hash table but this would result in a
> > very large hash table that would take a long time to build. The number o=
f
> > subsets is 2^(n-1)+1 where n is the length of the path.
>
> > I was thinking of using my current algorithm but supplementing it with
> > a cache of paths that were already used. Assuming the programmer tends
> > to use the same name paths repeatedly, this might work reasonably well.
>
> > Another possible approach would use nested hash tables. I think the size=

> > of the tables would order n^2 of the number of levels (which can be up t=
o
> > 50) and so the build time would be O(n^2).
>
> > Any suggestions about a faster algorithm would be appreciated. My ain is=

> > that the algorithm should be O(N) where N is the length of the path
> > supplied.
>
> First thanks for the exceptionally clear problem description. =A0Hope I
> can be equally clear.
>
> Processing in reverse as you suggest seems like the right approach.
> After that, you are essentially building a finite state machine that
> processes the dotted path in reverse order and accepts appropriate
> sequences of ids. =A0For a single path a.b.c.d, the FSM has 5 states.
>
> If I am reading your code correctly, the transition table looks like
> this:
>
> =A0 =A0a b c d
> 1 =A0 =A0 =A0 =A02
> 2* 5 4 3
> 3* 5 4
> 4* 5
> 5*
>
> State 1 is the start state. =A0The asterisks mean that the machine is
> accepting. =A0If you end up at an accepting state when the whole reverse
> path is consumed, it's a valid variable.
>
> As you continue to build the FSM by adding paths, states may change
> from accepting to not when ambiguities are introduced. =A0If you add b.d
> above, all stays the same except state 4 becomes non-accepting
>
> You're right that there are 1 + N(N-1)/2 transitions, which is
> O(N^2). =A0But the squared term is in length of the path, not the number
> of paths that you have to incorporate. =A0Since defs will outnumber uses
> and very long paths don't seem likely, this ought to be okay.
>
> Now there are lots of ways to implement a FSM. One as you suggested is
> to implement each state as a hash table for transitions and an
> indicator of the state's accepting/non-accepting character. =A0You could
> label accepting states with that path(s) that get(s) you there, for
> example.
>
> Or you could preprocess all the symbols to map each to a small
> integer. =A0Then you can use a 2d array for the FSM as I did above. =A0The=

> array will be sparse, so you'd probably implement it with some kind of
> encoded representation, which more or less takes you back to hash
> tables.- Hide quoted text -
>
> - Show quoted text -

Here.  I think this works.  Not well tested.

;;; A state is a list of two elements:
;;; 1. List of complete definitions that get you to the state.
;;; 2. A hash mapping symbols to next states.
;;; An FSM is its start state.
(defun build-fsm (scopes)
(let ((fsm (list nil (make-hash-table))))
(labels ((insert-paths (scopes rev-path)
(if scopes
(dolist (scope scopes)
(insert-paths (cdr scope)
(cons (car scope) rev-path)))
(insert-in-fsm rev-path fsm))))
(insert-paths scopes nil))
fsm))

(defun insert-in-fsm (rev-path fsm)
(labels ((insert (rest-rev-path states)
;; Show we can get to this state using path.
(push (reverse rev-path) (first (first states)))
(when rest-rev-path
(let ((next-state (gethash (car rest-rev-path)
(second (first states)))))
;; If there is no next state, build one.
(when (null next-state)
(setq next-state (list nil (make-hash-table))))
;; Connect the next state to the trailing ones
(dolist (state states)
(setf (gethash (car rest-rev-path)
(second state))
next-state))
;; Continue with rest of path.
(insert (rest rest-rev-path)
(cons next-state states))))))
;; First transition is unique, so build here.
(let ((state-2 (gethash (car rev-path) (second fsm))))
(when (null state-2)
(setq state-2 (list nil (make-hash-table)))
(setf (gethash (car rev-path) (second fsm)) state-2))
;; Build the rest.
(insert (cdr rev-path) (list state-2)))))

(defparameter *fsm* (build-fsm *vars*))

(defun check-path (path &optional (fsm *fsm*))
(labels ((check (rev-path fsm)
(cond ((null rev-path) (first fsm))
(t (let ((next-state (gethash (first rev-path)
(second fsm))))
(if next-state
(check (rest rev-path) next-state)
:fail))))))
(check (reverse path) fsm)))

CL-USER> (check-path '(c d))
((C D) (C D) (C D))
CL-USER> (check-path '(a))
((A))
CL-USER> (check-path '(h n))
((H I J K L N))
CL-USER> (check-path '(h j n))
((H I J K L N))
CL-USER> (check-path '(n))
((H I J K L N))
CL-USER> (check-path '(z))
((C Z))
CL-USER> (check-path '(y))
:FAIL
```
 0
Reply gene.ressler (563) 3/8/2008 6:15:09 AM

```On Mar 7, 4:51 pm, tim <T...@internet.com> wrote:
> The problem is variable name references in COBOL.

Hello Tim,

I am looking for developers with both Cobol and Lisp experience.

-- Scott
```
 0
Reply FSet.SLB (346) 3/8/2008 6:39:49 AM

```On Fri, 07 Mar 2008 19:42:23 -0800, Gene wrote:

>
> Processing in reverse as you suggest seems like the right approach.
> After that, you are essentially building a finite state machine that
> processes the dotted path in reverse order and accepts appropriate
> sequences of ids.  For a single path a.b.c.d, the FSM has 5 states.
>

Thanks - very insightful. this gives me some good ideas to work with.

Tim Josling
```
 0
Reply TimJ (135) 3/8/2008 9:13:26 AM

```On Fri, 07 Mar 2008 22:15:09 -0800, Gene wrote:

> Here.  I think this works.  Not well tested.
>

Thanks Gene,
Tim Josling
```
 0
Reply TimJ (135) 3/8/2008 9:53:44 AM

```
Scott Burson wrote:
> On Mar 7, 4:51 pm, tim <T...@internet.com> wrote:
>
>>The problem is variable name references in COBOL.
>
>
> Hello Tim,
>
> I am looking for developers with both Cobol and Lisp experience.
> There may be three in the world :)

Four!

kenny

--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
```
 0
Reply kennytilton (1428) 3/10/2008 12:55:45 PM

```On Mon, 10 Mar 2008 08:55:45 -0400, Ken Tilton wrote:

> Scott Burson wrote:
>> On Mar 7, 4:51 pm, tim <T...@internet.com> wrote:
>>
>>>The problem is variable name references in COBOL.
>>
>>
>> Hello Tim,
>>
>> I am looking for developers with both Cobol and Lisp experience.
>> There may be three in the world :)
>
> Four!
>
>
> kenny
>

Yes, COBOL has macros (kind of).

Tim
```
 0
Reply TimJ (135) 3/11/2008 1:52:35 AM

```
tim wrote:
> On Mon, 10 Mar 2008 08:55:45 -0400, Ken Tilton wrote:
>
>
>>Scott Burson wrote:
>>
>>>On Mar 7, 4:51 pm, tim <T...@internet.com> wrote:
>>>
>>>
>>>>The problem is variable name references in COBOL.
>>>
>>>
>>>Hello Tim,
>>>
>>>I am looking for developers with both Cobol and Lisp experience.
>>>There may be three in the world :)
>>
>>Four!
>>
>>
>>kenny
>>
>
>
> Yes, COBOL has macros (kind of).

<g> Well, I think C calls them macros, so I thought I could get away
with it (kind of).

The whacky thing is that when I explored a port of my C version of the
Algebra software to Lisp I hid from Antlr all my macros that were
dereferencing pointers and handles (bless the Mac) so Antler thought
they were function calls and ... can you say "accessors"? Had I decided
to continue down that path I would have been able to do so as if
pointers and handles never existed.

Meanwhile GvR says: No macros for you!

kenny

--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
```
 0
Reply kennytilton (1428) 3/11/2008 2:23:27 AM

```On Mon, 10 Mar 2008 22:23:27 -0400, Ken Tilton
<kennytilton@optonline.net> wrote:

><g> Well, I think C calls them macros, so I thought I could get away
>with it (kind of).

EasyTrieve macros are basically copy members.
```
 0
Reply howard (6275) 3/11/2008 4:58:01 PM

9 Replies
30 Views

Similar Articles

12/9/2013 7:27:10 PM
page loaded in 40334 ms. (0)

Similar Artilces:

SEARCH : AND NOT ?
Is there a way to do: SEARCH RECIPES.TXT CAKE,VANILLA /MATCH=AND_NOT ? In other words, I want all records that contain "CAKE" but NOT "VANILLA" I know I can probably use a pipe to get all records that contain CAKE piked into a search that excludes anything with VANILLA. But it would be nice to be able to do this in a single command. Is there a trick ? (ok: consider a log file where you want to extract all records for a certain date/hour, and want to exclude records with a certain text that you don't care to look at becase they are so numerous and normal, but wish to focus on any record that may show some anomalies) JF Mezei wrote: > Is there a way to do: > > SEARCH RECIPES.TXT CAKE,VANILLA /MATCH=AND_NOT ? > > In other words, I want all records that contain "CAKE" but NOT "VANILLA" > > I know I can probably use a pipe to get all records that contain CAKE > piked into a search that excludes anything with VANILLA. But it would be > nice to be able to do this in a single command. > > Is there a trick ? > > > (ok: consider a log file where you want to extract all records for a >

Search Problem
to that position in order to fetch and make some modification to that name. I just need a way to line by line search the entire file, fetching that name whenever it appears, making some modifications and moving further. I hope I made myself clear. Any help will be appreciated. TIA pankaj_wolfhunter@yahoo.co.in wrote: > Greetings, > I have a file as below > > LobFile.txt > > 1|Charles|test.001.0.1313|123|test.001.0.1423 > 1|Charles|test.001.1313.3415|243|test.001.1423.3423 > > Here exp.001.0.1313 and others like it, is a file name with exp.001 as > the name of the file > and 0 as the starting and 1313 as the ending byte position. > This file name appears randomly in many places within the main > file(LobFile.txt) > having exp.001 as common name with all. > > I know the grep command can give me those lines where this name appears > but then I don't know at which position within the line that word > appears because I need to go to that position in order to fetch and > make some modification to that name. > > I just need a way to line by line search the entire file, fetching that > name whenever it appears

Search Facility
I would like to search a form with many fields on it, with out using the search facility through access. Througth a drop down list if possible.... How would I go about this? How could I also create this from a top bar menu option too...? Elaine Hi Elaine, The following code will cycle through all controls on a form...I actually go deeper with this routine, and cycle through the controls on up to 2 subforms deep, so if you need that to, let me know. The code below actually formats all date fields to the user's preference, but what you're really intersted in is if the control type is a textbox, then you would add code for your search, otherwise, you could ignore the other fields: For Each ctl In f.Controls If ctl.ControlType = acTextBox Then If f(ctl.Name).Format = "Short Date" Then If nomask = 0 Then f(ctl.Name).InputMask = f2!DateInputMask f(ctl.Name).Format = f2!DateStyle End If 'If f(ctl.Name).fontname <> DefFont Then ' f(ctl.Name).fontname = DefFont 'End If ElseIf ctl.ControlType = acLabel Or ctl.ControlType = acCommandButton Then If TransYN = -1

Possible search?
Hello, I'm not very familiar with search options on this site and I don't know if this can be done. A while ago, someone had requested to i.d. a font and I had a look at it. Now, I can't remember the name of this font but would like to buy a copy of it as I have a need for this particular one. Is there a way for me to search for the topics I previously looked at? If so, how would I proceed? Maybe I am overlooking something in the search options. Thanks for the help, Rick rick wrote: > Hello, I'm not very familiar with search options on this site and I > don't know if this can be done. A while ago, someone had requested to > i.d. a font and I had a look at it. Now, I can't remember the name of > this font but would like to buy a copy of it as I have a need for this > particular one. Is there a way for me to search for the topics I > previously looked at? If so, how would I proceed? Maybe I am > overlooking something in the search options. Thanks for the help, Rick > First, this isn't a site, it's a newsgroup. Search facilities are dependent on the newsreader you're using, such as Outlook Express, Agent, Thunderbird

cellarray search
Hi everybodt If I have a cellarray: test={'X1 Heineken' 'X2 Carlsberg' 'C2 Budweiser X' 'C3 Newcastle' 'X3 Liverpool'} How do I search for all strings that START with X and save in a new cellarray and at the same time get the index? In the example above I want Newstring={'X1 Heineken' 'X2 Carlsberg' 'X3 Liverpool'} Index=[1 2 5] I tried: pat=sprintf('.*%s.*','X'); Newstring=regexp(test,pat,'match'); Newstring=[Newstring{:}]; but I got: test={'X1 Heineken' 'X2 Carlsberg' 'C2 Budweiser X' 'X3 Liverpool'} Best Regards Jens "jens " <storebonghoved@hotmail.com> wrote in message <hpc843\$j5q\$1@fred.mathworks.com>... > Hi everybodt > > If I have a cellarray: > > test={'X1 Heineken' 'X2 Carlsberg' 'C2 Budweiser X' 'C3 Newcastle' 'X3 Liverpool'} > > > How do I search for all strings that START with X and save in a new cellarray and at the same time get the index? > > In the example above I want > > Newstring={'

Omit in a search
Hi, Is it possible to Omit a search in a field while not omitting a search in another field at the same time ? I want to perform a search where I don't want a specific area code while (and) I want the record of that area. This would permit me to find records where we omit the area code while entering data for specific city. Pierre probitai@dsuper.net In article <-PednSF9y4zdX6bdRVn_iw@look.ca>, "e-Probitai" <probitai@lavache.com> wrote: >Hi, > >Is it possible to Omit a search in a field while not omitting a search in >another field at the same time ? I want to perform a search where I don't >want a specific area code while (and) I want the record of that area. This >would permit me to find records where we omit the area code while entering >data for specific city. Two Find requests. First request, Find City. Second, enter area code & omit. Steve Brown

LAN Search
Want to code an utility on Windows with help of JAVA so that I can search shared folders on a windows network for file as well as text search

Search for vt220 display font
I'm trying to find the font the DEC vt220 terminals display (by default). Anything from an actual TrueType font to just a plain bitmap of the different characters would suffice. I went so far as to get a vt220, with the intention of reproducing the characters in MS Paint, but the thing won't power up correctly for some reason. Any assistance anyone could provide would be greatly appreciated. -- Sam. In article <1140991217.655011.155180@j33g2000cwa.googlegroups.com>, <sam@rinkworks.com> wrote: >I'm trying to find the font the DEC vt220 terminals display (by >

Search for PDF Editor Freeware
Hi Do you know a software (Freeware) who can editit PDF documents. I have to add comments in a PDF and save them again as PDF. Thanks Andr� "Andr? K." <andrekfm@freenet.de> wrote: > Hi > > Do you know a software (Freeware) who can editit PDF documents. > I have to add comments in a PDF and save them again as PDF. kword (http://www.koffice.org) -- Alain Borel <aborel@uiuc.edu> Thanx, but I don`t need such a big one. I'm lokking for a small freeware tool for our customers. They want to add comments in PDF files send the files to us and we have to

search a waveform for the time or index.
I would like to search a waveform for a particular percentage y value on the waveform and return either the index from which I can genereate the time by mutliplying dt by the index or obtain the time value directly. I tried the search Waveform.vi, but this appears to affect the display of the original waveform. The closest I can get is with the Threshold 1D array.vi. All the other utilities produce an index of zero or affect the display of the original waveform. The subvi is attached. Percentage Change Cursor.vi: http://forums.ni.com/attachments/ni/170/148627/1/Percentage Change Cursor.vi New version of subvi with default values for NI Application Engineer. &nbsp; Percentage Change Cursor.vi: http://forums.ni.com/attachments/ni/170/149045/1/Percentage Change Cursor.vi