Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-02

urgent: double + integer question

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

raoul s

Hi,

I have "a" as double and "b" as integer.
1) how may I say "a := b" in pascal. "a" on left and "b" on the
right.

2)can one way would be?:
a := b + 0.0;

i like to keep the results for a as double.

raoul

__________________________________________________ Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

Jonas Maebe
to raoul s
raoul s wrote
I have "a" as double and "b" as integer. 1) how may I say "a := b" in pascal. "a" on left and "b" on the right.
Just like you wrote it: a:= b

PS: please don't post your question to both fpc-devel and fpc-pascal, just choose the most appropriate (in this case, that's fpc-pascal)

Jonas

raoul s
to Jonas Maebe

Hi,
I am really new to pascal.
I am trying to create 'D'. which keystroke creates those
around D?.
Or what combination of keystrokes create those around D?.
I am using IBM PC.

raoul

__________________________________________________ Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

raoul s
to raoul s

Hi,
for some reason i get "error 88: "(" expected" at the line below.
see the market "prompt stops next line" line in below please.
when i comment out the outer "Begin" the rror goes away.
please help.I use Borland pascal.
Form the compiler editor i can not see if it is "(" or "<".
I thing it means "(".

.
.
.

Begin
UserResults[1] := val1;
UserResults[2] := valmin;
UserResults[3] := valmax;
If (Not CalledFromVoodoo) and (HelpLevel = 4) then
If val1 <= UserResults[2] then
Begin
***prompt stops next line-->>
Str := ConvertNumber(UserResults[2], 'D');
RIWritelnStr('initval is <= ' + Str);
End;
Elseif (UserResults[2] < val1) and (val1 <
UserResults[3])
Begin
Str := ConvertNumber(UserResults[1], 'D');
RIWritelnStr('initval is < ' + Str);
End;
Else
Begin
Str := ConvertNumber(UserResults[3], 'D');
RIWritelnStr('initval is >= ' + Str);
End;
End;
.
.

__________________________________________________ Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

Jonas Maebe
to raoul s
raoul s wrote
for some reason i get "error 88: "(" expected" at the line below.

With out the declaration of the functions and variables, it is impossible to say what's wrong. Also, the cursor is always placed on the exact location where this symbol is expected, not just on the line.

Anyway, your programs contains a lot of other errors too: you always write thing like

if blablabla then
  begin
    ...
  end;
else
   ...

The error here is that before else, you must not put a ";". In Pascal, ";" marks the end of a statement and "if .. then .. else .." is one statement.

Jonas