Program parameters/Command Line [VB]

Forum rules
- Ask questions about or share code from languages other than Source Engine scripting.
- Start new topic titles with the code language in brackets (i.e. [C#], [C++], [PHP], etc.)
Locked
User avatar
killman2639
Former Server Admin
Posts: 292
Joined: Mon Aug 23, 2010 8:41 pm

Program parameters/Command Line [VB]

Post by killman2639 » Tue Aug 09, 2011 9:35 pm

Hey guys i was wondering if you could help me with this:

Code: Select all

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer
        Dim u As Integer
        Dim cmd As String = Command()

'        If cmd.Contains("-res") Then

            If cmd.Contains("-res(" & i & "," & u & ")") Then
                Me.Width = i
                Me.Height = u
            Else
                MessageBox.Show("Resolution not supported", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                'Me.Close()
            End If
'        End If 'cmd.Contains("-res")
    End Sub
The point of this is get the integer defined before and set the width and height with the new values in the parameter but the If is comparing whether if the numbers entered are the same as the ones declared before. What i want is to make it read the values that the user wrote in the parameter and then send it to the program (like a cin >>) and set the width and height. Ideas? I was thinking about declaring something in the if but will stay wont work.
Hi, I'm Reloaded. :)

Image

Code: Select all

[GR|CMX] Reelawded | Reloaded :  hi, im black
[GR|CMX] Reelawded | Reloaded :  shit
Disconnect: being black.
Disconnect: being black.

Locked