PDA

View Full Version : A most peculiar CTD



LCSims
10-01-2016, 21:13
Hi everyone!

Choosing thread titles can be a lot like choosing variable names, you never know how well they will work. I ran into a situation last night where my chosen variable name caused thinBasic to CTD, with a reference to "Fault Module Name: OLEAUT32.DLL". After about an hour of trying to figure out why a simple read a text file, reformat and write to disk kept bombing, it all came down to the variable name in the line of code. I have no idea why Windows 7/64 does not like the name "latBLC" (without the quotes), but it doesn't. Line above uses the variable name "lonBLC' and it processes?!?

So I changed the variable to be a different name and the code works just fine. Ah the wonders of Mr. Bill's operating system, frustrating users for 25 years+.

File can be grabbed at www.lcsims.com/misc/erosCrash.zip (Eros, if you'll let me know when you've had a chance to download?)

I've got the workaround, different name, was just curious why something so benign would bomb Windows?

Lance

ErosOlmi
10-01-2016, 22:06
Maybe the "AT" instead of "AS" at line 31?


Dim latBLC At Ext


"At" in that position is valid in thinBasic (it defines a variable at a specific memory position ... absolute variables) but maybe I can improve syntax detection.

LCSims
10-01-2016, 23:31
Greets Eros,

Well color me red-faced! :oops: But it's always nice to find out when it's user error, rather than a problem with the program.

Best regards,

Lance

ErosOlmi
11-01-2016, 00:12
:)

There are also other ways to declare variables.
For example indicating the type before the variable name can reduce declaration code.
Example, the following code ...


Uses "console"

Ext nameLen = 1
Ext TooManyFiles = 2
Ext ReadFile = 3

String LongName = "Whatever"
String ShortName = "My String"


PrintL LongName
WaitKey


is equivalent to


Uses "console"

Dim nameLen As Ext = 1
Dim TooManyFiles As Ext = 2
Dim ReadFile As Ext = 3

Dim LongName As String = "Whatever"
Dim ShortName As String = "My String"


PrintL LongName
WaitKey


Also multiple variable declaration is possible in one go:

Ext nameLen, TooManyFiles, ReadFile
String LongName, ShortName


Ciao
Eros

LCSims
11-01-2016, 04:45
Greets Eros,

Many, many years ago I took a typing class in high school, but transferred out because there weren't enough cute girls to make it worthwhile. So now that my embarrassment has subsided, I can turn to excuses as the cause of my boo-boo. One, while I can type fairly well, there will be errors. Two, I had originally started the program in Visual Basic and while it's a wonderful tool shed, full of neat things to help the programmer along, it's easier to get the work done in thinBasic than it is to keep Googling "how do I do this in VB?". So part of the work stays in VB, because my list of numbers, like was in the zip file, comes out of a binary file and VB has a method to decipher that. Especially when you've never worked with a binary file of signed 16bit integers before!

But I like the easy and familiar method of thinBasic. I just wish I knew 1/10th of what you and Petr and Rene and others chat about... :D

Now if I can get my implementation of the mlGrid finished, because when I tried to get the same thing going in VB it was-not-pretty!

All the best from the Left Coast!

Lance