[Gambas-user] GB3 Editor: how to elaborate Editor.Lines (and CSTR behaviour)
Orionis
linux at ...3345...
Sat Jun 28 22:32:07 CEST 2014
Hi, I'm starting to investigate this control. This is my first question, but
more will follow
I have an Editor called 'edit' loaded with some text; I want to recover each
single line to parse them.
This is an example of code:
[code]
Dim lineObj As Variant
Dim sRow As String
For cnt = 0 To edit.lines.Count - 1
lineObj = edit.Lines[cnt]
sRow = CStr(lineObj)
Next
[/code]
I get an "Type mismatch errror: wanted String, got .Editor.Line instead" at
line 'sRow =...'
First question: why the CStr, which should accept a Variant, complies on
this value?
Later;
In the documentation I found this example:
[code]
Dim hEditor As Editor
Dim hEditorLine As .Editor.Line
hEditorLine = hEditor.Lines [ Line As Integer ]
[/code]
This is completely wrong from my test:
*Dim hEditorLine As .Editor.Line* gives an "Unexpected . "
Removing the initial dot (so, *As Editor.Line*) does not recognize the type
At the end: how can I get a single line as string from the Editor?
Thanks
--
View this message in context: http://gambas.8142.n7.nabble.com/GB3-Editor-how-to-elaborate-Editor-Lines-and-CSTR-behaviour-tp47192.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list