Search found 1015 matches

by jevans4949
Jul 28, 2016 15:05
Forum: Documentation
Topic: STRPTR returning zero
Replies: 37
Views: 3740

Re: STRPTR returning zero

This is a general rule when a dynamic structure is resized (the data address may change). Examples: - var-len string 's' => 'Strptr(s)' may change after string modification, - dynamic array 'a()' => '@a(n)' may change after array redim'ing, - allocate memory => address may change after memory reall...
by jevans4949
Jul 28, 2016 11:09
Forum: Documentation
Topic: STRPTR returning zero
Replies: 37
Views: 3740

Re: STRPTR returning zero

Thanks, fxm. I suppose it could be amplified to a paragraph: "In the case of a variable-length string which is currently empty of data, STRPTR returns a value of zero. If new data is assigned to the variable-length string in question, any previously-returned result of STRPTR should be considere...
by jevans4949
Jul 27, 2016 20:42
Forum: Documentation
Topic: STRPTR returning zero
Replies: 37
Views: 3740

STRPTR returning zero

Never bothered me before, but today I was using the STRPTR function to scan data read into strings from a CSV file where some of the columns were null. The STRPTR function on the string(s) in question returned zero, causing my hastily-written program to crash. It's not unreasonable that STRPTR shoul...
by jevans4949
Jul 22, 2016 22:05
Forum: General
Topic: Question about a question mark??
Replies: 7
Views: 642

Re: Question about a question mark??

It was a very useful abbreviation when debugging your early attempts a programming in Basic.

Back when I started in the late 1960's, we used hard-copy teletypes, and Print really did mean print!
by jevans4949
Jun 13, 2016 11:48
Forum: Beginners
Topic: prepend not append
Replies: 14
Views: 847

Re: prepend not append

Write the file as a .CSV (See WRITE statement), with timestamp as first column and your print message as a single text string in the second column. Open up in a spreadsheet program, and sort in descending time order. Time includes date, of course.
by jevans4949
Apr 21, 2016 1:16
Forum: General
Topic: What are the pitfalls of using ASM for speed improvements?
Replies: 23
Views: 1199

Re: What are the pitfalls of using ASM for speed improvements?

To save re-calculating the array index, you could set a pointer to the relevant array element at the start of each iteration of your loop If you just want to step through 2 million pixels and row and column are irrelevant, you could just increment the pointer by 1 at each iteration, stopping when th...
by jevans4949
Apr 06, 2016 19:37
Forum: General
Topic: How can I close this file (and only this one)?
Replies: 18
Views: 966

Re: How can I close this file (and only this one)?

@Tourist Trap: Is there a reason you can't use a global variable to store the file number you used?

If it's the case that your program is going to be opening files in an unpredictable way, there are a number of ways of dealing with this. Perhaps you could clarify?
by jevans4949
Apr 06, 2016 16:35
Forum: General
Topic: How can I close this file (and only this one)?
Replies: 18
Views: 966

Re: How can I close this file?

Code: Select all

Dim xfileno As Integer
xfileno = FreeFile
Open "xfile.txt" For Output As #xfileno
Print #xfileno, "Hello, World"
Close #xfileno
by jevans4949
Feb 25, 2016 11:24
Forum: Community Discussion
Topic: Do you mind if ignoring ";"?
Replies: 13
Views: 1326

Re: Do you mind if ignoring ";"?

Colon (:) is used as a multi-statement seperator in Basic. Just did a litlle experiment, and Freebasic doesn't require that there be a statement after the colon. You could try replacing all semicolons with a colons in the patched-in code.
by jevans4949
Jan 14, 2016 3:33
Forum: General
Topic: A Shakespearian issue...
Replies: 6
Views: 537

Re: A Shakespearian issue...

The qwerty keyboard layout was designed to prevent the mechanical keys of the original typewriters from jamming when used by fast typists. The layout is therefore not optimal for systems with no moving parts. The article "QWERTY" on EnglishWikipedia does give some history of this. Anybody ...
by jevans4949
Dec 23, 2015 16:56
Forum: Community Discussion
Topic: esoteric language LOLCODE
Replies: 5
Views: 871

Re: esoteric language LOLCODE

Well, I guess the authors of both of these were just doing it for fun "because they could". Hmmm ... so instead of "if a=b then ..." you coud put " if a<>b then dont ..."? An operator "roughly" could be useful for floating-point numbers. "if a roughly b t...
by jevans4949
Dec 21, 2015 1:44
Forum: Community Discussion
Topic: esoteric language LOLCODE
Replies: 5
Views: 871

Re: esoteric language LOLCODE

Mentioned it to my daughter's boyfriend and he said it reminded him of Dogescript: https://dogescript.com/
by jevans4949
Dec 18, 2015 22:30
Forum: Community Discussion
Topic: esoteric language LOLCODE
Replies: 5
Views: 871

Re: esoteric language LOLCODE

I remember reading an article years ago about how somebody hacked the BASIC interpreter on the Tandy TRS-80 (shows my age!) to replace all the keywords with a French equivalent. The code was interpeted, but keywords were stored internally as integers, so it worked perfectly. To make it more friendly...
by jevans4949
Nov 15, 2015 16:03
Forum: Community Discussion
Topic: [offtopic] Any organ player here ?
Replies: 2
Views: 1163

Re: [offtopic] Any organ player here ?

Just checked UK Ebay; several Kawai organs looking about the same age on sale for less than 100 GBP (although not the model in your picture). Problem is that it's old technology, and many people won't have space in their homes. Yours may have been dumped by somebody clearing an elderly relative's ap...
by jevans4949
Sep 26, 2015 13:30
Forum: Community Discussion
Topic: second rnd sequence
Replies: 8
Views: 1253

Re: second rnd sequence

@St_W: Your suggestion is good, and could also be thread-safe. One would probably want to set up a class for the state variable(s?), with the data specified as private, to discourage VW programmers from poking it.

Go to advanced search