Elseif
Posted: 2013-12-14 00:16:24
How does Else if work in the scripts?
Code: Select all
if something then
begin
some code
end
else if somethingelse then
begin
some code
end;
Code: Select all
if Value <> '' then
begin
if RegExprSetExec('drama',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Drama');
else if RegExprSetExec('comedy',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Comedy') ;
else if RegExprSetExec('romance',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Romance') ;
else if RegExprSetExec('animation',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Animation');
else if RegExprSetExec('action.*adventure',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Action/Adventure') ;
else if RegExprSetExec('anime',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Anime') ;
else if RegExprSetExec('fantasy',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Fantasy');
else if RegExprSetExec('science.*fiction',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Sci-Fi');
else if RegExprSetExec('comic.*book',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Comic book');
else if RegExprSetExec('family',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Family');
end;
Code: Select all
if Value <> '' then
begin
if RegExprSetExec('drama',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Drama')
else if RegExprSetExec('comedy',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Comedy')
else if RegExprSetExec('romance',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Romance')
else if RegExprSetExec('animation',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Animation')
else if RegExprSetExec('action.*adventure',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Action/Adventure')
else if RegExprSetExec('anime',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Anime')
else if RegExprSetExec('fantasy',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Fantasy')
else if RegExprSetExec('science.*fiction',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Sci-Fi')
else if RegExprSetExec('comic.*book',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Comic book')
else if RegExprSetExec('family',AnsiLowerCase(Value)) = True then
SetField(fieldCategory, 'Family');
end;