VastlySuperior
2012-08-12 09:24:50
Hi
Need some help here. I have changed a procedure in my script so that it will execute better and be more steamlined. Now whenever I execute this procedure where a procedure is called that passes on an interger value, I get this error. I`m certain it has to do with the delclaration of the array as it is declared as a String. My question is, what else can I declare this array as so that it will execute correctly?
Here it the code I use.
I get this error on Case selection 2,4 and 8. All of them has a procedure that passes on a integer value. Like
As what can I declare this array so that it will execute?
Thanks in advance.
Need some help here. I have changed a procedure in my script so that it will execute better and be more steamlined. Now whenever I execute this procedure where a procedure is called that passes on an interger value, I get this error. I`m certain it has to do with the delclaration of the array as it is declared as a String. My question is, what else can I declare this array as so that it will execute correctly?
Here it the code I use.
procedure Activity(Choice:Integer); // Choose Activity to Implement
var
I: Integer;
Param: TVariantArray;
ArrayOfActivity: TStringArray;
ArrayOfChoices: TVariantArray;
Begin
If(not(loggedin))then
Exit;
Disguise('Setting Activity To Do');
WriteLn('Setting Activity To Do');
Case Choice of
0: Begin // mine clay and bank it
Disguise('mine clay and bank it');
WriteLn('Clay Loads = ' + IntToStr(TotalLoads));
ArrayOfActivity := ['DepositItems', 'WalkToMine', 'MineClay', 'BankFromMine'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
1: Begin // mine clay and soften it then bank it
Disguise('mine clay and soften it then bank it');
ArrayOfActivity := ['DepositItems', 'WalkToMine', 'MineClay', 'WalkToWater', 'SoftenClay', 'WalkToTheBank'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
2: Begin // get soft clay from bank and craft it then bank it
DisGuise('Get Soft Clay From Bank And Craft It Then Bank It');
ArrayOfActivity := ['DepositItems', 'WithdrawItems', 'WalkPottery', 'MakePottery(ChoosePottery)', 'BankFromPottery'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
3: Begin // get soft clay from bank and craft it and drop it
Disguise('get soft clay from bank and craft it and drop it');
ArrayOfActivity := ['DepositItems', 'WithdrawItems', 'WalkPottery', 'MakePottery(ChoosePottery)', 'DropItems', 'Proggy', 'BankFromPottery'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
4: Begin // mine clay,soften it,craft it,bank it
Disguise('mine clay,soften it,craft it,bank it');
ArrayOfActivity := ['DepositItems', 'WalkToMine', 'MineClay', 'WalkToWater', 'SoftenClay', 'CraftFromPump', 'MakePottery(ChoosePottery)', 'FireOven(ChoosePottery)', 'BankFromPottery'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
5: Begin // fire softpots,urns,bowls and bank it
Disguise('fire softpots,urns,bowls and bank it');
End;
6: Begin // fire softpots,urns,bowls and drop it
Disguise('fire softpots,urns,bowls and drop it');
End;
7: Begin // get clay from bank,soften it bank it
Disguise('get clay from bank,soften it bank it');
ArrayOfActivity := ['DepositItems', 'WithdrawItems', 'BankToWater', 'SoftenClay', 'WalkToTheBank'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
8: Begin // get soft clay from bank and craft it Fire It then bank it
DisGuise('Get Soft Clay From Bank And Craft It Then Bank It');
ArrayOfActivity := ['DepositItems', 'WithdrawItems', 'WalkPottery', 'MakePottery(ChoosePottery)', 'FireOven(ChoosePottery)', 'BankFromPottery'];
SetLength(ArrayOfChoices, Length(ArrayOfActivity));
If (TotalLoads = LoadsToDo) Then
Begin
FindNormalRandoms;
DepositItems;
Proggy;
LogOut;
TerminateScript;
End else
Begin
For I := 0 To High(ArrayOfActivity) Do
Begin
ArrayOfChoices[I] := CallProc(ArrayOfActivity[I], Param);
If LostMyWay then
Begin
Exit;
End
End;
End;
End;
End;
End;I get this error on Case selection 2,4 and 8. All of them has a procedure that passes on a integer value. Like
MakePottery(ChoosePottery)As what can I declare this array so that it will execute?
Thanks in advance.