really stupid question from a true pascal newbie. 
Author Message
 really stupid question from a true pascal newbie.

Quote:

> Writeln('WOW, you have $',money:10:2,' on you right now?');

With "money:10:2" you will place the output of "money" 10 blanks from
act. positon. I dont know the word in english for the german
"rechtsbndig" so I try to explain it. On this position (10 blanks form
act. position) the last character of "money" will be shown. Then it will
go on, showing the rest of "money" to the left.
Change "10" to "1" and the output starts directly behind "$".
The ":2" only says, that it will be shown with 2 decimal places.

I hope this is be right, because i didn t do that for a long time!
Also sorry for my bad english.

cu
  Andre

--
Thiesen                           | Andr Wohnig

Im Tiegel 9                       | www.thiesen.com
36367 Wartenberg                  | tel. +49 (0) 6641 979-142  fax -299



Mon, 31 Mar 2003 03:00:00 GMT  
 really stupid question from a true pascal newbie.
On Thu, 12 Oct 2000 09:34:38 +0200, Andre Wohnig sez:

Quote:
>  I dont know the word in english for the german
>"rechtsbndig" so I try to explain it.

For a change, the English is longer than the German :-)
The word (two-word phrase actually) you want is "Right-justified"

Quote:
>I hope this is be right, because i didn t do that for a long time!
>Also sorry for my bad english.

I wish my German were as bad as your English!  My father came
from the Odenwald area - Brombachtal - and tried for years to
teach me German. "No, Papa," I would argue with him, "that's
not a Stuhl, it's a chair!"

After 37 years I still don't speak German and I still don't like
beer.  I'm an embarrassment to his family!

Peter B. Steiger
Cheyenne, WY
----
If you reply by email, send it to pbs at com dot
canada (or vice-versa).  All adverti{*filter*}ts will be
returned to your postmaster, eh!



Mon, 31 Mar 2003 03:00:00 GMT  
 really stupid question from a true pascal newbie.

Quote:
> var money : Real;
> begin
>     Write('Hi there, how much money do you have?');
>     Readln(money);
>     Writeln;
>     Writeln('WOW, you have $',money:10:2,' on you right now?');
>     Readln;                              <--This is because the compiler I use automatically
>                                                   closes the console window, and there is no way
>                                                    to reopen it, so in order to view the program, I
>                                                    have to do this so it waits for input before
>                                                    closing.  Not sure how to comment yet either :)
> end.

   The dummy Readln is (possibly) needed because you're executing in the
TP/BP IDE - that's not the only way of testing a program!  You can
Compile to Disk and execute the .EXE.  Or, you can use Alt-F5 (in the
IDE) to view the execution screen after the IDE has come back.
   I regard the insertion of the dummy Readln as a silly, unnecessary
thing to do, and it invites the potential of a user annoyance/problem
when you forget to remove it from the source of a "production" program
you submit to others as an executable.  Far better to learn how to _use_
the system than to abuse it by insertion of superfluous statements...

Quote:
> (some of the syntax might be off, but the program I have compiles fine!)
> The problem is the output, it looks something like this...
> How much money do you have?
> WOW, you have $    235.99 on you.  Thats Alot!  (or whatever, you get the idea! =)
> My question is whats up with that space between the $ and the number.  Is it
> because I allowed for so many left decimal digits?  Is there any way to allow for
> all those decimal places and have the unused ones go away?  So it looks like
> $235.99?  

   It's due to the Pascal formatting you've applies to the variable
(Money:10:2), which states you wish to display the value with a _minimum_
of 10 spaces (including the sign, ".". and the 2 decimal places) - it
will take whatever it needs, if what's stated isn't enough.  It indicates
that you are overriding the default formatting Pascal applies, and you
can do many other things, as well.
  In this case, you probably should use: Money:1:2


Mon, 31 Mar 2003 03:00:00 GMT  
 really stupid question from a true pascal newbie.
On Thu, 12 Oct 2000 02:34:53 -0700, Vince sez:

Quote:
>This is a multi-part message in MIME format.

>------=_NextPart_000_000B_01C033F5.00A52180
>Content-Type: multipart/alternative;
>    boundary="----=_NextPart_001_000C_01C033F5.00A52180"

Andre already gave us a great explanation of right-justification
and the correct answer, so I'll take care of the Newsreader Of
The Devil.

OK, I won't rant about your choice of newsreaders - I use far
too many of the Evil Empire's products to criticize someone
else.  But I do ask that you go into Outlook Express's news
configuration options and turn off MIME output.  Set it to
plain text instead, so the few remaining folks who are free
of the chains of Microsoft can read messages that aren't
cluttered by all that baggage.

This, in particular, is a big Usenet sin:

Quote:
>------=_NextPart_000_000B_01C033F5.00A52180
>Content-Type: image/jpeg;
>    name="Glacier Bkgrd.jpg"
>Content-Transfer-Encoding: base64

>/9j/4AAQSkZJRgABAgEASABIAAD/7QSqUGhvdG9zaG9wIDMuMAA4QklNA+kAAAAAAHgAAwAAAEgA
>SAAAAAAC2gIo/+H/4QL5AkUDRwUoA/wAAgAAAEgASAAAAAAC2AIoAAEAAABkAAAAAQADAwMAAAAB

{etc. for 150 lines}

Good luck with your learning curve, and thanks for your help in making
Usenet safe for democracy!

Peter B. Steiger
Cheyenne, WY
----
If you reply by email, send it to pbs at com dot
canada (or vice-versa).  All adverti{*filter*}ts will be
returned to your postmaster, eh!



Mon, 31 Mar 2003 03:00:00 GMT  
 really stupid question from a true pascal newbie.



Quote:
>    ?
>    ??? Thanx alot all of you for answering my question.? I didn't even
>    realize that the number was a minimum. :-)? As far as what was told
>    to me about the MIME thing, I have no clue whatsoever what your
>    talking about ;-)? I went to options, and it seems that i'm sending
>    all newsgroup messages in plain text.? Other than that, Im not
>    sure.? I am not big on learning everything I can about OE, I just
>    use it because I'm too lazy to reset the configuration in Netscapes
>    email thing.? So, if you would like to tell me exactly what to do
>    to turn this MIME thing off, then I'll be glad to do it :-)? Thanx

Information via Sig Line 3.

Get rid of that graphic, too.

--

 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
     Plaintext, quoting : see <URL: http://www.usenet.org.uk/ukpost.html>
 Do not Mail News to me.    Before a reply, quote with ">" or "> " (SoRFC1036)



Tue, 01 Apr 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Really newbie question

2. newbie question - reading from keyboard really slow

3. help a realy really really new person at pascal

4. We are really stupid, but we really don't know...

5. Stupid Question No1

6. A Couple of Stupid Questions...

7. newbie pascal question

8. newbie pascal question

9. year 2000 - maybe a stupid question

10. hopefully not a stupid question

11. Question too stupid to be answered ???

12. Stupid question

 

 
Powered by phpBB® Forum Software