Search found 8 matches

by Jeff88
Wed Apr 10, 2019 11:32 pm
Forum: General Discussion
Topic: My program is not running from an .exe
Replies: 3
Views: 1736

Re: My program is not running from an .exe

Does your program depend up which directory it is running?

Put this line in the beginning of the program to show its directory.

Debug GetPathPart(ProgramFilename())
by Jeff88
Mon Apr 01, 2019 7:01 pm
Forum: Coding Questions
Topic: Strange behavior
Replies: 0
Views: 1046

Strange behavior

I wrote this simple program to see how fast certain arithmetic instructions are. I observed two different timings depending on how many spaces are between the quote marks on the line after Openconsole!!!

Note this with the debugger off.

How can this be?

On my pc 64 bit windows I get either 2.4 or ...
by Jeff88
Mon Feb 04, 2019 10:30 pm
Forum: Applications - Feedback and Discussion
Topic: Caculate pi
Replies: 4
Views: 2526

Caculate pi

Application to calculate pi to arbitrary number of digits. No practical use but does demonstrate value of using threads. See program comments for further info.


;Many years ago when I used Quickbasic, I came across a program to calc pi. Of course this has no practical
;purpose, but just to fight ...
by Jeff88
Sat Feb 02, 2019 12:26 am
Forum: Assembly and C Programming in PureBasic
Topic: Why does CQO instruction not recognized by PB
Replies: 1
Views: 8860

Why does CQO instruction not recognized by PB

I wanted to see the timing difference between IDIV and DIV. So I wrote a simple program, looked at the assembly code and cut and pasted the portion for c=a/b into the timing loop. I changed IDIV to DIV. The compiler gave a syntax error for CQO line. I put a ! in front of the CQO to send directly to ...
by Jeff88
Thu Jan 24, 2019 8:39 pm
Forum: Coding Questions
Topic: Using pbcompiler without running program
Replies: 2
Views: 1091

Using pbcompiler without running program

Occasionally I like to view the assembler generated by PB, I use the program below and modify the first line for the program I want to view. I found this code somewhere else in the forum. Is there someway to modify the call to the pbcompiler so that the program is not executed--just create the asm ...
by Jeff88
Mon Jan 14, 2019 5:34 pm
Forum: Coding Questions
Topic: How do you Detect 32-bit or 64-bit Compiler Versions?
Replies: 19
Views: 4360

Re: How do you Detect 32-bit or 64-bit Compiler Versions?

How about testing length of default integers. Code below shows the difference.

[/Dim a(2) ;64-bit systems each element is 8 bytes
Dim b.l(2) ;32-bit systems each element is 4 bytes like this
a(1)=-1
b(1)=-1
Debug PeekB(@a(1)+4) ;5th byte of 8 bit word
Debug PeekB(@b(1)+4) ;1st byte of next 4 bit ...
by Jeff88
Thu Jan 10, 2019 12:40 am
Forum: Coding Questions
Topic: No events occur during scrolling
Replies: 1
Views: 961

No events occur during scrolling

I wrote a pragram and that uses a scroll bar gadget and I wanted to signal when the value it returns changes while scrolling. So I "binded" the scoll bar and had it post an event when its value changed. Fail . Investigating I discovered that while scolling with mouse button depressed no events would ...
by Jeff88
Sat Jan 05, 2019 9:48 pm
Forum: Coding Questions
Topic: Right justification of numbers
Replies: 1
Views: 765

Right justification of numbers

I am new to PB so perhaps there is a better way to do this. Also this is such a minor bit of code compared to so much else I have observed in this forum.

I wanted to display the numbers in a matrix in straight right-justified columns using proportional fonts. The standard Windows fixed fonts were ...