IronNoob

Please login or register.

Login with username, password and session length
Advanced search  

News:

Migrated to dedicated hosting. Post any weirdness you observe in the Lounge.

Author Topic: Visual basic question?  (Read 98 times)

0 Members and 1 Guest are viewing this topic.

HatHelper

  • RBX Spec Ops
  • Hero Member
  • *****
  • Online Online
  • Posts: 2715
    • View Profile
Visual basic question?
« on: April 14, 2013, 05:47:45 pm »

Any way of doing this

Table = {["test"]=5}
print(Table.test)

in Visual Basic, without loops?
Logged
death to incredibar maker

Void_Knight

  • Man of Mystery
  • Global Moderator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9602
  • Nope, Void_Knight.
    • View Profile
Re: Visual basic question?
« Reply #1 on: April 14, 2013, 06:10:31 pm »

If you were using C#, you could take advantage of Indexers.

I'm not sure if VB has them.

http://msdn.microsoft.com/en-us/library/6x16t2tx.aspx
Logged

Void_Knight

  • Man of Mystery
  • Global Moderator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9602
  • Nope, Void_Knight.
    • View Profile
Re: Visual basic question?
« Reply #2 on: April 14, 2013, 06:33:46 pm »

I couldn't really figure out how to not use a loop with this.

But really, iterative loops aren't problematic with lots of data in them (especially lists)

Quote
Table t = new Table();
t["X"] = "Hi there nigger.";
Console.WriteLine(t["X"]);

Was the result of:

Quote
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace test
{
    class Table
    {
        List<List<object>> arrayList = new List<List<object>>();
        public object this[object index]
        {
            get
            {
                foreach (List<object> e in arrayList.ToArray())
                {
                    if (e.ToArray()[0] == index)
                    {
                        return e.ToArray()[1];
                    }
                }
                return null;
            }
            set
            {
                List<object> bits = new List<object>();
                bits.Add(index);
                bits.Add(value);
                arrayList.Add(bits);
            }
        }
    }
}
Logged

Void_Knight

  • Man of Mystery
  • Global Moderator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9602
  • Nope, Void_Knight.
    • View Profile
Re: Visual basic question?
« Reply #3 on: April 14, 2013, 06:37:56 pm »

I know, not Visual Basic. But I haven't done VB in about two years... plus things like this for VB are really difficult to implement into VB code (which is ironic, because VB is supposed to be "BASIC".)
Logged

HatHelper

  • RBX Spec Ops
  • Hero Member
  • *****
  • Online Online
  • Posts: 2715
    • View Profile
Re: Visual basic question?
« Reply #4 on: April 15, 2013, 05:37:49 pm »

thanks, altho i wont be getting into c# until after summer
Logged
death to incredibar maker

ikutoisahobo

  • Merry Christmas!
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 22471
  • Former Global Moderator Q2-Q4 - 2012
    • View Profile
    • My Twitter
Re: Visual basic question?
« Reply #5 on: April 15, 2013, 11:01:42 pm »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
Logged
    

Void_Knight

  • Man of Mystery
  • Global Moderator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9602
  • Nope, Void_Knight.
    • View Profile
Re: Visual basic question?
« Reply #6 on: April 16, 2013, 12:31:35 am »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
Lucky bastard. >:c
Logged

HatHelper

  • RBX Spec Ops
  • Hero Member
  • *****
  • Online Online
  • Posts: 2715
    • View Profile
Re: Visual basic question?
« Reply #7 on: April 16, 2013, 12:21:23 pm »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
our school's principle is such a cowardly spineless dipshit that he removed all computer classes my sophomore and junior year after some sophomores "hacked" into the system to control other people's computers.
only just now( i heard) he was forced to put the classes back.
Logged
death to incredibar maker

mat852

  • RBX Spec Ops
  • Hero Member
  • *****
  • Online Online
  • Posts: 3592
  • Lua / Visual Basic / bit of C#
    • View Profile
    • Youtube Channel
Re: Visual basic question?
« Reply #8 on: April 16, 2013, 03:53:40 pm »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
our school's principle is such a cowardly spineless dipshit that he removed all computer classes my sophomore and junior year after some sophomores "hacked" into the system to control other people's computers.
only just now( i heard) he was forced to put the classes back.
the fuck

lol i want to do that to my network.
Logged
    

Intel i5 3570K @ 4.4GHz
8GB Corsair Vengeance RAM
GeForce GTX 680 DirectCU II

jamjam195

  • RBX Spec Ops
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9288
  • Why, hello there.
    • View Profile
    • Bobstudios
Re: Visual basic question?
« Reply #9 on: April 16, 2013, 04:00:45 pm »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
our school's principle is such a cowardly spineless dipshit that he removed all computer classes my sophomore and junior year after some sophomores "hacked" into the system to control other people's computers.
only just now( i heard) he was forced to put the classes back.
the fuck

lol i want to do that to my network.

My school uses LanSchool so...

You can watch them as they slowly type their password and log in as them and can seize control of their mouse and keyboard // or login to a admin computer (because someone always ends up with one in Science computer room) and use Lanschool to fuck around with them...
Logged
Why Hello There.

Alternative: Wopian
Bobstudios | WPM: 81 | World of Wopian

Void_Knight

  • Man of Mystery
  • Global Moderator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 9602
  • Nope, Void_Knight.
    • View Profile
Re: Visual basic question?
« Reply #10 on: April 16, 2013, 07:26:19 pm »

thanks, altho i wont be getting into c# until after summer

Wow, I was able to take C++ in 9th.
our school's principle is such a cowardly spineless dipshit that he removed all computer classes my sophomore and junior year after some sophomores "hacked" into the system to control other people's computers.
only just now( i heard) he was forced to put the classes back.
the fuck

lol i want to do that to my network.
My highschool had so many loopholes, it was funny.
I think the only thing stopping me from abusing the holes was the fact I'm a nice guy & I like to keep out of trouble.

Me being me, I just told the Technicians.
Of course on the last year of highschool, being a student technician meant I couldn't abuse it anyway because that'd be really bad for me.

I can use being a student technician at school as a reference-thing. :D
Logged

ikutoisahobo

  • Merry Christmas!
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 22471
  • Former Global Moderator Q2-Q4 - 2012
    • View Profile
    • My Twitter
Re: Visual basic question?
« Reply #11 on: April 16, 2013, 11:12:11 pm »

We had this single machine and on it were like 10-15 virtual computers, the icons and files were linked to each of the VM's. Used to have so much fun renaming icons and making random text files saying "OPEN ME!!!"

everybody used to get a kick out of it.
Logged
    
 

Page created in 0.141 seconds with 21 queries.