Example
#{example}"); ipb.editor_values.get('templates')['togglesource'] = new Template(""); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = 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]4 Replies - 29 Views - Last Post: Yesterday, 10:04 PM
#1
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?
Replies To: What is Option Strict?
#2
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
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
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
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/
safehouse brown recluse brown recluse front door alyssa bustamante protandim weightless
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.