Help me translate C command to Pascal command

Status
Not open for further replies.

Foldesa

Junior Member level 1
Joined
Dec 29, 2004
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
176
Help translate C command

Hi !

I need your help. My problem is I can't translate

if (i) temp_whole |= res_factor_3[res_shift - 1];

C command to pascal command.
Can anybody help?

Thank you

András
 

Re: Help translate C command

Needs at least variables declaration to be understood.
please send all the sub/function code...
 

Re: Help translate C command

Foldesa said:
Hi !

I need your help. My problem is I can't translate

if (i) temp_whole |= res_factor_3[res_shift - 1];

C command to pascal command.
Can anybody help?

Thank you

András

If the variable i is not equal to zero then temp_whole=temp_whole or res_factor[res_shift - 1]

hope this helps
 

Re: Help translate C command

C-Man said:
If the variable i is not equal to zero then temp_whole=temp_whole or res_factor[res_shift - 1]

That is I believe a binary OR too.

So if the variable (i) is not equal to zero then temp_whole=temp_whole binary or res_factor[res_shift - 1]

which means that if i is not zero then, if there are any 1's in the value returned by the function res_factor[res_shift - 1]. Then 1's are added to the variable temp_whole in the same bit positions.


Maui
 

Re: Help translate C command

Hello

what maui wrote is more then enough for me.

Than you

Added after 1 minutes:

Just 1 more thing I forgot.

I have a line:

if (temp_fraction < 1000u) LCD_Chr_CP('0');

what represents the "1000u", because it is not declared anywhere.
 

Re: Help translate C command

1000u just means that it's an unsigned number, see **broken link removed**
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…