Search found 2070 matches

by coderJeff
Dec 29, 2005 9:02
Forum: General
Topic: minipulating 2 color bitmaps
Replies: 24
Views: 3840

The BLOAD command only works if you set a screen mode. If you load a 2-color bitmap from file, it is stored in memory in a format compatible with the current screen mode. In some screen modes this means that each bit is stored in 1 byte. In other screen modes this means that each bit is stored in 4 ...
by coderJeff
Dec 29, 2005 7:57
Forum: General
Topic: minipulating 2 color bitmaps
Replies: 24
Views: 3840

Personally, I would use ImageCreate and pointers. Here's the same code as above except doing just that Option Explicit Dim x As integer, y as integer Dim As UByte Ptr img1, img2 '' Set the screen mode Screen 13 '' Create two image arrays of the proper size img1 = ImageCreate(64,64) img2 = Im...
by coderJeff
Dec 29, 2005 7:48
Forum: General
Topic: minipulating 2 color bitmaps
Replies: 24
Views: 3840

The size of the array needed depends on your current screen mode, not the bmp you are loading: Taken from http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgGetGraphics Bytes needed in the array: For color depths 1, 2, 4 and 8: size = 4 + (w * h) For color depths 15 and 16: size = 4 + (w * h * 2) Fo...
by coderJeff
Dec 29, 2005 6:05
Forum: Beginners
Topic: CONSTRUCTOR and DESTRUCTOR
Replies: 2
Views: 767

by coderJeff
Dec 28, 2005 18:02
Forum: Beginners
Topic: Can freebasic access usb port ??? If so.....
Replies: 4
Views: 1562

you could also use IN/OUT.. but your going to need to do some research on USB for the I/O ports your going to need to communcate to. Sorry, this is really not a practical solution. You *might* be able to use IN/OUT if you were writing a driver for a host controller. But then probably only in an OS ...
by coderJeff
Dec 28, 2005 8:38
Forum: General
Topic: is there any string replacement function in FB
Replies: 34
Views: 5908

DrV: Yes, very nice. Except for the variable names, I have that function practically line for line in my code library for VB5. Works perfectly in all cases under FB. However, I can't say the same for VB/QB. In VB/QB Instr(s,a,b) returns s if b="", not zero (0) as you would expect. In otherwords Inst...
by coderJeff
Dec 28, 2005 6:25
Forum: General
Topic: is this accurate?
Replies: 8
Views: 1465

Here's a sample that first calculates the overhead of the timing code and then actually times an operation. At the end it prints out some results. On my PIII-450, the total test takes about 21 seconds. Option Explicit Dim As Integer i, temp Dim As Double t, tOverhead, tRunTime, tDiff Const cIteratio...
by coderJeff
Dec 28, 2005 4:39
Forum: Windows
Topic: TAPI with freebasic
Replies: 17
Views: 4714

Yes, exactly right, it's a matter of knowing the 'AT' commands. However, DTMF detection depends on the capabilities of the modem. I've never had a modem that could detect tones in DATA or FAX mode. Maybe newer modems can. I was using a VOICE/DATA/FAX modem that did report DTMF, but in voice mode onl...
by coderJeff
Dec 27, 2005 21:11
Forum: General
Topic: is there any string replacement function in FB
Replies: 34
Views: 5908

Function causes an infinate loop if the replacement string contains the substring you are looking for. Example: Print ReplaceSubStr("Test","e","New") I would expect this to print "TNewst". Instead, the function keeps finding and replacing the "e". Also, you are ...
by coderJeff
Dec 27, 2005 20:55
Forum: Beginners
Topic: Can freebasic access usb port ??? If so.....
Replies: 4
Views: 1562

If you are communicating over a serial port (i.e. COM1, COM2, etc) and are using windows, you can use the OPEN COM statement. This method works for built-in serial ports and serial ports connected using a USB adapter. (I have tested both). If you are communicating with some other device such as a ca...
by coderJeff
Dec 27, 2005 16:19
Forum: General
Topic: Strange Error with passing function pointer to a sub/func
Replies: 6
Views: 1111

Same for me. parser-quirk-gfx.bas around line 763 will only take an offset to a proc. All other pointers and function pointers are rejected due to the strong type-checking. Added a feature-request on sf. Would it be reasonable to simply document the limitation in the wiki for now?
by coderJeff
Dec 27, 2005 7:48
Forum: General
Topic: Strange dll Error
Replies: 24
Views: 2803

I'm pretty sure it's impossible to see *all* the sides of a 4D cube at the same time. Some heavy drinking might help a little, but insights are usually forgotten by morning ... The little cube inside a larger cube is conceptual. You could construct a 3d model that looks just like the picture, but it...
by coderJeff
Dec 27, 2005 2:23
Forum: Beginners
Topic: Integer Division Problem ?
Replies: 15
Views: 2837

No problem, also just to be complete here

Code: Select all

Print 155.75 \ 12
Print 1200 \ 155.75

produces the same results on QB and FB. 13 and 7

EDIT: Wiki is now updated
http://www.freebasic.net/wiki/wikka.php ... erDivision
by coderJeff
Dec 27, 2005 2:19
Forum: Beginners
Topic: Integer Division Problem ?
Replies: 15
Views: 2837

Hmmm, the FB manual does say that. ...... The manual is wrong, the compiler is correct. Will change the wiki ASAP. The following code produces the same results under FB and QB: DEFINT A-Z Dim x As Single x = 155.75 Total16ths = CINT(x * 16) Part16ths = Total16ths MOD 16 TotalInches = (To...

Go to advanced search