Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Compile options in VB9 – compare and infer

2008-12-13

These options can also be set for all modules in the project settings window, or for each file in code. If the settings are in conflict, the setting written in code overrides the project setting.

Option compare
This option simply tells if strings will be compared case sensitive (option compare text) or binary (option compare binary). So, given that option compare is set to binary, A is set to False, otherwise True.

Dim A As Boolean = (“ABC” = “abc”)

Option infer
This option can be on or off. When infer is set to on, you do not have to type out the data type of a variable when you are declaring it.

This code will make A an Integer, since it is initialized with a integer value, and B a Short, since it is initialized with a short integer value.

Dim A = 1
Dim B = 2S

When option infer is set to off, you must type out the name of the datatype. Either way, the code is still type safe.

Categories: Visual Basic 9

Tags: Compile options

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips