[SOLVED] XmlDocument - unknown identifier error

Post

Posted
Rating:
#1 (In Topic #1325)
Trainee
Hello,

Sorry for the newbie question.

Started a project that reads xml files into a TreeView:

Code

Use "gb.xml"

Public Sub Form_Open()
  LoadProjectView(TreeView1, "path-to-xml-file")
End

Private Sub LoadProjectView(ProjectView As TreeView, ProjectFile As String)
  ProjectDoc = New XmlDocument    ' <-- Error here: Unknown identifier: XmlDocument

  ProjectDoc.Open(ProjectFile)

End

What am I missing?

TIA
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 You must add gb.xml to the project components using the project properties page in the IDE  (Ctrl-I)

The "Use" keyword is intended only for making gbs3 script files and cannot be used in a normal project to load a component.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
No such thing as

Code (gambas)

  1.  "Use <component>"
in normal code, it's only for scripting.

Research how the project configuration works or "Component.Load"

Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
Steers, you beat me by milliseconds!  :shock:

Online now: No Back to the top

Post

Posted
Rating:
#5
Trainee

BruceSteers said

You must add gb.xml to the project components using the project properties page in the IDE  (Ctrl-I)

The "Use" keyword is intended only for making gbs3 script files and cannot be used in a normal project to load a component.

Thanks for answering. Next dumb question: Which component should I use for XmlDocument? There's no "gb.xml" on the list.
Online now: No Back to the top

Post

Posted
Rating:
#6
Trainee

ForeverNoob said

BruceSteers said

You must add gb.xml to the project components using the project properties page in the IDE  (Ctrl-I)

The "Use" keyword is intended only for making gbs3 script files and cannot be used in a normal project to load a component.

Thanks for answering. Next dumb question: Which component should I use for XmlDocument? There's no "gb.xml" on the list.

Found it. Had to install gambas-gb-xml from repos. Thanks for help.
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
You're welcome.

And after a recent discussion on the M/L it turns our the "Use" keyword actually CAN be used in a normal project and acts just like Component.Load()

It's apparently been that way for 10 years but nobody updated the wiki lol :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.