Search found 80 matches

by ProphetOfDoom
Sun Feb 14, 2021 9:00 pm
Forum: General Discussion
Topic: The unknown dangerous Procedure StringFunction Bug
Replies: 45
Views: 11840

Re: The unknown dangerous Procedure StringFunction Bug

Nevertheless, it's usually not good coding practice to pass functions as parameters to other functions.
Oh my! I don’t know where to begin. In Haskell, entire programs are glued together by higher-order functions. Gtk uses callbacks for every signal. This just such a vastly useful thing in a ...
by ProphetOfDoom
Sun Feb 14, 2021 4:07 pm
Forum: Coding Questions
Topic: Scroll starts to bump/flicker
Replies: 20
Views: 5141

Re: Scroll starts to bump/flicker

I had a book once about Windows programming, I think the author’s name was Charles Petzold. He presented a “bouncing ball” demo which flickered like heck on my laptop. Maybe it’s a hardware or software issue completely separate from your program? I also have a Thinkpad with Ubuntu on it that ...
by ProphetOfDoom
Sat Feb 13, 2021 8:09 pm
Forum: Coding Questions
Topic: Scroll starts to bump/flicker
Replies: 20
Views: 5141

Re: Scroll starts to bump/flicker

That comment I wrote in the code "0.1 pixels per second" is wrong, I meant 0.1 complete cycles per second. So if you put 1 the text would return to its starting position in one second.
by ProphetOfDoom
Sat Feb 13, 2021 7:08 pm
Forum: Coding Questions
Topic: Scroll starts to bump/flicker
Replies: 20
Views: 5141

Re: Scroll starts to bump/flicker

Hi StarWarsFan,
Unfortunately your marquee doesn't flicker much here so it's hard to debug!
Does this improve things at all? I've changed it so there's no timeout for the window event, no busy wait for (ElapsedMilliseconds()-Timer) to reach a certain threshold, and x is now calculated newly each ...
by ProphetOfDoom
Thu Feb 04, 2021 10:30 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Okay oops... "times" appears to be a C library function.
by ProphetOfDoom
Thu Feb 04, 2021 10:28 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Hullo there,
Just wanted to update this topic because I think I've found the exact cause of my error and it's very strange.
I had a function in my C code called "times". PureBasic, at least when debugging with the IDE on Linux, appears to include a symbol called "times" in the generated executable ...
by ProphetOfDoom
Sun Jan 31, 2021 2:28 pm
Forum: Coding Questions
Topic: International keyboards
Replies: 20
Views: 3259

Re: International keyboards

Hi there everyone,
Thanks for your input. I haven’t been able to test Texas Instruments’ code yet because it’s a really hectic time for me (I’m currently moving house). But yes, generally I thought this would be an issue and none of PB’s APIs seemed to address this particular use case. It’s not as ...
by ProphetOfDoom
Fri Jan 29, 2021 4:58 pm
Forum: Coding Questions
Topic: International keyboards
Replies: 20
Views: 3259

Re: International keyboards

Sorry not understanding this IdeasVacuum.
Marc56us says his caret on his French keyboard is ALT-GR+9; on my English keyboard it’s SHIFT+6. So which PureBasic API function can report the caret character, rather than the keys the user pressed, which could mean either?
by ProphetOfDoom
Fri Jan 29, 2021 3:26 pm
Forum: Coding Questions
Topic: International keyboards
Replies: 20
Views: 3259

Re: International keyboards

Wow thanks for the quick replies.
This is what I feared.
Let me explain my use case...
I'm making a scientific calculator. I thought it would be cool to draw it on a WindowedScreen, with artwork to make it look like a real hardware calculator. But there doesn't seem to be a way to get ascii values ...
by ProphetOfDoom
Fri Jan 29, 2021 11:48 am
Forum: Coding Questions
Topic: International keyboards
Replies: 20
Views: 3259

International keyboards

Hi there,
Is it okay to assume that the caret symbol (^) is obtained by typing SHIFT+6 on any keyboard? And the plus character with SHIFT+=? In general, what assumptions can I make about obtaining ascii symbols that won’t break my code on a foreign keyboard?
Thank you.
by ProphetOfDoom
Fri Jan 29, 2021 10:34 am
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Hi again and thanks skywalk and bitblazer for your suggestions.
Something weird has happened. I was up all night tweaking things here and there and now it works. I have a book called The Pragmatic Programmer where it warns against "programming by accident" - i.e. copying and pasting and commenting ...
by ProphetOfDoom
Wed Jan 27, 2021 7:32 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Well thanks for all your suggestions. I’m going to struggle on with it for a few days - if I have no luck I will upload it to my github page and link to it so you helpful people can have a look. I didn’t really want to do this because it means removing all the curse words. And also this code is ...
by ProphetOfDoom
Wed Jan 27, 2021 5:51 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Hi there sq4, well I’m compiling it with gcc on Linux, and clang on macOS, using just the -g flag and whatever the default optimisations might be... I’m guessing none so probably no MMX?
by ProphetOfDoom
Wed Jan 27, 2021 5:23 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Hullo Olli.
I’m not using any structures on the PB side at all. The only structures are in the C code so they can’t be disagreeing about alignments. I should add, all of the code in both languages is single-threaded, so that’s not the issue here. I know I’m not giving you guys a lot to go on but I ...
by ProphetOfDoom
Wed Jan 27, 2021 5:05 pm
Forum: Coding Questions
Topic: Debugging nightmare - advice?
Replies: 16
Views: 3226

Re: Debugging nightmare - advice?

Hullo Nic thanks for your input. I have indeed zeroed all my structures with memset (and probably checked this three times!). And yes I’m using PrototypeC.
I’m hoping there’s some magic app or feature of PB that can help... I’m really stuck!