Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - BlakPilar

Pages: 1 ... 16 17 [18] 19 20 ... 49
256
Computer Programming / Re: C++ Help Please!
« on: January 14, 2012, 01:33:07 am »
2. cin.get() ?
3. There's a sleep method, but I only know of the Windows-only one. You would need to import the windows.h header and then you could use Sleep(time_in_milliseconds);

257
Computer Programming / Re: Visual Basic problem
« on: January 13, 2012, 05:07:16 pm »
Ok, so, this will only work if there is an equals sign in the text line, but here's what I came up with that worked:
Spoiler For code:

Public Class frmMain
    Dim parseNum As Integer = 1

    Private Sub btnParse_Click(sender As System.Object, e As System.EventArgs) Handles btnParse.Click
        Dim varsNode As TreeNode = New TreeNode("Parse #" & parseNum)                   'Setup our variable node
        parseNum = parseNum + 1                                                         'Increment our parse number
        For lineNum As Integer = 0 To txtEdit.Lines.Count - 1                           'For each line
            Dim lineText As String = txtEdit.Lines(lineNum).Trim()                      'Get the text at line lineNum while trimming whitespace characters
            If Not lineText.StartsWith("//") Then                                       'If the line is not a comment
                Dim var As String = lineText.Substring(0, lineText.LastIndexOf("="))    'Get the variable name
                If Not DoesNodeExist(varsNode, var) Then                                'If we have not already added a certain variable
                    varsNode.Nodes.Add(New TreeNode(var))                               'Add a new node with the variable
                End If
            End If
        Next lineNum
        tvwVars.Nodes.Add(varsNode)                                                     'Finally we add our vars node
    End Sub

    Private Function DoesNodeExist(ByVal parent As TreeNode, ByVal text As String) As Boolean
        For Each node As TreeNode In parent.Nodes                                       'For each child node in the provided parent
            If node.Text = text Then
                Return True                                                             'If a node already exists, return true
            End If
        Next node
        Return False                                                                    'If we have not already returned true, return false
    End Function
End Class

tvwVars is my TreeView.
EDIT: This adds "var NAME" to the vars node. I'm sure you can parse the string from there ;)

258
Computer Programming / Re: Visual Basic problem
« on: January 13, 2012, 04:17:47 pm »
Wait... Why are you making it so complicated? What is your overall goal? To make sure there are no nodes with the same text?

Private Sub DoesNodeExist(ByVal parent As TreeNode, ByVal text As String) As Boolean
    For Each node As TreeNode In parent.Nodes
        If node.Text = text Then Return True
    Next node
    Return False
End Sub

That method will go through every single node in the provided parent node and check to see if a node contains the specified text. That is, if that's what you're trying to do. (Also, I'm a bit rusty on VB, but I'm 99% sure that's all correct.)

Then, to use it, you would do this:

String var = linetext.Substring(0, linetext.LastIndexOf("="))
If Not DoesNodeExist(varsnode, var) Then
    node = New TreeNode(var)   'This is assuming you want to store the recently added treenode
    varsnode.Add(node)
End If

259
News / Re: TotKotM released on Amazon, iTunes, eMusic & Zune!
« on: January 13, 2012, 03:07:46 pm »
I shall check when I get home! (Which will be in about 25 minutes)

EDIT: Yup! I just got it having the Zune Pass :D also, it says Xaminaga is the most played.

260
News / Re: TotKotM released on Amazon, iTunes, eMusic & Zune!
« on: January 13, 2012, 07:11:56 am »
Awesome! Do you know if it can be bought on Zune if I have the Zune Pass? If not I'll just ask my parents about getting it regularly.

261
Computer Programming / Re: Visual Basic regex
« on: January 13, 2012, 07:09:53 am »
No problem! Let me know if it works :)

262
Computer Programming / Re: Visual Basic regex
« on: January 12, 2012, 06:09:26 pm »
Hmm... Well, as far as I know, this isn't regular expressions (regex). ContainsKey only checks the name of the node, not the text. That's more than likely your problem because new TreeNode("text") just sets the text, not the name.
EDIT: Check this MSDN page to see what I mean.

Question, though: is linetext always guaranteed to have an equals sign in it?

263
Computer Programming / Re: Best language for beginners?
« on: January 12, 2012, 04:52:04 pm »
Well what I would have said is pretty much what Qwerty has already established, but here's what else I have to say:

My programming track record goes: TI-BASIC => VB.NET => VB6 for school => C# (my main language of choice) => C++ (still learning) => Java (still learning). I also dabble in z80 and x86/x64 Assembly in my spare time. Overall I thought transitioning between each successive language (minus asm) was fairly easy because all of the fundamentals are the same, you're pretty much just learning a new syntax. It all depends on what level you want to start on. Though, if I had to choose a language, I would say C#. The only downside to C#, in my opinion, is its use of the .NET framework. Though yes there is Mono for Linux and Mac, some code is not always portable (such is the problem with my program BexIDE, though it's not entirely my fault).

264
Okay, so, this is just an update on the progress. I have implemented tabs (along with save all), fixed sprite insertion for tilemaps, modified the SpriteDesigner component (what you'll notice on the user side, though, is you can click and drag now), find/replace scope is now all opened documents (DJ O ;)), sprite insertion can now be tilemap or bitmap format, and there's a program manager to edit all opened programs. The picture editor is in the works (the library is at it's core complete), and I have a fairly good idea on how I'm going to do the tilemap editor.
EDIT: Oh, and the editors automatically detect code folding for Axe or BASIC.

Auto-indentation, however, might be saved for version 1.3 (sorry Wellen :/). If I or others can't think of any other features for next versions (1.2 is pretty much set in stone at the moment), then I'll see about adding auto-indent and maybe auto-complete to 1.2.

EDIT 2: I'll be working on my own, but does someone want to try to make an icon no larger than 32x32? ;)

265
TI Z80 / Re: OPIA - A full OOP language for z80
« on: January 09, 2012, 09:18:18 pm »
Woah, that's a really helpful feature!

266
TI Z80 / Re: OPIA - A full OOP language for z80
« on: January 09, 2012, 05:31:35 pm »
Ahh, okay, I didn't look hard enough lol. Thanks.

267
TI Z80 / Re: OPIA - A full OOP language for z80
« on: January 09, 2012, 04:58:38 pm »
Ahh, okay. What language would the libraries be written in? OPIA, ASM, other?

As for the language drop, I'm okay with it; I like learning new languages :) (I'm studying Russian by myself right now ;D)

As for the example, do we not need to declare a value's type? (nextPrime, prime)

268
Okay, two it is then :)

269
Alrighty then. In Bex, is 2 spaces acceptable for a tab? If you press TAB it will still insert the tab character, but it would only display it as two spaces. Is that enough, or should I go for the standard 4 (or some other number)? (Example attached)

270
Also, when opening a file, which has already been written in another IDE or on-calc.

I knew you were going to say that ;) that'd require me to do some post-opening editing (to indent everything correctly), but I don't think it would be too hard. Would it be better on-calc to have the tabs replaced by zero, one, or more spaces?

Pages: 1 ... 16 17 [18] 19 20 ... 49