@fileexist in if loop
Posted: Tue Apr 21, 2015 6:10 am
Hello,
First time poster. I have an issue with the support command @fileexist in a loop. I need to check if a database exists before I (re)create it, but it seems like my code interprets @fileexist as = 0 and overwrites existing databases at all times. My code:
%blu2011 = "path\blu2011.edb"
%blu2012 = "path\blu2012.edb"
%blu2013 = "path\blu2013.edb"
%blu2014 = "path\blu2014.edb"
for !j = 1 to 4
if @fileexist(%blu201{!j})=0 then
dbcreate blu201{!j}
endif
next
Anyone see the problem here? Would be most grateful for any help.
Best, Matt
First time poster. I have an issue with the support command @fileexist in a loop. I need to check if a database exists before I (re)create it, but it seems like my code interprets @fileexist as = 0 and overwrites existing databases at all times. My code:
%blu2011 = "path\blu2011.edb"
%blu2012 = "path\blu2012.edb"
%blu2013 = "path\blu2013.edb"
%blu2014 = "path\blu2014.edb"
for !j = 1 to 4
if @fileexist(%blu201{!j})=0 then
dbcreate blu201{!j}
endif
next
Anyone see the problem here? Would be most grateful for any help.
Best, Matt