Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: problem with switch and case [Re: FoxHound] #396320
03/05/12 16:57
03/05/12 16:57
Joined: Dec 2009
Posts: 128
China
frankjiang Offline
Member
frankjiang  Offline
Member

Joined: Dec 2009
Posts: 128
China
Code:
if(type != SYS_EXIT)
	{		
		switch(type)
		{
			case DELETE_PROC:	str_cat(_re,"DeleteProc:"); break;
			case MESSAGE:		str_cat(_re,"Message:");	break;
			case WARNNING:		str_cat(_re,"Warnning:");	break;
			case ERROR:			str_cat(_re,"Error:");		break;
			case ERROR_ACKERR:	str_cat(_re,outError());	break;
		}
		
		str_cat(_re,_chr(s));
		str_cat(_re,_chr("\n"));
		str_cpy(plog.msg,_re);
		outs(plog);
	}




development 3d game is interesting!
Re: problem with switch and case [Re: Random] #396491
03/07/12 15:05
03/07/12 15:05
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
im pretty sure your execution the animation function over and over again and every time it gets executed your var b_a=integer(random(2)); WILL be a NEW value and that happens FAST ,so i suggest that you only change var b_a=integer(random(2)); at a certain time lapse that will give block/no block chance to execute longer ...and when using switch/case in my
experience using c++ the following will keep cases leeking through :
switch(whatever)
{
case 1:
{
code here<-
}
case 2:
{
code here<-
}
}

thats why people think using "if" statements is a solution
because what's not being realised is that those if statements
are followed by enclosing paranthesis like :
if (this==that)
{
code here<-
}
its exactly the same as
case blabla:
{
code here<-
}
the parenthesis limits the execution

where as you would use break ,now what happens with case and if statements is that execution keeps going on to the next code line BUT WITH BREAK; the execution JUMPS PAST the rest
of the code and CONTINUES AFTER the switch's ending paranthesis ,get it?

Last edited by JustSid; 03/07/12 20:06. Reason: Merged the posts...

Compulsive compiler
Re: problem with switch and case [Re: Wjbender] #396529
03/07/12 19:41
03/07/12 19:41
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
@Wjbender: Please use the "Edit" function and don`t start double- and tripple posts!

Re: problem with switch and case [Re: Widi] #396533
03/07/12 19:53
03/07/12 19:53
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
sure ! if this post window didnt keep scrolling up in an EXTREMELY irretating manner i would do 1 single post or perhaps i should upload a txt file that would work MUCH better than this thing


Compulsive compiler
Re: problem with switch and case [Re: Wjbender] #396558
03/07/12 21:30
03/07/12 21:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Yes, it is damned annoying.

So do what I do.

Type it up in SED, nice and pretty, then copy/paste the whole block over.


Just dont compile it first, it gets hard to read then... wink


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1