Board index » delphi » need urgent help question

need urgent help question

please help. i need the code in below translated to borland pascal:
let's say: num1min :=10  num1max :=20   num2min :=10  num2ref :=100
Repeat
(* some stuff go here *)
num1[a] := num1min + num1incr.
num2[a] := num2min + num2incr.
Until num2 > num2ref
Then like to print the results after the test is stopped to screen/file:
If num1 <= num1min then print "val <= actual value of num1min"
If num1min < num1 < num1max then print "val = actual value of num1"
If num1 >= num1max then print "val >= actual value of num1max".

--
Sent by  from yahoo element from  com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new

 

Re:need urgent help question


Hi,
for some reason i get "error 88: "<" expected" at the line below.
see the market "prompt stops here" line in below please.
when i comment out the inner Begin th error goes away.
please help.I use Borland pascal.
I am not sure if it "(" or "<". it hard to see.

.
.
.
Begin
.
.

 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 here-->>    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;                  
End;

--
Sent by  1 from yahoo within field com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new

Re:need urgent help question


hi

"raoul_s2...@yahoo.com" <u239013...@spawnkill.ip-mobilphone.net> schrieb
im Newsbeitrag news:l.1013022291.1638488769@[63.127.215.130]...

Quote
> Hi,
> for some reason i get "error 88: "<" expected" at the line below.
> see the market "prompt stops here" line in below please.
> when i comment out the inner Begin th error goes away.
> please help.I use Borland pascal.
> I am not sure if it "(" or "<". it hard to see.

> .
> .
> .
> Begin
> .
> .

>  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 here-->> Str := ConvertNumber(UserResults[2], 'D');

do not use 'str'.
use a different name!
the compiler might misunterstand the usage of this variable.

check the online help for 'str'.

regards
jochen

ps. just a guess.

Quote
> 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;
> End;

[...]

Re:need urgent help question


Quote
u137847...@spawnkill.ip-mobilphone.net  (y_542...@yahoo.com) wrote in message news:<l.1012959598.1941131591@[63.127.215.130]>...
> please help. i need the code in below translated to borland pascal:
> let's say: num1min :=10  num1max :=20   num2min :=10  num2ref :=100

your code is already in pascal, so i'll just write down the proper syntax.

const
    num1min : integer = 10;
    num1max : integer = 20;
    num2min : integer = 10;
    num2ref : integer = 100;
val
    blabla : text; (* also here you put all your other variables *)

begin
...
repeat
    (* some stuff go here too *)
    num1[a] := num1min + num1incr;
    num2[a] := num2min + num2incr;
until num2 > num2ref;

(* to print 2 screen use these part *)
if num1 <= num1min then
    writeln (num1, ' <= ',num1min);
if (num1 < num1max) and (num1min < num1) then
    writeln (num1,' = ',num1);
if num1 >= num1max then
    writeln (num1,' >= ',num1max);

(* to print 2 file use these one *)
assign (blabla,'my_file.txt');
rewrite (blabla);
if num1 <= num1min then
    writeln (blabla,num1, ' <= ',num1min);
if (num1 < num1max) and (num1min < num1) then
    writeln (blabla,num1,' = ',num1);
if num1 >= num1max then
    writeln (blabla,num1,' >= ',num1max);
close (blabla);

...

end.

are you used to c programing?

Vasko

Quote
> Repeat
> (* some stuff go here *)
> num1[a] := num1min + num1incr.
> num2[a] := num2min + num2incr.
> Until num2 > num2ref
> Then like to print the results after the test is stopped to screen/file:
> If num1 <= num1min then print "val <= actual value of num1min"
> If num1min < num1 < num1max then print "val = actual value of num1"
> If num1 >= num1max then print "val >= actual value of num1max".

Re:need urgent help question


raoul_s2...@yahoo.com wrote in <l.1013022291.1638488769@[63.127.215.130]>

Quote
> Hi,
> for some reason i get "error 88: "<" expected" at the line below.
> see the market "prompt stops here" line in below please.

  Do you pressing F1 when get error messages from compiler? It might be...
helpfull!

Quote
> when i comment out the inner Begin th error goes away.
> please help.I use Borland pascal.
> I am not sure if it "(" or "<". it hard to see.

  It is "(". Try to use full-screen DOS-box mode ;)

Quote
> *prompt stops here-->>       Str := ConvertNumber(UserResults[2], 'D');

  What is "Str"? Is it defined above?
  What format is in ConvertNumber()? Also what is UserResults?

--
   Varyonov Konstantin       varkos^mail.ru      http://ghsrl.newmail.ru

Other Threads