Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
musings on graphics support
#61
dunno how it is in fb (qb doesn't allow that), but C allows calling functions without returning value somewhere
so who wants can use

if screen(...) then
and who doesn't want can just use

Screen ...

how about that?
url]http://fbide.sourceforge.net/[/url]
Reply
#62
yeah, though i have to admit that this is no good coding style (ohh shut up blitz Smile ), on that window thingy, i don't think that v3c will implement it that way, cause he'd have to catch ALL return values an record them, plus how to decipher wheter it was an error or not? he can't keep a list for all libraries out there with their error codes of all their functions that return something...
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#63
The Windows API calls will return success/failures for setting video modes, so all you'd have to do is raise an error if you get a failure code.
I'd knock on wood, but my desk is particle board.
Reply
#64
Quote:Err is one of the most useful things in BASIC. Big Grin If it's not implemented, you're gonna have tremendous problems in Windows-based coding...

I assume this means ERROR exp% instead of Raise exp% then too.

And we won't have things like a way to get a default Windows Message handler loop to support event-based programming off a window either, or a raft of other stuff a VBer would expect. That's fine, we're looking at a development model akin to Windows programming in bare-assed C, I get it. And that's right where a lot of people want to be.

I just have to remember to keep my head wrapped around this. I keep anticipating something more like Delphi 2 than C (and I do NOT mean syntax at all) for some odd reason.

Good Gourd, I haven't written this sort of code since C programming under Intuition on the Amiga back in the 80s.

Ignore me I guess, just a personal problem. :wink:
Reply
#65
Quote:The Windows API calls will return success/failures for setting video modes, so all you'd have to do is raise an error if you get a failure code.

you mean within the runtimelibrary code? say one writes that gfx stuff as part of the rtl, well that would be possible. but generic on error is not possible. llike if you write a programm using some library directly there's no way for the compiler to figure out wheter a return value of a library call is an error condition or a success. get my point? guess i missunderstood someone
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#66
ERR


ERR


ERR
Reply
#67
hee hee
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#68
Yeah, the QB (et al.) ERR only knows about internal QB errors and values you set explicitly in your code.

In VB, Err is an intrinsic global-scope object and as we don't have objects here... I think it only has meaning in terms of VB inline code, VB class instances, and ActiveX objects. Since we are using low-level libraries there'd be no way for them to Raise exceptions or for FB to catch them.

You're back to error returns as usual when calling standard DLLs.


Heavy! {Insert Back to the Future theme here.}
Reply
#69
In QB, you can raise your own errors, or even standard errors. I don't see why that would be too difficult to do here...if Windows reports that the mode cannot be set, the library would be coded to just simply raise the error code that goes long with it. And yes, the error routine itself would be inside the rtl as a "generic" error function. Big Grin In QB, I believe you do this by using the ERROR statement, like ERROR 5, but it's been so long since I used it that I don't remember... Sad
I'd knock on wood, but my desk is particle board.
Reply
#70
well i guess we where talking abou two different things. if i do a wrapper for say a c++ lib in c to be used with fb (wow, think about that...confusing) i sure can use fb_error to report an error to the fbruntime so it can react on it on an error. but if i only port headers (like the ones of the win32 api, ogl, sdl you name it) there's simply no way to accomplish that.

well i guess it's clear now, excuse my bad english
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)