রবিবার, ২৪ মার্চ, ২০১৩

What Is Option Strict? - VB.NET | Dream.In.Code


Example
#{example}
"); ipb.editor_values.get('templates')['togglesource'] = new Template("
??? Cancel Source Edit
"); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
  • Icon
  • "); ipb.editor_values.get('templates')['menu_item'] = new Template("
  • #{title}
  • "); ipb.editor_values.get('templates')['togglesource'] = new Template("
    ??? Cancel Source Edit
    "); ipb.editor_values.get('templates')['emoticons_showall'] = new Template(""); ipb.editor_values.get('templates')['emoticon_wrapper'] = new Template("

    Emoticons

    "); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html]\n \n[/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]\n \n Test\n \n[/xml]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"member":{"id":"31","title":"Member","desc":"Given a member name, a link is automatically generated to the member's profile","tag":"member","useoption":"1","example":"[member=skyhawk133] runs this site.","switch_option":"0","menu_option_text":"Input Username of Member","menu_content_text":"","single_tag":"1","optional_option":"0","image":"memberbbcode.png"},"extract":{"id":"33","title":"Extract Blog Entry","desc":"This will allow users to define an extract for an entry. Only this piece of the entry will be displayed on the main blog page and will show up in the RSS feed.","tag":"extract","useoption":"0","example":"[extract]This is an example![/extract]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"blog":{"id":"34","title":"Blog Link","desc":"This tag provides an easy way to link to a blog.","tag":"blog","useoption":"1","example":"[blog=100]Click me![/blog]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"entry":{"id":"35","title":"Blog Entry Link","desc":"This tag provides an easy way to link to a blog entry.","tag":"entry","useoption":"1","example":"[entry=100]Click me![/entry]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"twitter":{"id":"36","title":"Twitter","desc":"A tag to link to a user's twitter account","tag":"twitter","useoption":"0","example":"[twitter]userName[/twitter]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":"twitter.png"},"inline":{"id":"37","title":"Inline Code","desc":"Formats code inline instead of in a seperate code box. ","tag":"inline","useoption":"0","example":"[inline]style=\"font-size: 12px;\"[/inline]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"il":{"id":"38","title":"Abbreviated Inline (IL)","desc":"Abbreviated version of the [inline] tag. ","tag":"il","useoption":"0","example":"[il]Code Here[/il]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":"il2.png"},"code":{"id":"41","title":"Code","desc":"Allows you to enter general code","tag":"code","useoption":"1","example":"[code]$text = 'Some long code here';[/code]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"1","image":""}}) ); ipb.vars['emoticon_url'] = "http://cdn.dreamincode.net/forums/public/style_emoticons/default"; //Search Setup ipb.vars['search_type'] = 'forum'; ipb.vars['search_type_id'] = 67; ipb.vars['search_type_2'] = 'topic'; ipb.vars['search_type_id_2'] = 316493; //]]>

    4 Replies - 29 Views - Last Post: Yesterday, 10:04 PM Rate Topic: -----

    #1 frogfu ?Icon User is offline

    Reputation: 0

    • Posts: 2
    • Joined: Yesterday, 09:04 PM

    Posted Yesterday, 09:07 PM

    I just started learning VB, and my textbook got me confused.

    It started talking about this 'Option Strict' out of nowhere.

    So, uh, what is option strict?

    Is This A Good Question/Topic? 0

    Replies To: What is Option Strict?

    #2 AdamSpeight2008 ?Icon User is offline

    Reputation: 1882

    • Posts: 8,418
    • Joined: 29-May 08

    Re: What is Option Strict?

    Posted Yesterday, 09:10 PM

    Learn to research the documentation (MSDN Link)


    #3 frogfu ?Icon User is offline

    Reputation: 0

    • Posts: 2
    • Joined: Yesterday, 09:04 PM

    Re: What is Option Strict?

    Posted Yesterday, 09:12 PM

    Sorry, I just thought to come here first.

    My teacher said to come here first if I had any questions.

    Oh, and thanks.

    Sorry, I forgot to thank you.


    #4 AdamSpeight2008 ?Icon User is offline

    Reputation: 1882

    • Posts: 8,418
    • Joined: 29-May 08

    Re: What is Option Strict?

    Posted Yesterday, 09:41 PM

    Check the available documentation first (especially MSDN if it Microsoft based).
    Then come here, if you still don't understand. We are more more favorable to those have done some basic research first.


    #5 lar3ry ?Icon User is offline

    Reputation: 192

    • Posts: 790
    • Joined: 12-September 12

    Re: What is Option Strict?

    Posted Yesterday, 10:04 PM

    While AdamSpeight2008's advice is good, I'd like to point out a few benefits that might not be readily apparent from the MSDN docs.

    First, there are several types of errors that can be caused by improper data types. Many of these are fairly straightforward, but some can be obscure and hard to troubleshoot. The problems come when the compiler makes a conversion for you, and then you operate on the converted variable. One of the simplest problems can be illustrated
    as follows:

    
 Dim txt1 As String = "100" Dim txt2 As String = "150" Dim total as Integer = txt1 + txt2 MessageBox.Show(total) 

    What happened? Well, the compiler, instead of adding two numbers, concatenated the two strings, because "+" is an overloaded operator that does the same thing as "&". So now, the concatenated strings have a value of "100150", and assigning that value to total, gives the number 100150, and it did all this without letting you know that you had an error in logic.

    If you use Option Strict On, You will not be able to compile and run the program, because the compiler will insist on you using the right data type. Once you fix that, the program will compile and run, giving you the right answer in the MessageBox.

    Now you might think that this will cause you a lot of extra work in writing your code, but it won't, really.

    When you have that Option turned on, every time you have a data-type mismatch, you will be informed of the error by the presence of a little wiggly line under the offending line (or part of a line). If you move your mouse cursor over the wiggly line, you will be shown the error in a popup tooltip. Often, a small red underline will show up at the end of the wiggly line, and if you move your mouse cursor over that, a red exclamation mark will appear. Click on that,
    and you will usually be shown a suggestion on how to fix the problem. Clicking on the suggestion will apply the correction. So you see, you can actually save keystrokes, in addition to knowing that any bugs you have are not likely to be due to improper data types.

    The real beauty of Option Strict is that it will make you aware of what, exactly your data types are, or what they should be. It doesn't take much browsing through the questions here, to find examples where someone had a problem because he tried to assign a control to a string variable, instead of assigning a property (.Text perhaps?) of that control. Option Strict will make you a better programmer, and you may just find yourself continuing to use it long after setting data types becomes second-nature to you.


    Page 1 of 1


    Source: http://www.dreamincode.net/forums/topic/316493-what-is-option-strict/

    airhead atherosclerosis steven tyler tropic thunder carnie wilson missing reese witherspoon pregnant

    কোন মন্তব্য নেই:

    একটি মন্তব্য পোস্ট করুন