|
|
integer test result
#146768
08/08/07 12:41
08/08/07 12:41
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
OP
User
|
OP
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
HI! Could you try this script at your end? The results that I get from this is variable 351.0000 integer 0.3427 I tought that an integer was a whole number. Code:
#include <acknex.h> #include <default.c> // var _p = 0; int iP = 0;
TEXT* Vname = { pos_x= 90; pos_y= 90; layer 8; STRING = "Variable"; flags |= VISIBLE; } TEXT* intname = { pos_x= 90; pos_y= 120; layer 8; STRING = "Integer"; flags |= VISIBLE; }
PANEL* Check = { pos_x = 200; pos_y = 90; layer 8; digits (0,0,5.5,*,1,_p); digits (0,30,5.5,*,1,iP); flags |= visible; } function test_var_int () { while (_p <= 350) { _p += 1; iP += 1; wait (1); } }
function main() { wait (1); // now load the level level_load(""); wait (3); test_var_int (); }
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: integer test result
[Re: Ottawa]
#146769
08/08/07 13:03
08/08/07 13:03
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
Rabbit Developer
|
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
this has to be bug.. Int indeed means integer, an "whole number".
"Yesterday was once today's tomorrow."
|
|
|
Re: integer test result
[Re: Inestical]
#146770
08/08/07 14:08
08/08/07 14:08
|
Joined: Aug 2000
Posts: 1,141 Baunatal, Germany
Tobias

Moderator
|

Moderator
Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
|
Here is the bug:
digits (0,30,5.5,*,1,iP );
Digits is var, not int.
|
|
|
Re: integer test result
[Re: Tobias]
#146771
08/08/07 23:05
08/08/07 23:05
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
OP
User
|
OP
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi guys/girls!  1) If digits is a var and I want to show integers in a panel what do I use? 2) When I changed the INT for VAR to all my variables it made a big difference in my game. The panels started to show the right values. (btw : these panels are for debugging) and my game is going further than it was.(still a few migration bugs). VAR seems to be acting like an integer and INT seems to be acting like???
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: integer test result
[Re: Ottawa]
#146772
08/09/07 01:06
08/09/07 01:06
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
1.) you can write "(var)YourIntegerVariable" or assign the integer to a var variable like "MyVar = (var)MyInt;" and use the var variable in the panel.
2.) An int is an int surprisingly. And a var is from the data type fixed. Vars don't behave like integers. Never.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: integer test result
[Re: Uhrwerk]
#146773
08/10/07 13:27
08/10/07 13:27
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
OP
User
|
OP
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi !  Thanks for the (var) solution but.... I believe that this (var) is a workaround and a fact that INT as a problem. In any program, if I write 1 = 1 ...I am expecting to get 1 = 1. When we define a VAR we get 1 = 1 But when we use INT we get 1 = 0.00098 and in order to correct this I have to use myint = (var)1 to get 1 = 1 which means that (var) works but INT does not.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: integer test result
[Re: Excessus]
#146775
08/10/07 22:35
08/10/07 22:35
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
OP
User
|
OP
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
HI Excessus!  Thanks for the information. I've copied it and will look at it. I will also look for int transfers in function. 
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: integer test result
[Re: Ottawa]
#146776
08/11/07 12:59
08/11/07 12:59
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
OP
User
|
OP
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! To continue the saga....of typecasting... or another type of problem... This line was working in Cscript ...the migration is very hard on it  : if (var_green == MyEntity.skill16) {} var_green is defined as a VAR but what is MyEntity.skill16 which holds a value of 1.00 to 10.00 in WED. If it’s an INT how do I typecast it? (I’ve tried a few ways without success )
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
|