home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Ap_it
-
- PARAMETERS _apa, _apb, _apc, _apd
-
- * _apa = the field name
- * _apb = the field data type
- * _apc = the field length
- * _apd = the field decimal
-
- * This function call is to replace the REPLACE field_name WITH ...
- * Now: AP_IT("Lastname","C",1)
-
- * This function replaces the parameters into a STRUCTURE EXTENDED
- * database this is previously created and open.
-
- IF PCOUNT() = 3
- _apd = 0
- ENDIF
-
- IF EMPTY(ALIAS())
- RETURN(-1)
- ELSEIF TYPE("field_name") = "U"
- RETURN(-3)
- ELSEIF TYPE("_apa") + TYPE("_apb") + TYPE("_apc") + TYPE("_apd") != "CCNN"
- RETURN(-2)
- ENDIF
-
-
- LOCATE ALL FOR UPPER(field_name) == UPPER(_apa)
- IF FOUND()
- RETURN(0)
- ELSE
- APPEND BLANK
- IF _apc > 255
- REPLACE field_name WITH _apa, field_type WITH _apb, field_len WITH INT(_apc % 256), field_dec WITH INT(_apc / 256)
- ELSE
- REPLACE field_name WITH _apa, field_type WITH _apb, field_len WITH _apc, field_dec WITH _apd
- ENDIF
- ENDIF
- RETURN(RECNO())
-
- * End of File