SA-MP Forums Archive
Equivelent #define in vb.net? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Equivelent #define in vb.net? (/showthread.php?tid=453641)



Equivelent #define in vb.net? - FireCat - 25.07.2013

Whats the equivelent of #define in visual basic 2010?


Re: Equivelent #define in vb.net? - GWMPT - 25.07.2013

#Const <constant> = <value>


Re: Equivelent #define in vb.net? - FireCat - 25.07.2013

Quote:
Originally Posted by Kikito
Посмотреть сообщение
#Const <constant> = <value>
It ain't, I've tried that, and it won't work.


Re: Equivelent #define in vb.net? - KingHual - 25.07.2013

http://msdn.microsoft.com/en-us/library/zb8fth98.aspx

Off-topic: I like your avatar


Re: Equivelent #define in vb.net? - ReVo_ - 25.07.2013

http://msdn.microsoft.com/en-us/library/zb8fth98.aspx

Just use

class classname
{
public const int hello = 5;
}

Then use

classname.hello

edit: oh vb.net, i think is

Dim Const hello As Integer = 5

See the url for more info


Re: Equivelent #define in vb.net? - Slice - 01.08.2013

There is no equivalent of #define in VB. In fact, C/C++ doesn't have #define directives as flexible as Pawn.

There are similar ways - ****** "visual basic macros" and you might find some info on that.