Board index » delphi » quality sample code

quality sample code

Hi folks!
I need some quality cool sample code for beginers,
can you tell me where can i get it?
Best regards,
alex
 

Re:quality sample code


alex fridman <fridm...@bezeqint.net> schreef in berichtnieuws
3a6c9...@news.bezeqint.net...
Quote
> Hi folks!
> I need some quality cool sample code for beginers,
> can you tell me where can i get it?
> Best regards,
> alex

program cool_sample_code;
var cool_number:integer;
begin
    writeln('This is my qualtity cool sample code');
    writeln; writeln;
    write('Give an integer number sample lower than zero: ');
    readln(cool_number);
    case cool_number of
           0..100:  writeln('That's not a cool number sample');
        -10..  -1:  writeln('That's beginners cool');
        -25.. -11: writeln('That's pretty cool');
        -50.. -26: writeln('That's very cool');
       -100..-51: writeln('That's a quality cool sample')
     else writeln('I don't know how cool your sample is...');
    writeln
end.

Greetings. Huub.

Re:quality sample code


Hehe that's pretty cool Huub :))

Hup Holland Hup! hehe

Gtz from Demarcel

--

-----Signature------
3D is the Future! at Http://demarcel.op.het.net/
Demar...@cistron.nl
--------------------------

Re:quality sample code


Quote
> > I need some quality cool sample code for beginers,
> > can you tell me where can i get it?
> program cool_sample_code;
> var cool_number:integer;
> begin
>     writeln('This is my qualtity cool sample code');
>     writeln; writeln;
>     write('Give an integer number sample lower than zero: ');
>     readln(cool_number);
>     case cool_number of
>            0..100:  writeln('That's not a cool number sample');
>         -10..  -1:  writeln('That's beginners cool');
>         -25.. -11: writeln('That's pretty cool');
>         -50.. -26: writeln('That's very cool');
>        -100..-51: writeln('That's a quality cool sample')
>      else writeln('I don't know how cool your sample is...');
>     writeln
> end.

> Greetings. Huub.

   Huub, didn't you compile this code before you posted it?  (Some major
syntax errors in the above...)  8<{{
   If it's not a bunch of careless mistakes, it's a pretty cruel joke to
the original poster, IMHO...

Re:quality sample code


Mike Copeland <cm...@qwest.net> schreef in berichtnieuws
MPG.14d6af22bbaedf65989...@news.qwest.net...

Quote
> > > I need some quality cool sample code for beginers,
> > > can you tell me where can i get it?
> > program cool_sample_code;
<snip>
> > end.

> > Greetings. Huub.

>    Huub, didn't you compile this code before you posted it?
(Some major
> syntax errors in the above...)  8<{{
>    If it's not a bunch of careless mistakes, it's a pretty
cruel joke to
> the original poster, IMHO...

OK Mike. Not tested. A little joke, but nothing cruel about it.

One could search the web or study the manuals and the examples,
before asking for some _quality_ _cool_ sample code.

So here is the correction:

I got:
- Error 89 ")" expected. (6 times)
Meaning: A single quote that is not a string delimiter (=start
or end of string),
has to be typed in twice to produce one single quote in the
output.
- Error 85 ";" expected.
Meaning: Case-statement not properly used. Forgot 'end;' after
'else'.

Giving:

program cool_sample_code;
var cool_number:integer;
begin
  writeln;
  writeln('This is my qualtity cool sample code');
  writeln; writeln;
  write('Give an integer number sample lower than zero: ');
  readln(cool_number);
  case cool_number of
      0..100:  writeln('That''s not a cool number sample');
    -10..  -1:  writeln('That''s beginners cool');
    -25.. -11: writeln('That''s pretty cool');
    -50.. -26: writeln('That''s very cool');
    -100..-51: writeln('That''s a quality cool sample')
   else writeln('I don''t know how cool your sample is...')
  end;
  writeln;
  writeln('Press <enter> to exit');
  readln
end.

Other Threads