[Gambas-user] GB3 Editor: how to elaborate Editor.Lines (and CSTR behaviour)
Fabien Bodard
gambas.fr at ...626...
Sat Jun 28 23:32:18 CEST 2014
Dim hEditor As Editor
Dim hEditorLine As Object
hEditorLine = hEditor.Lines [ Line As Integer ]
2014-06-28 22:32 GMT+02:00 Orionis <linux at ...3345...>:
> 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.
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
More information about the User
mailing list