5 Replies - 10414 Views - Last Post: 13 November 2012 - 01:11 PM

#1 Drowjam  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 33
  • Joined: 16-October 12

Would u like to see this in the next vb

Posted 11 November 2012 - 02:38 PM

An operator data type
Such as

Dim op as operator = +

Op would contain an operator such as +,*,^,-

And u could write a code like this

Select case condition
Case con1
Op= *
Case con2
Op = ^
End select

Result = val1 op val2

In con1 it would be val1 * val2 and in con2 it would be val1 ^ val2

If what I'm saying makes any sense would u like to see it or if it already exsist tell me how to use it thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Would u like to see this in the next vb

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1065
  • View blog
  • Posts: 4,167
  • Joined: 02-July 08

Re: Would u like to see this in the next vb

Posted 11 November 2012 - 10:26 PM

Not really needing something like that myself. I get it could make the VB style more sentence like:

Dim minus As Operator = Operator.SetType(Operator.Minus)
Dim equals As Operator = Operator.SetType(Operator.Equals)

Dim one As Integer = 1 
Dim two As Integer = 2

If two minus one equals one then ...

Was This Post Helpful? 0
  • +
  • -

#3 Drowjam  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 33
  • Joined: 16-October 12

Re: Would u like to see this in the next vb

Posted 11 November 2012 - 11:39 PM

Lol sorry I have a bad habit of messing with something then almost instantly start dreaming of ways to make it better. I ain't gonna lie I like this site having access to many talented people is awesome as all el . Like I said I have ideas but 99% of the time I find out its already been not or simply to far from reality to be practical. Also I might add I'm just now kinda hitting my stride. I find that I finally learned enough that everything is starting to make a lot more sense and I can pick up on new concepts much quicker can't wait until I get to where I can do just about anything but that's a few years and a lot of studying later.
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,498
  • Joined: 29-May 08

Re: Would u like to see this in the next vb

Posted 12 November 2012 - 04:52 AM

In your case it makes more sense to use a lambda, more specifically a Func(Of Tx,Ty,Rt)
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6106
  • View blog
  • Posts: 23,654
  • Joined: 23-August 08

Re: Would u like to see this in the next vb

Posted 12 November 2012 - 04:57 AM

Moved to the Discussion Forum
Was This Post Helpful? 0
  • +
  • -

#6 LilGhost  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 98
  • Joined: 12-October 12

Re: Would u like to see this in the next vb

Posted 13 November 2012 - 01:11 PM

Just saying this is in the rules of posting a new thread/topic in the "Do not section":

Quote

Use "txt" speak (i.e. please, hlp, thanks)


Anyways, I'd do what hawk said. At the same time, I discourage this as most programming languages wont allow such operations and it takes less time to write:
If 1 - 1 = 0 Then
' code
End If


And to anyone who is a traditional programmer it will probably make it easier for them to read that as compared to reading:
If one subtract one equals zero Then
' code here
End If


That's just my opinion on it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1