• Log in or sign up for an account here: https://www.sythe.org/login

A few simple questions. :)

I'm shuddering at your code. I have it fixed, and reduced a bit. Nothing "Advanced" in there that you shouldn't know by now. (It's all in this thread)
 
Answer 17:
Better have a reset function,but not restarting the program.
Make a subroutine that clears everything.
or
Make a procedure that clears the whole game.
 
When no one wins (cats game) it says someone won...

Yea, Covey hats exactly what i thought he would do
 
Thanks for that jazz, i could understand most of it, the things i didn't understand ive added to another question on the first post.

The thing is, i wouldn't think to do any of it like that...as my code shows. I think i just need to learn abit more before i attepmt to make my code as efficient/small as that haha.
 
To answer your things in Question 18.
1). A tag is just a property of a control (explained in 4.). you can store data in that "tag" for later use. You can kinda think of it as a variable.
2). Never seen "MsgAns" used before, i have no idea what it is.
3). "Me" refers to the current form. so if you did "msgbox me.name" on a form load event of a form it would display a message box with the form's name in it.
4). a control is a command button, option button, listbox etc.
 
Ya, my "MsgAns" was undeclared, it should be the same as your "Dim a as VbMessageboxResult"

You should declare it ASAP. Silly of me to forget it, but I'm (unfortunately) only human
 
I know they've been answered, but in one easy to read post.

Question 18:

1: What is a 'Tag' - Tag is just a property to store extra info about a control for further use.
2: Is MsgAns just the same as using 'Dim a as VbMessageboxResult'? - Yes
3: What does 'Me' mean/do? - Me refers to the current form (the form in which it is used, just quicker than typing FormName.Blah.Blah="Blah")
4: What is a control? - A control is anything you add to your form, or in other words anything in your toolbox.
 
Thanks alot once again, im going to be quite busy these next few days so i may not post any more questions.

:)

<3
 
Question 19:

That is extremely easy, assuming you already know how to load a text file into a variable, this is how you do it. Make sure that the textfile has multiple lines (one line for each item in the combo box), then use this code

Code:
Dim Lines() as String 'Dims as array

Lines=Split(Data, VBNewLine) 'This splits the data into sections by line
For i=0 to Ubound(Lines) 'Loops through the data
Combo1.Additem Lines(i) 'Add to a combo box.
Next
Question 20:
The easiest way to use chameleon buttons is to right click your project explorer, and add user control, search for the place you added the chameleon buttons, then select the file. Once selected it will appear in the toolbox. You can manipulate the styles, by altering the ButtonStyle property, I believe. Besides that it is used pretty much the same way as a command button
 
Tidy up your code JD V_V.

Code:
Private Sub ReadFileIntoCombo(File_Path As String, Cmbo As combobox)
Dim lonFF     As Long
Dim tempstr() As String
Dim i         As Integer

      lonFF = FreeFile
      Open File_Path For Binary Access Read As #lonFF
            tempstr = Split(Input(LOF(1), #lonFF), vbCrLf)
            For i = 0 To UBound(tempstr())
                  Cmbo.AddItem tempstr(i)
            Next i
      Close #lonFF
End Sub

Code:
Call ReadFileIntoCombo("C:\ScanSectorLog.dat", Combo1)


And the newer chameleon buttons needs a bit more done to it before you can use it.

  1. Goto your cham button folder
  2. Locate the folder tlb_source
  3. Open it
  4. Locate file MakeLib_sample.bat
  5. Edit it with notepad
  6. Remove the exit line
  7. Save and run
  8. In your VB project, select Projects > References
  9. Locate the file chameleon_dev.tlb in your C:\windows\system32\
  10. Press OK
  11. Load CTL file into project
  12. ???
  13. Proffit
And you're done.
 
Question 21:

1: Open means open File, file_path is self explanitory, Binary Access simply means it reads it like binary (i think). And the lonFF is simply the file number, it opens a piece of open memory.
2: Simply means, right click on project explorer, click add user control, then add the file you want.

Question 22:

Code:
Private Sub Combo1_Click()
    Select Case Combo1.Text
        Case "bla1": text1.text = "blablabla"
        Case "bla2": text1.text = "Blah2"
        Case "Blagger": text1.text = "Boo"
        ...
    End Select
End Sub
 
If what you're clicking on in the Combo Box is exactly what you want to appear in the textbox then you can just do this instead of using cases.
Code:
Private Sub Combo1_Click()
  Text1.Text = Combo1.Text
End Sub

About the only thing you can do to shorten the code using cases for different values clicked on is to have a variable store the output before putting it into the textbox like this.
Code:
Private Sub Combo1_Click()
  Select Case Combo1.Text
    Case "Hello": a = "Helloooo"
    Case "Hi": a = "Hiiii"
    Case "Cya": a = "Cyaaaaaaa"
    Case "Bye": a = "Byeeeeeee"
  End Select
  Text1.Text = a
End Sub
 
Which bit of this code actually looks through the HTML, and selects each number etc. Could someone annotate it please :)
How would i find the string number from some text in a text box. Something like this:

hello 3 bye e jazz f dave w covey 6 halo 3 jds

I want to find the 4th string, and print it; So therefore it would print 'Dave', It also has to skip any single characters =)
Split function, for both. The hiscores lookup splits the html string at the linefeed char, retrieves the element, and splits again with the "," char and gets the element again.

And you merely need to split the string "
hello 3 bye e jazz f dave w covey 6 halo 3 jds"
at the " " space string.
Then you can either make a function that strips out all 1 char length string elements... or use a loop to search for elements, skipping those elements. You wouldn't use a for loop for the latter, of course... you'd need a do .. until or w/e so you can define incrementor.
 
duelarena.gg
Back
Top