\Source CodeVBSCRIPTVBSCRIPT Functions - For Imbedded VBTableExists()
The purpose of this boolean function is to tell you whether or
not a table exists (true = yes).
The function takes these parameters:
- The name of the table.
if TableExists("Property") then
;--- Table exists ---
<$Property "ARPCOMMENTS" VALUE="Some optional comment">
end if
;--- Create "DeleteTableIfEmpty" command ------------------------------------
#( '<?NewLine>'
#define DeleteTableIfEmpty
;--- No point doing anything if the table doesn't exist -----------------
if TableExists("{$#1}") then
;--- "open" the table -----------------------------------------------
<$Table "{$#1}">
;--- Count number of rows in the table --------------------------
#RexxVar '@@VbVariable' = 'DeleteTableIfEmpty_<?Unique>'
dim <??@@VbVariable> : <??@@VbVariable> = 0
<$Row @Where="" @Code="Y" @VALIDATE="">
<??@@VbVariable> = <??@@VbVariable> + 1
<$/Row>
;--- If no rows in the table then delete it ---------------------
if <??@@VbVariable> = 0 then
<$TableDelete>
end if
<$/Table>
end if
#)
;--- Try the "DeleteTableIfEmpty" command -----------------------------------
<$DeleteTableIfEmpty "IniFile">