DO mk_dir WITH m.ean_path
fh = fcreate(m.ean_path + "cenik.txt")
DO open_database
IF m.issql
	USE (m.sqlprefix+"rexportcw") IN 0
ELSE
	IF !USED("karty")
		USE (m.fn_karty) IN 0
	ENDIF 
	USE vexportcw IN 0 ALIAS rexportcw
ENDIF 
SELECT rexportcw
SCAN ALL 
	=FPUTS(m.fh, PADR(ALLTRIM(kod),13) + ";" + LEFT(STRTRAN(nazev, ";", ""), 30))
ENDSCAN 
= FCLOSE(m.fh)
DO pozavirej WITH "rexportcw, karty"