need help with small utility 
Author Message
 need help with small utility

I need help!

I don't write Clipper code anymore, but I have a sudden need for a
little utility.

This program needs to take a DBF filename as a commmand-line parm, and
dump the DBF data to the screen, using a special character such as "<"
as a column delimiter.

I've got my old Clipper 5.02 installed, but the manuals are long gone.

So far I've got:

Parameters DBFfile

if type("DBFfile") != "U"
   use &DBFfile
   list
endif

but I can't remember how to specify the column delimiter...

Since I don't know the name of the DBF file, or even its structure, I
can't do something like
   list  field1, "<", field2, "<", field3, ...

Can anyone help me?



Fri, 08 Dec 2000 03:00:00 GMT  
 need help with small utility

Gene,

proc Main( cDBF, cDelimiter )
 local nCtr
 use ( cDBF ) alias TempFile
 do while !eof()
   ? fieldget( 1 )
   for nCtr := 2 to fcount()
     ?? cDelimiter
     ?? fieldget( nCtr )
   next
   skip
 enddo
 use
 return

This will work with any version starting with 5.01.

If you have other questions, contact me via private E-mail.

You cannot specify a column delimiter, so you are forced to do this kind of
thing.

Karl



Quote:
> I need help!

> I don't write Clipper code anymore, but I have a sudden need for a
> little utility.

> This program needs to take a DBF filename as a commmand-line parm, and
> dump the DBF data to the screen, using a special character such as "<"
> as a column delimiter.

> I've got my old Clipper 5.02 installed, but the manuals are long gone.

> So far I've got:

> Parameters DBFfile

> if type("DBFfile") != "U"
>    use &DBFfile
>    list
> endif

> but I can't remember how to specify the column delimiter...

> Since I don't know the name of the DBF file, or even its structure, I
> can't do something like
>    list  field1, "<", field2, "<", field3, ...

> Can anyone help me?



Fri, 08 Dec 2000 03:00:00 GMT  
 need help with small utility

Hi Gene,

I don't want to rain on your parade, but if you are only wanting to get
the job done, does it matter what method you use?

I would suggest that you simply open the .dbf file with MS-Excel. You
can then set print areas, sort, etc to your heart's content without
having to relearn CA-anthing and get hot and sweaty ...

HTH,

Ross McKenzie
ValuSoft
Melbourne Australia

Quote:

> I need help!

> I don't write Clipper code anymore, but I have a sudden need for a
> little utility.

> This program needs to take a DBF filename as a commmand-line parm, and
> dump the DBF data to the screen, using a special character such as "<"
> as a column delimiter.

> Can anyone help me?



Sat, 09 Dec 2000 03:00:00 GMT  
 need help with small utility

Gene

function Main( P1 )
        use ( P1 ) alias TempFile
        browse()
        use
 return

Doesn't let you set the delimiter but it will let you browse the data.

HTH
--
Steve Quinn
BRUTE Computer Services - Australia

http://www.brutecom.com.au



Quote:
> I need help!

> I don't write Clipper code anymore, but I have a sudden need for a
> little utility.

> This program needs to take a DBF filename as a commmand-line parm, and
> dump the DBF data to the screen, using a special character such as "<"
> as a column delimiter.

> I've got my old Clipper 5.02 installed, but the manuals are long gone.

> So far I've got:

> Parameters DBFfile

> if type("DBFfile") != "U"
>    use &DBFfile
>    list
> endif

> but I can't remember how to specify the column delimiter...

> Since I don't know the name of the DBF file, or even its structure, I
> can't do something like
>    list  field1, "<", field2, "<", field3, ...

> Can anyone help me?



Sat, 09 Dec 2000 03:00:00 GMT  
 need help with small utility

Hi

As far as I know, there is no way to specify the list delimiter.
But you might try something like:

FUNCTION main( DBFFile )

LOCAL nInc, nFields
IF ValType( DBFfile ) == "C"  // !
    USE ( DBFfile ) ALIAS AnyName NEW
    nFields := AnyName->(FCount())
    DO WHILE !AnyName->(EOF())
        FOR nInc = 1 TO nFields
            ?? AnyName->(FieldGet( nInc ))
            ?? '<'
        NEXT
        ?
        AnyName->(DBSkip())
    ENDDO
ENDIF
RETURN NIL

That'll do the trick!
HTH,

Bas Krommenhoek


please remove "~nospam" to reply.



Sat, 09 Dec 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. A little utility is needed - Can anyone help !?!

2. Help needed on TSR utilities with TIMER interrupt

3. Need help RE: Error RTS 148 - utility.cbl (0/1)

4. cw 2.0003, filter box on report properties is too small, need help...mucho

5. Help! Need Eiffel small example programs

6. Need help with small example

7. Help needed writing small program -- possible?

8. Need help on small programming problem.

9. [Need help: Clock function in smaller unit...

10. Need help: Clock function in smaller unit...

11. Need Help for small Prolog Exercise

12. need a small bit of help

 

 
Powered by phpBB® Forum Software