Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : UI_CLP56.ZIP
Filename : ALLCLIP.TEM
<
*
* ALLCLIP.TEM Version 5.6 (c) 1990
*
* Generates:
*
* A complete programming system generating Clipper 87 code depending
* upon what kind of boxes are on screen at generation time
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
************************
*** template startup ***
************************
* load libraries used by this template
load_lib("allclip")
load_lib("varfunsc")
*******************************
*** end of template startup ***
*******************************
save_file = file
makefile = .t.
sys = grab_box("SYSTEM")
mnu = grab_box("MAINMENU")
pickkey = write_header()
<
<
**********************************
* Set up window for all messages,*
* error or otherwise *
**********************************
<
<
bmrow = 24
bmcolumn = 0
bmcolor = "+W/BG,+W/N"
<
bmrow = {bm.row}
bmcolumn = {bm.column}
bmcolor = "{bm.color + ',+W/N'}"
<
cx = uncolor(bmcolor,mono)
SET COLOR TO &cx
@ bmrow,bmcolumn SAY space(80 - (2 * bmcolumn))
messages(3,'Please Stand By --- Initializing Databases',0,'')
<
<
<
<
<
<
<
<
<
<
* Open database GEN_HELP (alias GEN_HELP
*
* Indexes used:
* 1: GEN_HELP ('upper(topic)')
*
SELECT 0
IF .NOT. FILE("GEN_HELP.DBF")
PRIVATE names[2],types[2],lens[2],decs[2]
names[1] = "PAGE"
types[1] = "M"
lens[1] = 10
decs[1] = 0
names[2] = "TOPIC"
types[2] = "C"
lens[2] = 16
decs[2] = 0
create_dbf("GEN_HELP",names,types,lens,decs)
ENDIF
USE GEN_HELP ALIAS GEN_HELP
* first, check the existence of needed indexes
IF .not. file("GEN_HELP{ndxtag}")
messages(3,'Indexing GEN_HELP (upper(topic))',1,'')
INDEX ON upper(topic) TO GEN_HELP
ENDIF
* now SET INDEX
SET INDEX TO GEN_HELP
<
<
<
<
include_option_text_here(sys,"BEGIN",.t.)
if mnu
? "MAINMENU()"
else
? "* SUBMODULE -- contains functions called by a mainline program"
? "*"
? "* Must be compiled separated and linked together with calling prog"
endif
<
<
SET CURSOR ON
<
CLOSE DATABASES
SET COLOR TO W/N
CLEAR
<
* End program
<
<
<
<
<
<
HELP WANTED FILE
Help needed on following items:
<
<
private next_screen
next_screen = wwfile
do while next_screen
q_indent = 0
? "* BOXES FROM {next_screen} *"
? "********************** MENUS ******************************** "
for all boxes where (box.popup .and. is_menu(box)) .and. upper(box.slot1) <> "PICK"
menu_write(box)
endfor
? " "
? "********************* BROWSE BOXES **************************"
for all boxes where (box.popup .and. is_browse(box))
browse_write(box)
endfor
? " "
? "********************* ENTRY BOXES ***************************"
for all boxes where (box.popup .and. is_entry(box))
entry_write(box)
endfor
? " "
? "********************* MEMO BOXES ****************************"
for all boxes where (box.popup .and. is_memo(box))
memo_write(box)
endfor
? " "
? "********************* ACHOICE BOXES *************************"
for all boxes where (box.popup .and. is_achoice(box))
achoice_write(box)
endfor
? " "
? "********************* PLAIN BOXES ***************************"
for all boxes where (box.popup .and. is_plain(box))
justabox_write(box)
endfor
? " "
? "********************* MENU PICK BOXES ***********************"
for all boxes where (box.popup .and. is_menu(box)) .and. upper(box.slot1) = "PICK"
menu_write(box)
endfor
? " "
? "********************* MISC. FUNCTION ************************"
write_field_functions()
write_pick_functions()
write_pick_me()
write_memvalid()
if mnu
? " "
? "********************* STANDARD FUNCTIONS *******************"
write_standard_functions()
endif
next_screen = get_screen()
enddo
end_file()
<
* End of File
<
<
<
<
**************************************
***
*** {lower(menub.name)}
*** MENU PICK BOX
**************************************
<
**************************************
***
*** {lower(menub.name)}
*** MENU BOX
**************************************
<
FUNCTION {lower(menub.name)}
<
PRIVATE zkey, zhold, sys_color,{name}
sys_color = SETCOLOR()
<
<
<
<
<
<
<
<
<
zkey = 1
<
zhold1 = 1
<
DO WHILE .t.
<
<
<
<
cx = uncolor("{menub.contents.color}",mono)
SET COLOR TO &cx
<
<
<
dwn = .f.
across = .f.
prev_row = first_opt_in_box(menub).row
prev_col = first_opt_in_box(menub).col
for all options in menub
if option.row <> prev_row
dwn = .t.
endif
if option.col <> prev_col
across = .t.
endif
prev_row = option.row
prev_col = option.col
endfor
do case
case (dwn .and. across)
type = 3
case dwn
type = 1
case across
type = 2
endcase
hold = 0
for all options in menub
hold = hold + 1
endfor
optarray = array('OPT_ARRAY',hold)
? "zmenu = {hold}"
if maine
? "zhold2 = zmenu"
endif
optkey = ""
for all options in menub
optarray[count] = option
holder = iif(len(option.trigger) > 0,option.trigger[1]," ")
if "" = trim(holder) .or. at(holder,ltrim(digest_text(box_text(option,0,0)))) = 0
holder = substr(ltrim(digest_text(box_text(option,0,0))),2,1)
endif
optkey = optkey + holder
? "mprompt[{count}] = {digest_text(box_text(option,0,0))}"
endfor
if upper(menub.slot1) <> "PICK"
for all options in menub
if .not. empty(option.slot3)
? "mhelp[{count}] = '{option.slot3}'"
help_wanted(option.slot3)
else
? "mhelp[{count}] = {ltrim(digest_text(box_text(option,0,0)))}"
help_wanted(ltrim(digest_text(box_text(option,0,0))))
endif
endfor
endif
for all options in menub
if type = 1 .or. type = 3
? "mr[{count}] = {option.row}"
endif
if type = 2 .and. count = 1
? "g_col = {option.col}"
endif
if type = 2 .or. type = 3
? "mc[{count}] = {option.col}"
endif
endfor
holder = number_of_options_in_box(menub)
if type < 3
if type = 1
? "STORE {option.col} TO mc[1]"
for i = 2 to holder
?? ",mc[{i}]"
endfor
else
? "STORE {option.row} TO mr[1]"
for i = 2 to holder
?? ",mr[{i}]"
endfor
endif
endif
for all options in menub
if .not. empty(option.message) .and. upper(menub.slot1) <> "PICK"
? 'mmessage[{count}] = "{option.message}"'
else
? 'mmessage[{count}] = ""'
endif
endfor
? "optcols = uncolor('{menub.contents.color}',mono)"
? "keycols = uncolor('{key_color(menub,menub.contents.color,0)}',mono)"
? "unkeycols = uncolor('{key_color(menub,(first_opt_in_box(menub)).color_selected,1)}',mono)"
? "revcols = uncolor('{(first_opt_in_box(menub)).color_selected}',mono)"
<
<
IF zhold1 <> zkey
SET COLOR TO &optcols
@ mr[zhold1], mc[zhold1] SAY mprompt[zhold1]
zhold1 = zkey
SET COLOR TO &revcols
@ mr[zhold1], mc[zhold1] SAY mprompt[zhold1]
cx = uncolor(bmcolor,mono)
SET COLOR TO &cx
@ bmrow,bmcolumn + 1
@ bmrow,bmcolumn + 1 SAY mmessage[zhold1]
SET COLOR TO &optcols
ELSE
zkey = menu({type},zkey,{holder},'{optkey}')
ENDIF
<
zkey = menu({type},1,{holder},'{optkey}')
<
DO CASE
CASE zkey <1
zx = zkey
EXIT
<
<
<
<
CASE zkey = {herehold}
<
action_comics = optarray[menus].action[1]
if upper(menub.slot1) = "PICK"
xbox = grab_field(menub.slot2)
if len(action_comics) < disp_len(xbox)
action_comics = action_comics + space(disp_len(xbox)-len(action_comics))
endif
? "KEYBOARD '{action_comics}'"
? "EXIT"
else
xbox = grab_box(action_comics)
if .not. xbox
do case
case upper(action_comics) = "PACK"
? 'answer = messages(2,"Pack all Databases? ","L","pack_it",.T.)'
? "IF answer"
q_indent = 15
pack_all_dbfs()
q_indent = 12
? "ENDIF"
case upper(action_comics) = "INDEX"
? 'answer = messages(2,"Index all Databases? ","L","index_it",.T.)'
? "IF answer"
q_indent = 15
reindex_all_dbfs()
q_indent = 12
? "ENDIF"
case upper(action_comics) = "RECALL"
? 'answer = messages(2,"Recall all deleted records in all Databases? ","L","delete_it",.T.)'
? "IF answer"
q_indent = 15
recall_all_dbfs()
q_indent = 12
? "ENDIF"
otherwise
for i = 1 to 5
if "" <> trim(optarray[menus].action[i])
? optarray[menus].action[i]
endif
endfor
endcase
else
if maine
? "zhold1 = zkey"
endif
write_box_code(xbox," ")
endif
endif
<
<
ENDCASE
<
DO CASE
CASE lastkey() = left_arrow
zkey = IIF(zhold1 = 1, 1, zhold1-1)
CASE lastkey() = right_arrow
zkey = IIF(zhold1 <> zhold2, zhold1+1, zhold2)
CASE lastkey() = down_arrow
zkey = IIF(zx<>0,zx,zhold1)
CASE LASTKEY() = esc .OR. LASTKEY() = sp_bar .OR. zx = -28 .OR. zx = 0
zkey = zhold1
CASE zx > 0
zkey = zx
OTHERWISE
key = -zx
ENDCASE
<
ENDDO
<
<
<
<
SET COLOR TO &sys_color
RETURN ""
* End of Function
<
<
<
<
<
***************************************
***
*** {lower(b.name)}
*** PLAIN POP-UP BOX
**************************************
FUNCTION {lower(b.name)}
<
PRIVATE zkey, zhold, sys_color,{name}
sys_color = SETCOLOR()
<
q_indent = 3
pop_box(b)
include_option_text_here(b,"BEGIN",.t.)
for all vars in b
calc_var(var.name, var)
endfor
init_all_memvars_in_box(b)
say_all_vars_in_box(b)
if has_get_var(b)
get_all_vars_in_box(b)
? "SET CURSOR ON"
? "READ"
? "SET CURSOR OFF"
endif
if .not. empty(b.slot1) .or. has_get_var(b)
do case
case upper(b.slot1) = "INDEX"
reindex_all_dbfs()
case upper(b.slot1) = "PACK"
pack_all_dbfs()
case upper(b.slot1) = "RECALL"
recall_all_dbfs()
endcase
<
zkey = 0
<
zkey = inkey(0)
DO CASE
CASE zkey = F1
<
<
<
<
<
DO helpme WITH "","","{topic}"
<
CASE zkey = 27
zx = 0
CASE zkey = 19 .OR. zkey = 4 .OR. (UPPER(CHR(zkey)) >= "A" .AND. UPPER(CHR(zkey)) <= "Z")
zx = -zkey
OTHERWISE
zx = 0
ENDCASE
<
<
<
<
SET COLOR TO &sys_color
RETURN (zkey)
* End of procedure
<
<
<
<
<
<
**************************************
***
*** {lower(b.name)}
*** MEMOEDIT TYPE BOX
**************************************
FUNCTION {lower(b.name)}
PARAMETER insert
<
PRIVATE zkey, sys_color, sys_alias,{name}
<
private mf,holder
q_indent = 3
write_box_top(b)
for all fields in b
if field.type = "M"
mf = field
endif
next
? "edit_memo('{mf.name}',{mf.row},{mf.col},{b.bottom-(mf.row-b.top)},{b.right-(mf.col-b.left)},'{mf.color}',{b.right+b.left},insert)"
<
<
<
<
RETURN ""
* End of procedure
<
<
<
<
**************************************
*** ***
*** {lower(b.name)}
*** ACHOICE BOX ***
**************************************
FUNCTION {lower(b.name)}
PRIVATE x,holder,init_row,chosen,cx
holder = 1
init_row = 0
chosen = 1
<
ff = first_var_in_box(b)
if number_of_vars_in_box(b) > 1
? "PRIVATE zvar[{number_of_vars_in_box(b)}], zret[{number_of_vars_in_box(b)}],on_off[{number_of_vars_in_box(b)}]"
for all vars in box
? "zvar[{count}] = '{var.name}'"
? "zret[{count}] = '{var.slot3}'"
? "on_off[{count}] = {iif(empty(var.slot2),.t.,var.slot2)}"
next
else
? "PRIVATE {ff.name}[{ff.slot2}],on_off[{ff.slot2}]"
? "AFILL(on_off,.t.)"
? "{ff.slot3}"
endif
say_col = say_color(b)
write_box_top(b)
* find amount of lines to achoice
tall_clear = 0
b_row = (ff.row - b.top) + iif(b.outline.type,1,0)
do while len(trim(box_text(b,b_row,1,b.width-2))) = 0 .and. b_row < (b.height - iif(b.outline.type,0,1))
tall_clear = tall_clear + 1
b_row = b_row + 1
enddo
? 'cx = uncolor("{b.contents.color},{say_col}",mono)'
? 'cx = cx + ",,,{iif(substr(b.color,1,1) = "+",substr(b.color,2),"W/N")}"'
? "SET COLOR TO &cx"
if upper(b.slot1) <> "CHOOSE"
? "DO WHILE LASTKEY() <> esc .AND. LASTKEY() <> sp_bar"
q_indent = 3
endif
? 'chosen = ACHOICE({ff.row}, {ff.column}, {ff.row + tall_clear}, {ff.column+disp_len(ff)-1},{iif(number_of_vars_in_box(b) > 1, 'zvar', ff.name)},on_off,"acfunc",chosen,init_row)'
? "IF chosen <> 0"
? ' SET COLOR TO uncolor("{say_col},W/B",mono)'
? " @ ROW(),COL() SAY {iif(number_of_vars_in_box(b) > 1, 'zvar', ff.name)}[chosen]"
? " SET COLOR TO &cx"
q_indent = q_indent + 3
include_option_text_here(b,"LOOP",.t.)
q_indent = q_indent - 3
? " holder = chosen"
? "ENDIF"
if upper(b.slot1) <> "CHOOSE"
q_indent = 0
? "ENDDO"
endif
<
<
RETURN {iif(number_of_vars_in_box(b) > 1, 'zret', ff.name)}[holder]
<
<
<
<
<
**************************************
*** ***
*** {lower(b.name)}
<
<
*** FULL SCREEN BROWSE BOX ***
<
*** DISPLAY ONLY BOX ***
<
*** DISPLAY ONLY BROWSE BOX ***
<
*** BROWSE BOX ***
<
**************************************
FUNCTION {lower(b.name)}
<
PRIVATE fnames[{counter}], fpics[{counter}], fdiv[{counter}], finput[{counter}], fshow[{counter}]
<
PRIVATE holder
<
<
q_indent = 3
xoptions = get_option(b)
condition = .f.
related = .f.
say_col = say_color(b)
write_box_top(b)
if .not. related
? "GOTO TOP"
endif
ff = first_field_in_box(b)
zrow = ff.row - b.top
for all memvars in b
if memvar.row <> ff.row
init_var(memvar)
calc_var(memvar.name, memvar)
say_var(memvar)
endif
endfor
? 'fdiv[1] = ""'
for all vars in b
if var.row = ff.row
if count <> 1
zstart = (pf.column + disp_len(pf)) - b.left
zwidth = (var.column-b.left) - zstart
? 'fdiv[{count}] = "{box_text(b,zrow,zstart,zwidth)}"'
endif
if var.isfield
? "fnames[{count}] = '{field_say_name(var,var.dbf)}'"
else
if .not. var.calc_formula
? "NA = 'Not Defined'"
? "fnames[{count}] = 'NA'"
else
? "fnames[{count}] = '{var.calc_formula}'"
endif
endif
if var.picture
? "fpics[{count}] = {var.picture}"
else
? "fpics[{count}] = ''"
endif
? "finput[{count}] = {iif(var.input,'.t.','.f.')}"
? "fshow[{count}] = {iif((len(var.picture) <> 0 .and. len(var.picture) < var.length) ,'.t.','.f.')}"
pf = var
endif
next
if condition
if .not. related
if sought
? "SEEK {sought}"
else
? "LOCATE FOR {condition}"
endif
endif
if related
? "IF {iif(thisdbf.alias, thisdbf.alias, thisdbf.name)}->(EOF())"
else
? "IF .NOT. FOUND()"
endif
q_indent = 6
if is_what("DISPLAY",b)
write_box_bottom(b,.f.)
? "RETURN ''"
else
if dbrowse
? "messages(4,'No records in file meet conditions -- Press any key to continue')"
else
? 'answer = messages(2,"No records in file --- Insert New Record? ","L","insert_rec",.T.)'
? '@ {ff.row},{ff.column} SAY ""'
? 'IF LASTKEY() <> esc .AND. answer'
? ' ret_val = ed_{substr(b.name,1,5)}("I",1)'
? ' IF LASTKEY() = esc'
q_indent = 12
write_box_bottom(b,.t.)
? "RETURN ''"
q_indent = 6
? " ENDIF"
? "ELSE"
q_indent = 9
endif
write_box_bottom(b,.t.)
? "RETURN ''"
if .not. dbrowse
q_indent = 6
? "ENDIF"
endif
endif
q_indent = 3
? "ENDIF"
? "SET FILTER TO {condition} .AND. db_while({condition},{iif(sought,".t.",".f.")})"
endif
? 'cx = uncolor("{b.contents.color},{say_col}",mono)'
? "SET COLOR TO &cx"
if condition .and. .not. is_what("DISPLAY",b) .and. .not. is_what("NOEDIT",b)
? 'DO WHILE LASTKEY() <> esc .AND. LASTKEY() <> sp_bar'
q_indent = 6
endif
* find amount of lines to dbedit
tall_clear = 0
b_row = (ff.row - b.top) + iif(b.outline.type,1,0)
do while len(trim(box_text(b,b_row,1,b.width-2))) = 0 .and. b_row < (b.height - iif(b.outline.type,0,1))
tall_clear = tall_clear + 1
b_row = b_row + 1
enddo
? 'zseek = ""'
? 'DBEDIT({ff.row}, {ff.column}, {ff.row + tall_clear}, {pf.column+disp_len(pf)-1}, fnames,"db{substr(b.name,1,5)}",fpics,"","",fdiv)'
if condition .and. .not. is_what("DISPLAY",b) .and. .not. is_what("NOEDIT",b)
q_indent = 3
? "ENDDO"
endif
if condition
if .not. is_what("NOEDIT",b)
if sought
? "SEEK {sought}"
else
? "GOTO TOP"
? "LOCATE FOR {condition}"
endif
endif
? "SET FILTER TO"
endif
if is_what("PICK",b)
? "IF LASTKEY() <> esc"
? " holder = {b.slot3}"
? " KEYBOARD holder"
? "ENDIF"
endif
if .not. is_what("DISPLAY",b)
write_box_bottom(b,.t.)
else
write_box_bottom(b,.f.)
endif
<
RETURN ""
*End of Function
* Function for dbedit of {b.name}
FUNCTION db{substr(b.name,1,5)}
PARAMETERS mode, fld_ptr
PRIVATE ret_val, holder, zrow
holder = fnames[fld_ptr]
IF "" = zseek
zrow = ROW()
messages(3,if(fshow[fld_ptr],&holder," "))
@ zrow, 0 SAY ""
ENDIF
<
<
ret_val = 1
DO CASE
CASE mode = 0
IF LASTKEY() = up_arrow .OR. LASTKEY() = down_arrow .OR. ;
LASTKEY() = pg_up .OR. LASTKEY() = pg_down
zseek = ""
ENDIF
CASE mode = 1
messages(1,"Start of File",1,"")
CASE mode = 2
messages(1,"End of File",1,"")
CASE mode = 3
ret_val = 0
<
<
<
SEEK {sought}
<
GOTO TOP
LOCATE FOR {condition}
<
IF .NOT. FOUND()
<
answer = messages(2,"No records in file --- Insert New Record? ","L","insert_rec",.T.)
@ {ff.row},{ff.column} SAY ""
IF answer .AND. LASTKEY() <> esc
ret_val = ed_{substr(b.name,1,5)}("I",1)
<
ELSE
KEYBOARD CHR(esc)
<
ENDIF
<
ENDIF
<
<
<
messages(4,"No records in lookup Box -- Must add some or this won't work (press Esc twice)")
KEYBOARD chr(esc)
INKEY(0)
<
messages(3," ")
<
<
CASE mode = 4
DO CASE
CASE LASTKEY() = esc .OR. LASTKEY() = sp_bar
<
ret_val = 0
<
IF "" = zseek
ret_val = 0
ELSE
IF LASTKEY() <> sp_bar
messages(3," ")
zseek = ""
ret_val = 1
ELSE
zseek = zseek + " "
ENDIF
ENDIF
<
CASE LASTKEY() = enter
<
<
<
df_help({(first_field_in_box(b)).name})
zseek = ""
messages(3," ")
<
<
messages(3," ")
<
ret_val = 2
<
<
<
ret_val = ed_{substr(b.name,1,5)}("R",fld_ptr)
<
ret_val = 0
messages(3," ")
<
<
<
<
CASE LASTKEY() = 10 && Control-return edits record
ret_val = ed_{substr(b.name,1,5)}("R",fld_ptr)
CASE LASTKEY() = 23 && Alt i / Append Loop
DO WHILE LASTKEY() <> esc
ret_val = ed_{substr(b.name,1,5)}("I",1)
ENDDO
<
CASE LASTKEY() = 22 && Insert code
ret_val = ed_{substr(b.name,1,5)}("I",fld_ptr)
CASE LASTKEY() = 7
BEGIN SEQUENCE
<
answer = messages(2,"Delete this Record?","L","delete_rec",.T.)
IF answer
<
ret_val = 0
<
ret_val = 2
<
<
answer = messages(2,"Deleting this record will delete records in related databases -- Proceed?","L","delete_rec",.T.)
IF answer
<
<
<
SELECT {iif(prime_dbf.alias, prime_dbf.alias, prime_dbf.name)}
<
<
<
IF e_network(3,5,"Record not available for locking. Retry? (Y/N)")
<
DELETE
<
UNLOCK
ENDIF
<
<
ENDIF
<
SKIP -1
IF EOF()
<
KEYBOARD chr(esc)
<
ret_val = 0
<
ENDIF
ENDIF
END
<
<
CASE LASTKEY() = F1
<
<
<
<
<
DO helpme WITH "","","{topic}"
<
<
<
<
<
ret_val = ed_{substr(b.name,1,5)}("R",fld_ptr)
<
ENDIF
ENDCASE
ENDCASE
<
ret_val = 0
<
RETURN (ret_val)
<
*************************
* function to get record*
* called by read of *
* {b.name} *
*************************
FUNCTION ed_{substr(b.name,1,5)}
PARAMETER io,inum
<
<
<
<
PRIVATE cur_field, hold_color, frow, hold_order
<
frow = ROW()
hold_color = SETCOLOR()
cx = uncolor("{b.contents.color},{ff.color}",mono)
SET COLOR TO &cx
cur_field = fnames[inum]
IF io = "I"
<
q_indent = 6
init_dupe_fields(b,"r")
q_indent = 3
? "ELSE"
q_indent = 6
init_dupe_fields(b,"f")
<
ENDIF
IF inum <> 1
* do just the one field
IF finput[inum]
@ frow, COL() GET &cur_field PICTURE fpics[inum]
SET CURSOR ON
<
READ
SET CURSOR OFF
KEYBOARD CHR(down_arrow)
ENDIF
SET COLOR TO &hold_color
RETURN 1
ELSE
* do all the fields
<
<
<
<
<
<
ENDIF
SET CURSOR ON
SET KEY F1 TO helpme
SET KEY {pickkey} TO pickme
<
READ
SET KEY F1 TO
SET KEY {pickkey} TO
SET CURSOR OFF
IF LASTKEY() <> esc
<
q_indent = 6
uni = .f.
if is_indexed(b)
if upper((get_prime(b)).index[1].slot3) = "UNIQUE"
? "hold_order = INDEXORD()"
? "SET ORDER TO 1"
? "z_temp = m->({(get_prime(b)).index[1].expr})"
? "zhere = RECNO()"
? "SEEK z_temp"
? 'IF .NOT. FOUND() .OR. (io <> "I" .AND. RECNO() = zhere)'
? " GOTO zhere"
q_indent = 9
uni = .t.
endif
endif
? 'IF io = "I"'
include_option_text_here(b,"INSERT",.t.)
if multi
? 'IF e_network(4,5,"File not available for locking. Retry? (Y/N)")'
else
? " APPEND BLANK"
replace_all_memos(b)
endif
? " KEYBOARD CHR(down_arrow)"
if multi
? "UNLOCK"
? "ENDIF"
endif
? "ELSE"
include_option_text_here(b,"EDIT",.t.)
? "ENDIF"
replace_all_fields(b)
include_option_text_here(b,"CHANGE",.t.)
if uni
q_indent = 6
? "ELSE"
? ' messages(1,"Record Key Already in Use",1,"")'
? "ENDIF"
? "SET ORDER TO hold_order"
endif
q_indent = 3
? "ENDIF"
q_indent = 0
? "SET COLOR TO &hold_color"
endif
if is_browse_full(b)
? "KEYBOARD CHR(down_arrow)"
endif
if condition
if .not. is_what("NOEDIT",b)
? "SKIP -1"
endif
q_indent = 0
? "RETURN 0"
else
q_indent = 0
? "RETURN 2"
endif
endif
<
<
<
<
<
<
***************************************
***
*** {lower(b.name)}
*** ENTRY (FIELDS) BOX
**************************************
FUNCTION {lower(b.name)}
PARAMETER io
PRIVATE key, newstring, hold_order
<
q_indent = 3
declare_field_dupes_in_box(b)
xoptions = get_option(b)
condition = ".t."
say_col = say_color(b)
write_box_top(b)
for all memvars in b
init_var(memvar)
endfor
? 'cx = uncolor("{say_col},{field.color}",mono)'
? "SET COLOR TO &cx"
<
DO WHILE .t.
<
<
<
zarea = SELECT()
<
SELECT (zarea)
<
<
<
<
<
<
<
<
<
<
<
<
<
IF pcount() > 0
DO CASE
CASE io = "R"
get{substr(b.name,1,5)}("R")
EXIT
<
<
<
CASE io = "H"
get{substr(b.name,1,5)}("H")
EXIT
<
<
OTHERWISE
get{substr(b.name,1,5)}("I")
EXIT
ENDCASE
ENDIF
IF EOF() .OR. .NOT. {condition}
<