[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

language explanation

Posted on 2004-09-18
3
Medium Priority
?
192 Views
Last Modified: 2010-04-09
can someone please tell me what the {0} and the {1:f} do in the code below. f is just a number variable.
response.output.write("<tr><td>{0}</td><td>" & _
"{1:f}</td></tr>", f, ToCelsius(f))
0
Comment
Question by:coletteck8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 400 total points
ID: 12092876
Hi coletteck8,

Er...

This is ASP.NET formatting.

Response.Output.Write can format a string, this actually is kind of like sprintf in other languages.


The things in {0} is kind of a backreference per say. The {0} means the first argument after this one, meaning f. The {1} indicates the next one, which is ToCelsius(f), and I believe you can have up to {2} in most cases.

So, if in the above, every {0} just means INSERT f there.

THe second one is {1:f}. The 1 is self-explanatory, insert the ToCelsius(f) there, but the f I believe is to make ToCelsius(f) a float, but I'm not sure...

Regards,
Zyloch
0
 

Author Comment

by:coletteck8
ID: 12092907
thanks for the help even though i put it in the wrong area!
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12092912
No problem, glad to help =)

I'm actually not too good at ASP, but many of the experts in this area know more than one web language at least partially.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question