Make sure you have standards
[which are the proper indentation after bold words]
Simba Code:
Procedure Bank; // Should not be a space
Var // No space here
banksucess: boolean // You forgot the semicolon ";"
begin // first begin is always at the base
OpenBankFast('veb')banksucess; // When calling OpenBankFast('veb'), you dont need anything after it (no procedure name is needed)
If banksucess = True then // Bank success is not defined, but I assume thats what you wanted to define above? I'll cover that in my new paragraph
WriteLn('Bank sucessfully opened')
else
writeLn('Banking failed') // Forgot semicolon
DepositAll; // This will attempt to deposit all, even if you failed
end // forgot semicolon, should be at the beginning
So this is how I would make your code:
Simba Code:
Procedure Bank;
Var
banksucess: boolean;
begin
banksuccess := OpenBankFast('veb'); // OpenBankFast is a function that returns true or false, so therefore we can set banksuccess to true or false, this can be shortened later
If banksucess = True then
begin
WriteLn('Bank sucessfully opened');
DepositAll; // This should be in here because it should only be called if we know the bank was opened
end else writeLn('Banking failed'); // We need no begin or end; if it's only ONE line of code, if its two then you need begin/end;
end;
Now you can further shorten it to this [USE THIS]:
Simba Code:
Procedure Bank;
begin
if (OpenBankFast('veb')) then // if (function inside here is true) then ...
begin
WriteLn('Bank sucessfully opened');
DepositAll;
end else writeLn('Banking failed');
end;
EDIT: My standards spaces are not appearing for some reason
Hope that helps