Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LPARAMETERS TableName, FieldName
LOCAL ARRAY AliasArray[1,1]
LOCAL ARRAY DbfArray[1,1]
LOCAL;
PreviousSafety , ;
RetVal , ;
PreviousAlias , ;
aPart , ;
AliasName , ;
FoundDbf , ;
QQ___QQ [COLOR=green]&& a placeholder for declaring local variables[/color]
IF USED(TableName) [COLOR=green]&& ie TableName was a used ALIAS[/color]
AliasName = TableName
ELSE [COLOR=green]&& parameter <TableName> wasn't an alias - so see if the table is already open under a different alias[/color]
PreviousAlias = ALIAS() [COLOR=green]&& to return the user to the work area they were in before re-selecting[/color]
AUSED(DbfArray) [COLOR=green]&& declared as a LOCAL array[/color]
FOR EACH aPart IN DbfArray [COLOR=green]&& scan through the array of aliases[/color]
IF VARTYPE(aPart)=[C] AND JUSTSTEM(DBF(aPart)) = UPPER(TableName) [COLOR=green]&& aPart will be the work area number every other pass[/color]
AliasName = aPart
FoundDbf = .T.
EXIT
ENDIF
ENDFOR
IF NOT FoundDbf [COLOR=green]&& the dbf was NOT already open, so open it in an empty work area. Don't need to be in the work area as AFIELDS accepts the alias as a parameter[/color]
USE (TableName) IN 0 AGAIN ALIAS CheckForField
AliasName = [CheckForField]
ENDIF
SELECT (IIF(NOT EMPTY(PreviousAlias) AND USED(PreviousAlias), PreviousAlias, 0))
ENDIF
AFIELDS(AliasArray, AliasName) [COLOR=green]&& declared as a LOCAL array[/color]
RetVal = 0<ASCAN(AliasArray,UPPER(FieldName))
USE IN (IIF(USED([CheckForField]),[CheckForField],0))
RETURN RetVal
*FUNCTION modify_table_financieel
IF USED("financieel")
SELECT financieel
USE
ENDIF
use financieel excl
if type("financieel.ToezNul")="U"
alter table Financieel add column ToezNul L
ENDIF
if type("financieel.ToezAlOntv")="U"
alter table Financieel add column ToezAlOntv L
ENDIF
if type("financieel.Depot")="U"
alter table Financieel add column Depot N(10,2)
ENDIF
USE