home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
lbl_anom.zip
/
LABEL.COD
< prev
next >
Wrap
Text File
|
1989-01-23
|
23KB
|
1,043 lines
//
// Module Name: LABEL.COD
// Description: Define Application menus and program structure.
//
Label (.lbg) Program Template
-----------------------------
Version 1.0
Ashton-Tate (c) 1987
{include "label.def";
include "builtin.def";
//
// Enum string constants for international translation
//
enum wrong_class = "Can't use LABEL.GEN on non-label objects. ",
label_empty = "Label design was empty. ",
more_samples = "Do you want more samples? (Y/N)",
gen_request = "Generation request cancelled. ",
temp_file_error =
"File $$$LAB.TMP already exists. Possible file lock collision. Retry? ";
//
if frame_class != label then
pause(wrong_class + any_key);
return 0;
endif
//---------------------------
// Declare working variables
//---------------------------
var lblname, // Name of label file program
lblpath, // Path to write label file
default_drive, // dBASE default drive
crlf, // line feed
line, // Line counter for outputing number of "?'s"
isfirst, // Logical work variable
mrows, // Number of rows that the label uses
mcolumns, // Number of columns in label
lbl_vspace, // Number of characters between labels
lbl_wide, // Label width
lbl_hspace, // How tall the label is
numflds, // Number of fields used in label
style, // Style attribute assigned to the field/text
current_column, // Current column number
first_combine, // text or field is first in the chain of combined data
combine, // combine fields flag
new_line, // is the next field on a new line
i, j, x, temp, ni, // temporary usage variables
first_item, // relative element number when repeating columns
item_number, // current item number
count, // number of text and field items
current_row,
previous_row,
next_row,
blank_line,
printed_lines,
previous_set_was_blank,
number_of_blankable_lines,
current_element,
response,
long_line // calculated expression possibly exceeds line
;
//-------------------------------------------------
// Assign starting values to some of the variables
//-------------------------------------------------
crlf = chr(10);
current_element=2;
item_number = isfirst = mcolumns = first_combine = new_line = next_row = 1;
count = line = mrows = numflds = current_column = combine = long_line = 0;
lbl_vspace = nul2zero(LABEL_VSPACE);
lbl_wide = LABEL_WIDE;
lbl_hspace = nul2zero(LABEL_HSPACE);
blank_line = 1;
current_row = 0;
previous_row = -1;
printed_lines = 0;
number_of_blankable_lines=0;
foreach ELEMENT ecursor
if COUNTC(ecursor) > 1 && !eoc(ecursor) then
previous_row = current_row = Row_Positn;
do while !eoc(ecursor)
if Row_Positn > previous_row then
number_of_blankable_lines=number_of_blankable_lines+blank_line;
blank_line=1;
previous_row=Row_Positn;
++printed_lines;
endif
if blank_line then
if FLD_VALUE_TYPE == 78 then
if not AT("Z",FLD_PICFUN) then
blank_line=0;
endif
else
if Text_Item then
blank_line=0;
endif
if FLD_VALUE_TYPE != 67 then
blank_line=0;
endif
endif
endif
++ecursor;
enddo
number_of_blankable_lines=number_of_blankable_lines+blank_line;
++printed_lines;
--ecursor;
previous_row=Row_Positn+1;
endif
next
blank_line=0;
default_drive = STRSET(_defdrive);
lblname = FRAME_PATH + NAME;
lblpath = FRAME_PATH;
if not FILEOK(lblname) then
if FILEDRIVE(NAME) || !default_drive then
lblname=NAME;
if FILEDRIVE(NAME) then
lblpath=FILEDRIVE(NAME)+":"+FILEPATH(NAME);
else
lblpath=FILEPATH(NAME);
endif
else
lblname=default_drive + ":" + NAME;
lblpath=default_drive + ":";
endif
endif
if number_of_blankable_lines then
response="Y";
do while FILEEXIST(lblpath+"$$$LAB.TMP") && upper(response) == "Y";
response=ASKUSER(temp_file_error,"Y",1);
enddo
if upper(response) == "Y" then
if not CREATE(lblpath+"$$$LAB.TMP") then;
PAUSE("$$$LAB.TMP"+".LBG"+read_only+any_key);
response="N";
endif
endif
if upper(response) != "Y" then
PAUSE(gen_request+any_key);
return 0;
endif
endif
if not CREATE(lblname+".LBG") then;
PAUSE(fileroot(lblname)+".LBG"+read_only+any_key);
return 0;
endif
}
* Program............: {lblname}.LBG
* Date...............: {LTRIM(SUBSTR(DATE(),1,8))}
* Version............: dBASE IV, Label {FRAME_VER}
*
* Label Specifics:
* Wide - {lbl_wide}
* Tall - {label_tall}
* Indentation - {nul2zero(label_lmarg)}
* Number across - {label_nup}
* Space between - {lbl_hspace}
* Lines between - {lbl_vspace}
* Blankable lines - {number_of_blankable_lines}
* Print formatted - {printed_lines}
*
PARAMETER ll_sample
*-- Set printer variables for this procedure only
PRIVATE _peject, _ploffset, _wrap
*-- Test for End of file
IF EOF()
RETURN
ENDIF
IF SET("TALK")="ON"
SET TALK OFF
gc_talk="ON"
ELSE
gc_talk="OFF"
ENDIF
gc_space = SET("SPACE")
SET SPACE OFF
gc_time=TIME() && system time for predefined field
gd_date=DATE() && system date " " " "
gl_fandl=.F. && first and last record flag
gl_prntflg=.T. && Continue printing flag
gn_column=1
gn_element=0
gn_line=1
gn_memowid=SET("MEMOWIDTH")
SET MEMOWIDTH TO 254
gn_page=_pageno && capture page number for multiple copies
_plineno=0
{if LABEL_LMARG then}
_ploffset = _ploffset + {LABEL_LMARG}
{endif}
_wrap = .F.
IF ll_sample
DO Sample
IF LASTKEY() = 27
RETURN
ENDIF
ENDIF
*-- Setup Environment
ON ESCAPE DO prnabort
{numflds=FRAME_NUM_OF_FIELDS;}
{if LABEL_NUP > 1 && numflds then}
*-- Initialize array(s) for {LABEL_NUP} across labels
DECLARE isfound[{LABEL_NUP-1}]
DECLARE tmp4lbl[{LABEL_NUP-1},{numflds}]
{endif}
{if number_of_blankable_lines then}
DECLARE gn_line2[{label_nup}]
{endif}
PRINTJOB
{x=0;}
{foreach FLD_ELEMENT k}
//
// only if there is a fieldname assigned to the calculated field
//
{if FLD_FIELDTYPE == Calc_data && FLD_FIELDNAME then}
{ if !x then}
*-- Initialize calculated variables.
{ endif}
{FLD_FIELDNAME}=\
{case FLD_VALUE_TYPE of}
{68: // Date }CTOD(SPACE(8))
{70: // Float }FLOAT(0)
{76: // Logical}.F.
{78: // Numeric}INT(0)
{otherwise:}""
{endcase}
{ ++x;}
{endif}
{next k;}
*-- set page number for multiple copies
_pageno=gn_page
DO WHILE FOUND() .AND. .NOT. EOF() .AND. gl_prntflg
{LMARG(4);}
{if LABEL_NUP > 1 and numflds then}
{isfirst=1;}
{x=1;}
STORE .F. TO \
{init_array:}
{if isfirst then}
{ isfirst=0;}
{else}
,\
{endif}
isfound[{x}]\
{++x;}
{if x < LABEL_NUP then goto init_array endif}
{x=0;}
{i=1;}
{arcopy:}
{ if x then}
IF FOUND() .AND. .NOT. EOF()
{ LMARG(7);}
{ endif}
{ calcflds();}
//
{foreach FLD_ELEMENT i}
tmp4lbl[{x+1},{i}]=\
{case FLD_FIELDTYPE of}
{Tabl_data:}
{ if FLD_VALUE_TYPE == 77 then}
MLINE({FLD_FIELDNAME},1)
{ else}
{ FLD_FIELDNAME}
{ endif}
{Calc_data:}
{ if FLD_FIELDNAME then}
{ FLD_FIELDNAME}
{ else}
{ foreach FLD_EXPRESSION exp in i}
{ FLD_EXPRESSION}\
{ next}
{ endif}
{Pred_data:}
{ case FLD_PREDEFINE of}
{ 0: // Date}
gd_date
{ 1: // Time}
gc_time
{ 2: // Recno}
RECNO()
{ 3: // Pageno}
_pageno
{ endcase}
{endcase}
{next i;}
//
{ if x then}
isfound[{x}]=.T.
{ endif}
CONTINUE
{ if x then}
{ LMARG(4);}
ENDIF
{ endif}
{ ++x;}
{ if x < LABEL_NUP-1 then
goto arcopy;
endif
}
IF FOUND() .AND. .NOT. EOF()
{LMARG(7);}
{calcflds();}
isfound[{x}]=.T.
{LMARG(4);}
ENDIF
{else}
{calcflds();}
{endif}
//
{if number_of_blankable_lines then}
gn_line=\
{ if previous_row - number_of_blankable_lines > 0 then
previous_row - number_of_blankable_lines}
{ else}
0
{ endif
endif
blank_line=0;
printed_lines=0;
previous_set_was_blank=0;}
//
// Main loop (inner loop to handles fields on each line by # of columns)
//
{foreach ELEMENT k}
{ if ELEMENT_TYPE == @Band_Element then}
{ ++k; ++item_number;}
{ if eoc(k) then}
{ exit;}
{ endif}
{ endif}
{ ++count;}
{ LMARG(4);}
//
{ check4_blank_line:
if !blank_line then
blank_line=1;
current_element=COUNTC(k);
previous_row=Row_Positn;
previous_set_was_blank=0;
printed_lines=0;
do while !eoc(k);
if Row_Positn > previous_row then
++printed_lines;
previous_set_was_blank=previous_set_was_blank+blank_line;
if Row_Positn > previous_row+1 then
blank_line=0;
else
blank_line=1;
previous_row=Row_Positn;
endif
endif
if blank_line then
if FLD_VALUE_TYPE == 78 then
if not AT("Z",FLD_PICFUN) then
blank_line=0;
endif
else
if Text_Item then
blank_line=0;
endif
if FLD_VALUE_TYPE != 67 then
blank_line=0;
endif
endif
endif
if !blank_line then
exit
endif
++k;
enddo
if eoc(k) then
--k;
++printed_lines;
if blank_line then
previous_set_was_blank=previous_set_was_blank+blank_line;
previous_row=Row_Positn;
endif
endif
do while COUNTC(k) > current_element;
--k;
enddo
if previous_set_was_blank then
blank_line=previous_set_was_blank;
else
blank_line=0;
printed_lines=0;
endif
else}
{ if blank_line then
--blank_line;
endif}
{ if label_nup > 1 then}
{LMARG(4);}
{ else}
{LMARG(1);}
{ endif}
{ if blank_line then}
ELSE
lc_ret=.T.
{ endif}
{ if label_nup > 1 then}
ENDIF
{ endif}
{LMARG(1);}
ENDIF
RETURN lc_ret
{ if blank_line > 0 then}
FUNCTION ___{nul2zero(Row_Positn)}1
lc_ret=.F.
{ if label_nup > 1 && mrows then
conditional_if_for_blank_line(k, 7);
else
conditional_if_for_blank_line(k, 4);
endif
endif
if !blank_line then
++line;
LMARG(4);
APPEND(lblname+".LBG");
endif
endif
}
//---------------------
// Process blank lines
//---------------------
{ nextline:}
{ if line < Row_Positn then}
{ if !blank_line || blank_line == printed_lines then}
?
{ endif}
{ ++line; goto nextline;}
{ endif}
//--------------------
// End of blank lines
//--------------------
{ if previous_set_was_blank && !blank_line then goto check4_blank_line endif
if previous_set_was_blank && blank_line && blank_line==printed_lines then}
*-- Check for blank lines
DO chk4null WITH {line}, {printed_lines}, {printed_lines*label_nup}
{ APPEND(lblpath+"$$$LAB.TMP");}
{LMARG(1);}
*
*-- The next\
{if printed_lines*label_nup > 1 then}
{printed_lines*label_nup}\
{endif}
function file\
{if number_of_blankable_lines > 1 then}s{endif} are for blank line checking
FUNCTION ___{line}1
lc_ret=.F.
{ conditional_if_for_blank_line(k, 4);}
{ endif}
//
{ mrows = 0;}
{ first_item = item_number;}
//
{ repeat:}
//
{ if new_line then}
{ if !mrows then}
{ if !blank_line then}
{LMARG(4);}
{ endif}
{ else}
{ if blank_line then}
{ if mrows < label_nup then}
{ if mrows > 1 then LMARG(4); else LMARG(1); endif}
{ if blank_line > 1 then}
ELSE
lc_ret=.T.
{ endif}
ENDIF
{ endif}
{ if mrows > 1 then}
{LMARG(1);}
ENDIF
{ endif}
RETURN lc_ret
FUNCTION ___{nul2zero(Row_Positn)}{mrows+1}
lc_ret=.F.
{ if mrows then}
*-- Column {mrows+1}
IF isfound[{mrows}]
{LMARG(4);}
{ endif}
{ if mrows then}
{ conditional_if_for_blank_line(k,7);}
{ else}
{ conditional_if_for_blank_line(k,4);}
{ endif}
{ endif}
{ endif}
{ if LABEL_NUP > 1 && first_item == item_number then}
{ if !blank_line then}
*-- Column {mrows+1}
{ if mrows then}
IF isfound[{mrows}]
{ if !blank_line then}
{LMARG(7);}
{ endif}
{ endif}
{ endif}
{ endif}
{ if first_combine then}
_pcolno = {Col_Positn+(mrows*(lbl_wide+lbl_hspace))}
{ endif}
?? \
{ else}
{ if long_line then}
?? \
{ long_line=0;}
{ else}
,\
{ endif}
{ endif}
//
{ni=0;}
{ case ELEMENT_TYPE of}
//
{ @Text_Element:}
//
{x=Col_Positn;}
{i=LEN(Text_Item);}
{if i == 237 then}
{ foreach Text_Item fcursor in k}
{ if ni then}
{ i=i+LEN(Text_Item);}
{ temp=Text_Item;}
{ endif}
{ ++ni;}
{ next}
{endif}
{current_column=x+i;}
//
{ @Fld_Element:}
//
{x=Col_Positn;}
{i=FLD_REPWIDTH;}
{if i > 237 then}
{ foreach FLD_TEMPLATE fcursor in k}
{ if ni then}
{ temp=FLD_TEMPLATE;}
{ endif}
{ ++ni;}
{ next}
{endif}
{current_column=x+i;}
//
{ endcase}
//
// is the next element on the same line
//
{ ++k;}
{ if (not EOC(k)) && line == Row_Positn then}
{ new_line=0;}
//
// is the next element flush with previous element
//
{ if current_column == Col_Positn then}
{ combine=1;}
{ else}
{ combine=0;}
{ endif}
{ else}
{ new_line=1;}
{ next_row=Row_Positn;}
{ endif}
{ --k;}
//-----------------------------------------------
// Determine what type of data we are processing
//-----------------------------------------------
{ case ELEMENT_TYPE of}
//
{ @Text_Element:}
//
{if i > 70 then}
;
{ seperate(Text_Item);}
{ if ni then}
+ "{temp}";
{ endif}
{else}
"{Text_Item}" \
{endif}
//
{ @Fld_Element:}
//
{ if mrows+1 < LABEL_NUP then}
tmp4lbl[{mrows+1},{mcolumns}] \
{ else}
{ putfld(k);}
{ endif}
{ ++mcolumns;}
{ endcase}
//
{ if ELEMENT_TYPE == @Fld_Element then}
//
{ if !FLD_FIELDTYPE || FLD_FIELDTYPE == Calc_data ||
(FLD_FIELDTYPE == Pred_data && FLD_PREDEFINE > 1) then}
//
{ if FLD_VALUE_TYPE == 67 then
j=FLD_TEMPLATE+temp;
if FLD_LENGTH == FLD_REPWIDTH && j == REPLICATE("X",FLD_LENGTH) then
j="";
endif
else
j="1";
endif}
//
{ if FLD_PICFUN || j then}
PICTURE \
{ endif}
//
{ if FLD_PICFUN then}
"@{FLD_PICFUN}\
{ if j then}
\
{ else}
" \
{ endif}
{ endif}
//
{ if j then}
{ if i > 70 then}
{ if FLD_PICFUN then}
"+;
{ else}
;
{ endif}
{ seperate(FLD_TEMPLATE);}
{ if ni then}
+ "{temp}";
{ endif}
{ else}
{ if !FLD_PICFUN then}
"\
{ endif}
{FLD_TEMPLATE}" \
{ endif}
{ endif}
{ endif}
//
{ endif}
//
{ if FLD_STYLE then}
{ style=getstyle(FLD_STYLE);}
STYLE "{style}" \
{ endif}
{ if first_combine then}
AT {Col_Positn+(mrows*(lbl_wide+lbl_hspace))} \
{ if combine then}
{ first_combine=0;}
{ endif}
{ else}
{ if not combine then first_combine=1; endif}
{ endif}
//
// position to next element
//
{ ++k; ++item_number;}
//
{ if !new_line || (!EOC(k) && line == Row_Positn) then
if !new_line then}
{ if long_line then}
,
{ else}
;
{ endif}
{ else}
,
{ long_line=0;}
{ endif
if !EOC(k) then
goto repeat;
endif}
{ else}
{ long_line=0;}
{ endif}
//
{ combine=0;}
{ first_combine=1;}
//
{ if LABEL_NUP-1 > mrows then}
,
{ if mrows && !blank_line then}
{ LMARG(4);}
ENDIF
{ endif}
{ ++mrows;}
{ backup_cursor:}
{ if item_number > first_item then}
{ --k; --item_number;}
{ if ELEMENT_TYPE == @Fld_Element then}
{ --mcolumns;}
{ endif}
{ goto backup_cursor;}
{ endif}
{ new_line=1;}
{ goto repeat;}
{ else}
{ if mrows && !blank_line then}
{ LMARG(4);}
ENDIF
{ endif}
{ mrows=0;}
{ --k; --item_number;}
{ endif}
//
{next k;}
{if blank_line then}
{ if label_nup > 1 then}
{LMARG(4);}
ENDIF
{ endif}
{LMARG(1);}
ENDIF
RETURN lc_ret
{endif}
{LMARG(4);}
{APPEND(lblname+".LBG");}
{if number_of_blankable_lines then}
{ if !blank_line then}
?
{ endif}
DO WHILE gn_line < {label_tall+lbl_vspace}
?
gn_line=gn_line+1
ENDDO
{else
lastline:
if line < LABEL_TALL+lbl_vspace then}
?
{ ++line;
goto lastline;
endif
endif}
CONTINUE
{LMARG(1);}
ENDDO
IF .NOT. gl_prntflg
SET MEMOWIDTH TO gn_memowid
SET SPACE &gc_space.
SET TALK &gc_talk.
ON ESCAPE
RETURN
ENDIF
ENDPRINTJOB
SET MEMOWIDTH TO gn_memowid
SET SPACE &gc_space.
SET TALK &gc_talk.
ON ESCAPE
RETURN
* EOP: {lblname}.LBG
PROCEDURE prnabort
gl_prntflg=.F.
RETURN
* EOP: prnabort
{if number_of_blankable_lines then
COPY(lblpath+"$$$LAB.TMP");
FILEERASE(lblpath+"$$$LAB.TMP");
APPEND(lblname+".LBG");
endif}
{if number_of_blankable_lines then}
PROCEDURE chk4null
*-- Parameters:
*
*-- 1) line number on the design surface
*-- 2) maximum number of printable lines
*-- 3) parameter 2 times number of labels across
*
PARAMETERS ln_line, ln_nolines, ln_element
gn_element=0
{ x=1;
do while x <= label_nup}
gn_line2[{x}]=ln_line
{ ++x;
enddo}
lc_temp=SPACE(7)
ll_output=.F.
DO WHILE gn_element < ln_element
gn_column=1
ll_output=.F.
DO WHILE gn_column <= {label_nup}
IF gn_line2[gn_column] < ln_line+ln_nolines
lc_temp=LTRIM(STR(gn_line2[gn_column]))+LTRIM(STR(gn_column))
DO WHILE ___&lc_temp.()
gn_element=gn_element+1
gn_line2[gn_column]=gn_line2[gn_column]+1
lc_temp=LTRIM(STR(gn_line2[gn_column]))+LTRIM(STR(gn_column))
ENDDO
gn_element=gn_element+1
gn_line2[gn_column]=gn_line2[gn_column]+1
ENDIF
gn_column=gn_column+1
ENDDO
IF ll_output
?
gn_line=gn_line+1
ENDIF
ENDDO
RETURN
* EOP: chk4null
{endif}
PROCEDURE SAMPLE
PRIVATE x,y,choice
DEFINE WINDOW w4sample FROM 15,20 TO 17,60 DOUBLE
choice="Y"
x=0
DO WHILE choice = "Y"
y=0
?
DO WHILE y < {LABEL_TALL}
x=0
DO WHILE x < {LABEL_NUP}
?? REPLICATE("X",{LABEL_WIDE})\
{if LABEL_HSPACE then}
+SPACE({LABEL_HSPACE})
{else}
{endif}
x=x+1
ENDDO
?
y=y+1
ENDDO
{if LABEL_VSPACE then}
x=0
DO WHILE x < {LABEL_VSPACE}
?
x=x+1
ENDDO
{endif}
ACTIVATE WINDOW w4sample
@ 0,3 SAY "{more_samples}";
GET choice PICTURE "!" VALID choice $ "NY"
READ
DEACTIVATE WINDOW w4sample
IF LASTKEY() = 27
EXIT
ENDIF
ENDDO
RELEASE WINDOW w4sample
RETURN
* EOP: SAMPLE
{if !count then pause(label_empty + any_key); endif}
{return 0;}
//--------------------------------
// End of main template procedure
// User defined function follows
//--------------------------------
{
define getstyle(mstyle);
var outstyle;
outstyle="";
if Bold & mstyle then outstyle=outstyle+"B"; endif
if Italic & mstyle then outstyle=outstyle+"I"; endif
if Underline & mstyle then outstyle=outstyle+"U"; endif
if Superscript & mstyle then outstyle=outstyle+"R"; endif
if Subscript & mstyle then outstyle=outstyle+"L"; endif
if User_Font & mstyle then
if 1 & mstyle then outstyle=outstyle+"1"; endif
if 2 & mstyle then outstyle=outstyle+"2"; endif
if 4 & mstyle then outstyle=outstyle+"3"; endif
if 8 & mstyle then outstyle=outstyle+"4"; endif
if 16 & mstyle then outstyle=outstyle+"5"; endif
endif
return outstyle;
enddef;
}
{define putfld(cursor);
var value,value2;
value=cursor.FLD_FIELDTYPE;}
{ if mrows+1 < LABEL_NUP then}
tmp4lbl[{mrows+1},{mcolumns}] \
{ else}
{case value of}
{Tabl_data:}
{ if cursor.FLD_VALUE_TYPE == 77 then}
MLINE({cursor.FLD_FIELDNAME},1)\
{ else}
{ cursor.FLD_FIELDNAME}\
{ endif}
{Calc_data:}
{ if cursor.FLD_FIELDNAME then}
{ cursor.FLD_FIELDNAME }\
{ else}
{ foreach FLD_EXPRESSION exp in cursor}
{ FLD_EXPRESSION}\
{ next}
;
{ long_line=1;}
{ endif}
{Pred_data:}
{ value2=cursor.FLD_PREDEFINE;}
{ case value2 of}
{ 0: // Date}
gd_date\
{ 1: // Time}
gc_time\
{ 2: // Recno}
RECNO()\
{ 3: // Pageno}
_pageno\
{ endcase}
{endcase}
\
{ endif}
{return;
enddef;
}
{
define conditional_if_for_blank_line(cursor2, page_offset);
var current_column, current_row;
}
*-- Test for blank line
IF LEN(TRIM( \
{ current_column=cursor2.Col_Positn;
current_element=COUNTC(cursor2);
current_row=cursor2.Row_Positn;
do while !eoc(cursor2) && cursor2.Row_Positn == current_row}
{ if cursor2.Col_Positn > current_column then}+ {endif}\
{ if cursor2.FLD_VALUE_TYPE == 78 then}
TRANSFORM(\
{ if mrows+1 < LABEL_NUP then}
tmp4lbl[{mrows+1},{mcolumns}],"\
{ else}
{ if cursor2.FLD_FIELDNAME then}
{cursor2.FLD_FIELDNAME},"\
{ else}
{ foreach FLD_EXPRESSION exp in cursor2}
{ FLD_EXPRESSION}\
{ next}
;
{ endif}
{ endif}
{ if cursor2.FLD_PICFUN then}
{ if not cursor2.FLD_FIELDNAME then}
,"\
{ endif}
@{cursor2.FLD_PICFUN} \
{ endif}
{cursor2.FLD_TEMPLATE}") \
{//
else
putfld(cursor2);
endif
++cursor2;
++mcolumns;
enddo
do while eoc(cursor2) || COUNTC(cursor2) > current_element;
--cursor2;
--mcolumns;
enddo}
)) > 0
{LMARG(page_offset);}
ll_output=.T.
{ return;
enddef
}
{
define nul2zero(numbr);
//
// if number is null convert to 0
//
if !numbr then numbr=0 endif;
return numbr;
enddef
}
{define calcflds();}
{foreach FLD_ELEMENT k}
{ if FLD_FIELDNAME && FLD_FIELDTYPE == Calc_data then}
{FLD_FIELDNAME}=\
{foreach FLD_EXPRESSION j in k}
{FLD_EXPRESSION}
{next}
{ endif}
{next k;}
{return;}
{enddef}
{
define seperate(string);
var x,y,length;
x=1;
length=LEN(string);
moreleft:
if x < length then
if x != 1 then}
+ \
{ endif
if x+70 <= length then y=70; else y=length-x+1; endif}
"{SUBSTR(string,x,y)}";
{ x=x+70;
goto moreleft;
endif
return;
enddef
}
// EOP: LABEL.COD