Page 1 of 2 12 LastLast
Results 1 to 40 of 43

Thread: err help

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    err help

    Hi there annoying Pita again... had a little help getting some code written but i've got a few error messages i cannot get rid of, below i've indluded the code and errors i am getting. Sorry but they are text files as i ran out of space to simply copy and paste.

    Can anyone fix the errors up and/or tell me how they did or would do it.
    Attached Files Attached Files

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    You know... you could have just included the project, instead of making us do the download.open.copy.openvsnet2003.paste thing.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Where did you get this code from?

    For starters, your command buttons have not been properly defined. THey should be:

    VB Code:
    1. Private WithEvents Townbutton As System.Windows.Forms.Button
    2.         Private WithEvents AddQuest As System.Windows.Forms.Button

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Oh great... there are more. Most of your errors have been fixed now:

    VB Code:
    1. Public Class MainForm
    2.         Inherits System.Windows.Forms.Form
    3.         Private WithEvents DarkBlizzardPassbutton As System.Windows.Forms.Button
    4.         Private MarkerStonecomboBox As System.Windows.Forms.ComboBox
    5.         Private CausewaycomboBox As System.Windows.Forms.ComboBox
    6.         Private PaintscomboBox As System.Windows.Forms.ComboBox
    7.         Private CotleycomboBox As System.Windows.Forms.ComboBox
    8.         Private WithEvents Ashwoodbutton As System.Windows.Forms.Button
    9.         Private WithEvents AddQuest As System.Windows.Forms.Button
    10.         Private WithEvents Cotleybutton As System.Windows.Forms.Button
    11.         Private TowncomboBox As System.Windows.Forms.ComboBox
    12.         Private TokenscomboBox As System.Windows.Forms.ComboBox
    13.         Private WithEvents Paintsbutton As System.Windows.Forms.Button
    14.         Private WithEvents MarkerStonesbutton As System.Windows.Forms.Button
    15.         Private label7 As System.Windows.Forms.Label
    16.         Private WithEvents Darkwellbutton As System.Windows.Forms.Button
    17.         Private DarkBlizzardPasscomboBox As System.Windows.Forms.ComboBox
    18.         Private label3 As System.Windows.Forms.Label
    19.         Private label2 As System.Windows.Forms.Label
    20.         Private label1 As System.Windows.Forms.Label
    21.         Private AshwoodcomboBox As System.Windows.Forms.ComboBox
    22.         Private label6 As System.Windows.Forms.Label
    23.         Private label5 As System.Windows.Forms.Label
    24.         Private label4 As System.Windows.Forms.Label
    25.         Private WithEvents Tokensbutton As System.Windows.Forms.Button
    26.         Private WithEvents Townbutton As System.Windows.Forms.Button
    27.         Private label9 As System.Windows.Forms.Label
    28.         Private label8 As System.Windows.Forms.Label
    29.         Private DarkwellcomboBox As System.Windows.Forms.ComboBox
    30.         Private WithEvents Causewaybutton As System.Windows.Forms.Button



    Now, what is AddQuestForm?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: help!

    thank you for helping.. definately solved a lot of headaches, sorry if i'm creating a lot of hassle... bout the only thing i'm good at.. <G>. Went down to jut threee errors though went i added addquest.vb went up to 11 again...

    i've added the adquest vb below..
    Attached Files Attached Files

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Where's the SLN file?

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    ZIP the ENTIRE folder please.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    oops

    told you i was a moron when it comes to this... well just about anything...
    Attached Files Attached Files

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I have two suggestion to make, which will be helpful to you in the future.

    One is, use proper naming conventions for your objects so that another person reading it knows what you're doing.

    I just had a harrowing time figuring out what exactly you were doing, and what exactly a "dark blizzard" is

    Second, comments help tremenduously. It may seem trivial at first, but as your coding progresses and your app grows larger, you'll have a harder time knowing what you just did and where.

    With that said, here's the code to be used in AddQuestform.vb:

    VB Code:
    1. Imports System.Xml
    2. Imports System.io
    3.  
    4. Public Class AddQuestform
    5.     Inherits System.Windows.Forms.Form
    6.     Friend Label2 As System.Windows.Forms.Label
    7.     Friend Label1 As System.Windows.Forms.Label
    8.     Friend TextBox1 As System.Windows.Forms.TextBox
    9.     Friend TextBox2 As System.Windows.Forms.TextBox
    10.     Friend WithEvents Button1 As System.Windows.Forms.Button
    11.     Friend ComboBox1 As System.Windows.Forms.ComboBox
    12.     Friend Label3 As System.Windows.Forms.Label
    13.    
    14.  
    15.     Dim mainform As WindowsApplication1.DefaultNamespace.MainForm
    16.  
    17.  
    18.  
    19.  
    20. #Region " Windows Form Designer generated code "
    21.  
    22.     Public Sub New(ByRef mainform As Form)
    23.         MyBase.New()
    24.  
    25.         mainform = mainform
    26.  
    27.         'This call is required by the Windows Form Designer.
    28.         InitializeComponent()
    29.  
    30.         'Add any initialization after the InitializeComponent() call
    31.  
    32.     End Sub
    33.  
    34.     'Form overrides dispose to clean up the component list.
    35.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    36.         If disposing Then
    37.             If Not (components Is Nothing) Then
    38.                 components.Dispose()
    39.             End If
    40.         End If
    41.         MyBase.Dispose(disposing)
    42.     End Sub
    43.  
    44.     'Required by the Windows Form Designer
    45.     Private components As System.ComponentModel.IContainer
    46.  
    47.     'NOTE: The following procedure is required by the Windows Form Designer
    48.     'It can be modified using the Windows Form Designer.  
    49.     'Do not modify it using the code editor.
    50.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    51.         Me.Label3 = New System.Windows.Forms.Label
    52.         Me.ComboBox1 = New System.Windows.Forms.ComboBox
    53.         Me.Button1 = New System.Windows.Forms.Button
    54.         Me.TextBox2 = New System.Windows.Forms.TextBox
    55.         Me.TextBox1 = New System.Windows.Forms.TextBox
    56.         Me.Label1 = New System.Windows.Forms.Label
    57.         Me.Label2 = New System.Windows.Forms.Label
    58.         Me.SuspendLayout()
    59.         '
    60.         'Label3
    61.         '
    62.         Me.Label3.Location = New System.Drawing.Point(56, 64)
    63.         Me.Label3.Name = "Label3"
    64.         Me.Label3.Size = New System.Drawing.Size(112, 24)
    65.         Me.Label3.TabIndex = 5
    66.         Me.Label3.Text = "Name: "
    67.         '
    68.         'ComboBox1
    69.         '
    70.         Me.ComboBox1.Items.AddRange(New Object() {"Area1", "Area2", "Area3", "Area4"})
    71.         Me.ComboBox1.Location = New System.Drawing.Point(192, 16)
    72.         Me.ComboBox1.Name = "ComboBox1"
    73.         Me.ComboBox1.Size = New System.Drawing.Size(144, 21)
    74.         Me.ComboBox1.TabIndex = 0
    75.         AddHandler Me.ComboBox1.SelectedIndexChanged, AddressOf Me.ComboBox1SelectedIndexChanged
    76.         '
    77.         'Button1
    78.         '
    79.         Me.Button1.Location = New System.Drawing.Point(200, 304)
    80.         Me.Button1.Name = "Button1"
    81.         Me.Button1.Size = New System.Drawing.Size(120, 48)
    82.         Me.Button1.TabIndex = 4
    83.         Me.Button1.Text = "Save!"
    84.         '
    85.         'TextBox2
    86.         '
    87.         Me.TextBox2.Location = New System.Drawing.Point(192, 64)
    88.         Me.TextBox2.Name = "TextBox2"
    89.         Me.TextBox2.Size = New System.Drawing.Size(184, 20)
    90.         Me.TextBox2.TabIndex = 6
    91.         Me.TextBox2.Text = ""
    92.         '
    93.         'TextBox1
    94.         '
    95.         Me.TextBox1.Location = New System.Drawing.Point(192, 112)
    96.         Me.TextBox1.Multiline = True
    97.         Me.TextBox1.Name = "TextBox1"
    98.         Me.TextBox1.Size = New System.Drawing.Size(344, 168)
    99.         Me.TextBox1.TabIndex = 2
    100.         Me.TextBox1.Text = ""
    101.         '
    102.         'Label1
    103.         '
    104.         Me.Label1.Location = New System.Drawing.Point(56, 16)
    105.         Me.Label1.Name = "Label1"
    106.         Me.Label1.Size = New System.Drawing.Size(112, 24)
    107.         Me.Label1.TabIndex = 1
    108.         Me.Label1.Text = "Select Area:"
    109.         '
    110.         'Label2
    111.         '
    112.         Me.Label2.Location = New System.Drawing.Point(56, 120)
    113.         Me.Label2.Name = "Label2"
    114.         Me.Label2.Size = New System.Drawing.Size(112, 32)
    115.         Me.Label2.TabIndex = 3
    116.         Me.Label2.Text = "Commands (one per line):"
    117.         '
    118.         'AddQuestform
    119.         '
    120.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    121.         Me.ClientSize = New System.Drawing.Size(568, 374)
    122.         Me.Controls.Add(Me.TextBox2)
    123.         Me.Controls.Add(Me.Label3)
    124.         Me.Controls.Add(Me.Button1)
    125.         Me.Controls.Add(Me.Label2)
    126.         Me.Controls.Add(Me.TextBox1)
    127.         Me.Controls.Add(Me.Label1)
    128.         Me.Controls.Add(Me.ComboBox1)
    129.         Me.Name = "AddQuestform"
    130.         Me.Text = "AddQuestform"
    131.         Me.ResumeLayout(False)
    132.     End Sub
    133.  
    134. #End Region
    135.  
    136.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    137.         If ComboBox1.SelectedIndex > -1 Then
    138.             Dim filename = ComboBox1.SelectedItem & ".xml"
    139.             Dim fStrm As FileStream
    140.             Try
    141.                 fStrm = New FileStream(filename, FileMode.Truncate, FileAccess.Write)
    142.             Catch ex As Exception
    143.                 Try
    144.                     fStrm = New FileStream(filename, FileMode.Create, FileAccess.Write)
    145.                 Catch ex2 As Exception
    146.                     MessageBox.Show("cannot save file")
    147.                     Exit Sub
    148.                 End Try
    149.             End Try
    150.  
    151.             Dim xtw As New XmlTextWriter(fStrm, System.Text.Encoding.UTF8)
    152.             xtw.Formatting = Formatting.Indented
    153.             xtw.Indentation = 2
    154.             xtw.QuoteChar = """"c
    155.             xtw.WriteStartDocument(True)
    156.             xtw.WriteStartElement("Quests")
    157.             For Each quest As QuestStorage In mainform.getComboBoxForArea(ComboBox1.SelectedItem)
    158.                 xtw.WriteStartElement("Quest")
    159.                 xtw.WriteElementString("Name", quest.ToString())
    160.                 xtw.WriteStartElement("Commands")
    161.                 For Each line As String In quest.getCommands()
    162.                     xtw.WriteElementString("Command", line)
    163.                 Next
    164.                 xtw.WriteEndElement()
    165.                 xtw.WriteEndElement()
    166.             Next
    167.  
    168.             xtw.WriteStartElement("Quest")
    169.             xtw.WriteElementString("Name", TextBox2.Text)
    170.             xtw.WriteStartElement("Commands")
    171.             For Each line As String In TextBox1.Text.Split(vbCrLf)
    172.                 If (line.Chars(0) = vbLf) Then
    173.                     line = line.Substring(1)
    174.                 End If
    175.  
    176.                 xtw.WriteElementString("Command", line)
    177.             Next
    178.             xtw.WriteEndElement()
    179.             xtw.WriteEndElement()
    180.             xtw.WriteEndElement()
    181.             xtw.WriteEndDocument()
    182.             xtw.Close()
    183.  
    184.             mainform.loadQuests()
    185.             MessageBox.Show("Quest: " & TextBox2.Text & " is saved!")
    186.         End If
    187.     End Sub
    188.     Private Sub ComboBox1SelectedIndexChanged(sender As System.Object, e As System.EventArgs)
    189.    
    190.    
    191.     End Sub
    192.    
    193. End Class

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    First of thanks for all the help mendhak its really appreciated. i've copied the code to the vb file and i'm still getting a hole host of errors... do you think we could talk over msn or aim or soemthing perhaps you could talke me through and sort the problems quicker that way, i could explain excactly what its ment to do and hopefully get it fixed?

  11. #11
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Sorry, I am not open to talking over any messenger, because I am too poor to afford one.

    You can post your errors and problems here.

    One thing I did notice in your solution when I opened it up, was that Form1.VB was showing an error there. Apparently, you must have renamed or removed it improperly. I deleted Form1.vb from the solution explorer.

    I'm attaching the corrected project here:
    Attached Files Attached Files

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re help:

    as far as i know the messenger programs i liseted were free least i'm not paying apenny for them... gonna take a peek at the new zip you sent

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re; err help!

    ok tried compiling what you sent in that zip file, got the following build errors... getting closer though


    ------ Build started: Project: questerer Configuration: Debug ------
    Performing main compilation...


    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(15) : error BC30002: Type 'WindowsApplication1.DefaultNamespace.MainForm' is not defined.

    Dim mainform As WindowsApplication1.DefaultNamespace.MainForm
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(22) : error BC30002: Type 'Form' is not defined.

    Public Sub New(ByRef mainform As Form)
    ~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(142) : error BC30002: Type 'Exception' is not defined.

    Catch ex As Exception
    ~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(145) : error BC30002: Type 'Exception' is not defined.

    Catch ex2 As Exception
    ~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(146) : error BC30451: Name 'MessageBox' is not declared.

    MessageBox.Show("cannot save file")
    ~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(171) : error BC30451: Name 'vbCrLf' is not declared.

    For Each line As String In TextBox1.Text.Split(vbCrLf)
    ~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(185) : error BC30451: Name 'MessageBox' is not declared.

    MessageBox.Show("Quest: " & TextBox2.Text & " is saved!")
    ~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(3) : error BC30002: Type 'ArrayList' is not defined.

    Private commandList As New ArrayList
    ~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(14) : error BC30002: Type 'ArrayList' is not defined.

    Public Function getCommands() As ArrayList
    ~~~~~~~~~

    Build complete -- 10 errors, 0 warnings

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    just occured to me to let ya know ha's going on there might be a better way of doing things!

    I'm trying to create a program that will have various buttons for different locations within a game a play, these buttons should trigger of a pattern of commands being sent to that game to do whatever it is thats needed to be done, move the character north picking up items etc.

    preferably these commands would be stored in atext file or somesuch that is easily editable, so i can change whats going on wtihout having to rewrite another program.

    the program would also have to send a 1 second pause after each line from the text file is sent

    as an example:

    Line 1 :<whatever the commands are>
    wait one second
    Line 2 :<whatever the commands are>

    etc.
    etc.

    hope that helps with either getting what i;ve got so far to work correctly or getting soemthing that will!

  15. #15
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Here's a good question:

    How exactly have you come across this code? Did you place the buttons on the form yourself or what?

    I think you have a serious problem with your IDE. The error messages I just saw are odd, odd in the sense that they appear.

    Try adding the following lines to the top of your code:

    VB Code:
    1. Imports System
    2. Imports System.Object
    3. Imports Microsoft.VisualBasic

    And see how many errors it comes down to.

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    well done to seven now.

    ------ Build started: Project: questerer Configuration: Debug ------
    Performing main compilation...


    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(19) : error BC30002: Type 'WindowsApplication1.DefaultNamespace.MainForm' is not defined.

    Dim mainform As WindowsApplication1.DefaultNamespace.MainForm
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(26) : error BC30002: Type 'Form' is not defined.

    Public Sub New(ByRef mainform As Form)
    ~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(150) : error BC30451: Name 'MessageBox' is not declared.

    MessageBox.Show("cannot save file")
    ~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(189) : error BC30451: Name 'MessageBox' is not declared.

    MessageBox.Show("Quest: " & TextBox2.Text & " is saved!")
    ~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(3) : error BC30002: Type 'ArrayList' is not defined.

    Private commandList As New ArrayList
    ~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(14) : error BC30002: Type 'ArrayList' is not defined.

    Public Function getCommands() As ArrayList
    ~~~~~~~~~

    Build complete -- 7 errors, 0 warnings

  17. #17
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Imports System.Collections
    Imports System.Windows.Forms

  18. #18

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help!

    wooo just three now

    ------ Build started: Project: questerer Configuration: Debug ------
    Performing main compilation...


    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(21) : error BC30002: Type 'WindowsApplication1.DefaultNamespace.MainForm' is not defined.

    Dim mainform As WindowsApplication1.DefaultNamespace.MainForm
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(3) : error BC30002: Type 'ArrayList' is not defined.

    Private commandList As New ArrayList
    ~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\QuestStorage.vb(14) : error BC30002: Type 'ArrayList' is not defined.

    Public Function getCommands() As ArrayList
    ~~~~~~~~~

    Build complete -- 3 errors, 0 warnings

  19. #19
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    That's it.

    Dude... your IDE is seriously messed up. Your application is running perfectly fine on my machine (except the XML part) and don't even have the Imports statements in there.

  20. #20

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    heh well that's sharpdevelop for you... guess it doesn't do quite as much as say visual studio... I'll have to get that as soon as i can afford it... well thanks for your help ths far anyhow... guess it just wasn;t ment to be!

  21. #21
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: re: err help

    Originally posted by Bobba
    heh well that's sharpdevelop for you... guess it doesn't do quite as much as say visual studio... I'll have to get that as soon as i can afford it... well thanks for your help ths far anyhow... guess it just wasn;t ment to be!

    I had no idea what sharpdevelop was!

    No wonder... ok, hold on, let me check a few more things.

  22. #22

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    sharpdevelop is the program i'm using to write this stuff... i'll try nd find a link for it.. http://www.icsharpcode.net/OpenSource/SD/ wel thats the hompage... might help niot sure

  23. #23
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    In the Solution Explorer, add references to:

    System
    System.Data
    System.Drawing
    System.Windows.Forms
    System.XML

  24. #24

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    er: help

    solution explorer?

  25. #25
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Does it have some place where you can add a reference?

  26. #26

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help!

    if i knew what excactly to look for it might...

  27. #27

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    oh wait... found it sorry being a moron

  28. #28
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: re: err help

    Originally posted by Bobba
    oh wait... found it sorry being a moron
    You're my long lost twin!

  29. #29

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28
    added the references i think looked a bit complicated went upto 103+ errors... gonna undo that bit

  30. #30

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    just thought if it works on your's couldn;t you coompile it then all i'd have to do is alter the xml files... that is where the data would be stored right?

  31. #31
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Bobba
    added the references i think looked a bit complicated went upto 103+ errors... gonna undo that bit


    Your IDE is on drugs.


    I don't see why it would produce the errors.

    Perhaps there's something that didn't get through from you to me.

    ZIP up the entire folder again, and upload it here. I'll take a look at it. Perhaps there's something we're missing?

  32. #32

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help?

    here you go
    Attached Files Attached Files

  33. #33
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Go to QuestStorage.vb and put these lines there:

    VB Code:
    1. Imports System
    2. Imports System.Drawing
    3. Imports System.Windows.Forms
    4. Imports System.xml
    5. Imports System.io
    6. Imports System.Data
    7. Imports System.Collections
    8. Imports Microsoft.VisualBasic

    Do the same in Mainform.vb

    Do the same in AddQuestForm.vb

    (If there are imports statements there already, replace them)

  34. #34

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    woot just one more error now!

    Performing main compilation...


    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(26) : error BC30002: Type 'WindowsApplication1.DefaultNamespace.MainForm' is not defined.

    Dim mainform As WindowsApplication1.DefaultNamespace.MainForm
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Build complete -- 1 errors, 0 warnings

  35. #35
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: re: err help

    In AddQuestForm.vb, add another imports line:

    VB Code:
    1. Imports WindowsApplication1.DefaultNamespace

    And change this line:

    VB Code:
    1. Dim mainform As WindowsApplication1.DefaultNamespace.MainForm

    to this:

    VB Code:
    1. Dim mainform As mainform

  36. #36

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help!

    two errors now

    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(10) : error BC30466: Namespace or type 'DefaultNamespace' for the Imports 'WindowsApplication1.DefaultNamespace' cannot be found.

    Imports WindowsApplication1.DefaultNamespace
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(27) : error BC30002: Type 'mainform' is not defined.

    Dim mainform As mainform
    ~~~~~~~~

    Build complete -- 2 errors, 0 warnings

  37. #37
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Whoopsie...

    Change

    VB Code:
    1. Dim mainform As mainform


    to

    VB Code:
    1. Dim mf As mainform


    HAHA! MF! Ok, ok....

    And your button click event should look like this:

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         If ComboBox1.SelectedIndex > -1 Then
    3.             Dim filename = ComboBox1.SelectedItem & ".xml"
    4.             Dim fStrm As FileStream
    5.             Try
    6.                 fStrm = New FileStream(filename, FileMode.Truncate, FileAccess.Write)
    7.             Catch ex As Exception
    8.                 Try
    9.                     fStrm = New FileStream(filename, FileMode.Create, FileAccess.Write)
    10.                 Catch ex2 As Exception
    11.                     MessageBox.Show("cannot save file")
    12.                     Exit Sub
    13.                 End Try
    14.             End Try
    15.  
    16.             Dim xtw As New XmlTextWriter(fStrm, System.Text.Encoding.UTF8)
    17.             xtw.Formatting = Formatting.Indented
    18.             xtw.Indentation = 2
    19.             xtw.QuoteChar = """"c
    20.             xtw.WriteStartDocument(True)
    21.             xtw.WriteStartElement("Quests")
    22.             For Each quest As QuestStorage In mf.getComboBoxForArea(ComboBox1.SelectedItem)
    23.                 xtw.WriteStartElement("Quest")
    24.                 xtw.WriteElementString("Name", quest.ToString())
    25.                 xtw.WriteStartElement("Commands")
    26.                 For Each line As String In quest.getCommands()
    27.                     xtw.WriteElementString("Command", line)
    28.                 Next
    29.                 xtw.WriteEndElement()
    30.                 xtw.WriteEndElement()
    31.             Next
    32.  
    33.             xtw.WriteStartElement("Quest")
    34.             xtw.WriteElementString("Name", TextBox2.Text)
    35.             xtw.WriteStartElement("Commands")
    36.             For Each line As String In TextBox1.Text.Split(vbCrLf)
    37.                 If (line.Chars(0) = vbLf) Then
    38.                     line = line.Substring(1)
    39.                 End If
    40.  
    41.                 xtw.WriteElementString("Command", line)
    42.             Next
    43.             xtw.WriteEndElement()
    44.             xtw.WriteEndElement()
    45.             xtw.WriteEndElement()
    46.             xtw.WriteEndDocument()
    47.             xtw.Close()
    48.  
    49.             mf.loadQuests()
    50.             MessageBox.Show("Quest: " & TextBox2.Text & " is saved!")
    51.         End If
    52.     End Sub

    Then try again.

  38. #38

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help!

    still two errors C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(10) : error BC30466: Namespace or type 'DefaultNamespace' for the Imports 'WindowsApplication1.DefaultNamespace' cannot be found.

    Imports WindowsApplication1.DefaultNamespace
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:\Documents and Settings\Scott\My Documents\SharpDevelop Projects\questerer\AddQuestform.vb(27) : error BC30002: Type 'mainform' is not defined.

    Dim mf As mainform
    ~~~~~~~~

    Build complete -- 2 errors, 0 warnings

  39. #39
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    *SIGH*

    There's something seriously screwed up with your IDE... SharpDeveloper.

    I feel that even after you solve this one, it'll give you more problems as you code further. It can't even place a button on a form correctly.

  40. #40

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    re: err help

    grr!! we're so close to buti think your right.....

    is there a sipler way of doing what i'm wnting it to do?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width