Home   Help Search Login Register  

Author Topic: Silly loops  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

Offline Gielovic

  • Contributing Member
  • **
Silly loops
« on: 18 Oct 2007, 17:37:54 »
I've such a stupid problem...when i make a for/while loop ArmA is giving me the following error
Code: [Select]
Error in expression < _this select 0;
_i = 0;
while {_i < 5} do
{ _pos = [(_basepos select 0) + 10, (>
  Error position: <do
{ _pos = [(_basepos select 0) + 10, (>
  Error do: Type String, expected code
File D:\My Documents\ArmA\missions\setPos.Intro\basecreator2.sqf, line 9

the script looks like this, it's a .sqf and i execute it by base = [position player] execVM "script.sqf"

Code: [Select]
_i = 0;
while {_i < 5} do
{ blabla;
_i = _i + 1;
};

has anyone an idea what i'm doing wrong cause this is the way it's written on the BIKI:S

Offline Gielovic

  • Contributing Member
  • **
Re: Silly loops
« Reply #1 on: 18 Oct 2007, 17:44:11 »
ow i'm sorry...saw there was something wrong in the while-loop...dunno why i get these kind of messages but....

well you can remove this if you like as i see i can't :D

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Silly loops
« Reply #2 on: 18 Oct 2007, 18:15:05 »
"Error do: Type String, expected code" means that the block after do, encased in { } isn't formed correctly, so it thinks it must be a string type rather than a code type as it expected. This just means there is a syntax error of some kind somewhere within the { } block, such as missing a semi-colon or mis-typing a command.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Silly loops
« Reply #3 on: 18 Oct 2007, 22:31:43 »
Gielovic, for future reference; we do not allow consecutive posting in such a short timeframe.
If you have something to add to your post after a short period of time modify it instead of replying to yourself..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.