Search found 2898 matches

by Richard
Jul 21, 2007 4:44
Forum: Beginners
Topic: How load a JPEG-Picture?
Replies: 25
Views: 5701

Some CRT screens kill their brightness for one second when they detect a change to video mode. They resynchronise during that time. Try starting and staying in the screen/video mode you need for the image.
by Richard
Jul 16, 2007 12:36
Forum: General
Topic: Ball collisions
Replies: 36
Views: 5168

You have two laws of physics, conservation of energy and conservation of momentum. The total energy after collision is equal to the total energy before collision. The total momentum after collision is equal to the total momentum before collision. Momentum = mass * velocity Kinetic energy = 0.5 * mas...
by Richard
Jul 15, 2007 6:08
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

No party in this debate is right, all parties have quite legitimate claims to their preference and diverse programming styles. Remember this discussion is only about a default, it is not compulsory. ByRef is the equivalent of implicitly passing a pointer. QB avoided explicit pointers and therefore p...
by Richard
Jul 08, 2007 5:41
Forum: Beginners
Topic: strange bug
Replies: 5
Views: 1279

If you change your “Endif” keywords to “End If” you can use the FBIde view/format/indent feature to check your structure. At the end you define variables of type bcdfloat. By insulating them with q1 and q2 it fixes the problem with x. It looks like when str2bcd writes to y it wrongly overwrites the ...
by Richard
Jul 08, 2007 0:09
Forum: Beginners
Topic: strange bug
Replies: 5
Views: 1279

Minimise the problem. The bug appears not to be dependent on s, so use s=”1” Regarding: #define NUM_BYTES 12 'Number of bytes per mantissa The bug disappears when NUM_BYTES is 7 or less, independent of s=”???”. So ask what is dependent on NUM_BYTES size = 8 or more. Your turn again.
by Richard
Jul 04, 2007 13:27
Forum: General
Topic: Some rotation questions
Replies: 3
Views: 1299

Rotations are best done by vector rotation with a complex multiply, computation of coordinates are best done in double (not integer). Have fun. ' Rotate a triangle about a centre Screenres 800, 600, 32 Dim As Integer i Dim As Double x(1 To 3), y(1 To 3) ' original corner points Dim A...
by Richard
Jun 23, 2007 4:51
Forum: General
Topic: Line Input, Eof() – linefeed weird bug?
Replies: 8
Views: 2872

Here is a sub to replace Line Input # ' emulate " Line Input #h, s " with " LineInput (h, s) " ' must first open file with Open "filename.ext" For Binary As #h Sub LineInput( Byval handle As Integer, Byref s As String) Const As Integer LF = 10, CR = 13 D...
by Richard
Jun 22, 2007 21:21
Forum: General
Topic: Line Input, Eof() – linefeed weird bug?
Replies: 8
Views: 2872

This code should convert LFs to CRLFs. Dim As String f1 = "Inputfile.ext" ' the file to convert Dim As String f2 = "temp.txt" ' a temporary scratch file Dim As String*1 char, last Dim As Integer LF = 10, CR = 13 Open f1 For Binary As #1 Open f2 For Binary As #2 Do Until Eof(1...
by Richard
Jun 22, 2007 19:49
Forum: General
Topic: Line Input, Eof() – linefeed weird bug?
Replies: 8
Views: 2872

Your results are the same as mine, missing between about 790 and 810 bytes from the end of files having lengths between 0 and 800 bytes beyond all 8192 byte block boundaries. Hopefully most files are CRLF line terminated so this will not effect them. My work-around would read the LF terminated file ...
by Richard
Jun 22, 2007 13:14
Forum: General
Topic: Line Input, Eof() – linefeed weird bug?
Replies: 8
Views: 2872

Line Input, Eof() – linefeed weird bug?

I was getting syntax errors from the output of my automatic translation system. I tracked it down to missing the tail of the input file. It was falsely detecting “end of file” and did not read in the last few lines. This effect showed on two files out of about one hundred. Those two files had length...
by Richard
Jun 15, 2007 1:28
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

The terminology is being misused. In both mathematics and in programming, constants are things that do not change their value within a program. Parameters retain a particular value for this instance or run. Variables are expected to change. Arguments are the things functions and subroutines work wit...
by Richard
Jun 14, 2007 23:17
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

What I really wanted to know was why such a fundamental change had been made. There is no point holding another pole as v1ctor is clearly firm in the decision not to restore an across the board ByRef default. This discussion has polarised to the point where both sides have dug into defensive positio...
by Richard
Jun 12, 2007 22:49
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

As the weight of evidence presented in this thread leans towards a consistent ByRef default, v1ctors objection must be based on something missing from the discussion. Now it is not too late to argue the case for no change. Does anyone have any ideas as to what the reason is? My guess is that it has ...
by Richard
Jun 10, 2007 8:35
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

Following on from jevans4949 post of June 8th. C was never designed. C grew out of Macro Assembler on the Digital Equipment PDP-11 series machines in the early 1970s. C was a low level language used to automate the telephone network. It has pointers and passes ByVal because that is how assembler pro...
by Richard
Jun 07, 2007 23:58
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 128
Views: 28736

Any suggestion that we should eliminate the default and insist on explicit ByRef or ByVal so as to force beginners to learn, seems like a real turnoff for those beginners. Why make it any more difficult than necessary? Speed optimisation of the inner loop is not an activity indulged in by beginners....

Go to advanced search