[Gambas-user] help with inherits using serial port
PICCORO McKAY Lenz
mckaygerhard at gmail.com
Wed Aug 1 19:21:35 CEST 2018
hi tobias,thanks and but I am confused, aparto of that i not clear if i
dismayed or impressive with your answer, I have not slept for several hours
now between finding what I do wrong and the daily work... and before
answering each line of your previous email, I need to add for you and for
everyone else something I could se and found:
I removed the $prindev.rp line and included it right after inside the
funtion of reading the port inside each class that inherits, and I got some
answers just in a few moments, this in addition what you say about using
datediff puts part of the problem in alcaratorias, but I'll explain why I
don't want to marry with native dates in the following lines ...
let's anwers for all only the important mail and dont worry i'm happy that
more than one answwer inclusive for even if it was to claim something:
2018-08-01 12:06 GMT-04:00 Tobias Boege <taboege at gmail.com>:
That's it, I guess, kind of. I can only speak for myself of course, but
> I got the impression from some threads in recent months that you don't
> really know what you are doing in Gambas on a fundamental and architectural
> level and then it takes more elaborate answers to be helpful. In addition
>
now i dissasembly each part of the ideas and program or future programs in
little modules to test
and as you noted with json, serial port print, and others... after work i
paste code in main project
so i try to emulate the JAVAEE methods to develop in a languaje that are
more identical to pascal or C
of course guys libraries it's the right answer to, but unfortunatelly
implies absolute paths
> to that, your questions take me, personally, more effort than others to
> get behind before I even think of answering, so I mostly ignore them
> altogether. Instead of posting a real-world question with your awkward
>
i feel so honour with that thanks! tobias,
so my questions are great pieces of codes and ideas
that challenge not only minds, also priograming skills ;-)
> questions. On the upside, your English wasn't a problem for me this time.
>
ironic, the first email was the lasted translated usin deepl translator
but also my fault not reading before sending..
and yes i always write in a hurry, i not have stable internet connection so
can fail for hours/days
the problem of you guys and current gnu/linux workd its assumed that all
people have 24/7 internet resource..
i noted that mayor countries that not use gnu/linux software are those
where not are enough resources..
now again ironic!? not just are logic!
> This sounds like a perfectly good plan. Inheritance does exactly that.
> If you want to confirm that it works, write simple classes first,
> with your desired methods, derive a few classes, override methods and
> most importantly have everything just print text, like in the attached
> example. That way, you don't have the complexity of a SerialPort to
> deal with just to see if inheritance fits your design.
>
i try to paste as example and explain as most posible inclusive put some at
the gambas wiki
so more other novice uses can avoid asking so much and coplex questions
come event..
so in that way, we can make more complex projects in conjuntion..
that's the other part of the idea
> The opening of the serial port may have failed. Your pringeneric.op()
> function has this:
>
> Try SComm.Open()
> Catch
> Print "error device" & Error.Text
>
> Since you use Try, the error will be shadowed and you don't get error
>
so now i noted that, but not know that, this are in some place of the wiki?
i think it's a important note
in that case i must use/raised the exception righ?
> reporting via Catch, i.e. you won't know if opening failed. That's exactly
> what Try does: ignore errors. My normal user has no permissions to access
> /dev/ttyS0 and that error is ignored by your code, leading to another
>
yes was one of the problem yesterday, today her enoted few hours ago in the
other machine
> error later. It may be different on your system, but be sure to check it
> and remove the Try.
>
as i said what about raised the error using the Error.Propagate ?
and also i must point again that that note
about *catch and eror shadow must be linked to Error.Propagate in the wiki*
> Well, try again once you're sure that the port opens at all. Then, the
>
today at the morning
> next issue that I can spot is that you declare the event name "SComm" but
> don't use it at all to intercept events. No wonder you don't get any.
>
*please that parti, i need more clear ideas of them, but the english
language are a barrier*
*a kind of more "example for dummies" can be in that point?*
> I also see the question
> > Print printodev.dataread ' why here the inhereits does not prin the
> printer buffer?
>
as i wrote in this mail at begining,
i put the reading procedures rules just after write inside each class and
got something
aparto fo the note about datediff from you this angree me, due seem i
cannot read later
but as you also said, i not use the event's really! so need help about that
,but need "exampel for dummy"
about the date i'll abort in new mail, so continues about the variable
type, this are notable:
> PS: You didn't ask for this, but it caught my attention:
>
> > Private printodev As Variant
>
> in printermanager. The Variant is too generic. A Variant can hold anything,
> so it works, but it won't tell anyone reading the code that printodev is
> actually an instance of printobixolo or printoepson. Luckily, you use
> inheritance. You can declare printodev to be of the common type that
> printobixolo and printoepson inherit from:
>
> > Private printodev As pringeneric
>
doe sdo not work, seems if you see the new constructor, got a runtime error
about type of class
so that's why the variant
and i noted so you run the code in your mind, wow!
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180801/bc7b953f/attachment-0001.html>
More information about the User
mailing list