Connection Name

RacingDog

Active Member
Licensed User
Now we have data types, can someone tell me the type of the Connection Name parameter in FileOpen etc? I need to pass it to a Sub with other typed parameters, and to make the code read well it needs to be the first parameter. I've blindly tried a few things, no type specified, number, integer, int64, even string, but keep being told I haven't set the parameter to a valid instance of an object. To try to get a clue, I've tried examining the value in a working piece of file code but the debugger refuses to indicate the value.

Yes, yes the file exists, the second file open parameter is correct etc etc. I don't need that sort of help, at least not yet, maybe later.

I just want to know what the data type is please? Should this be in the FileOpen help text?
 

RacingDog

Active Member
Licensed User
It gets worse.

Sub A had a file variable hrFile and Sub B had a parameter hFile and is called from A. That didn't work so I created globals hFile and hrFile removed the hrFile Dim from A and the hFile parameter from B.

If I make A say hFile = hrFile and call B, then B still fails.

If I don't do that but change B to refer to hrFile, then B works!

So not only does passing a file parameter cause me problems, a simple assignment doesn't seem to work either. I think I need to expand the scope of my previous post. Can one do anything at all with a Connection Name other than pass it to a predefined Sub?
 

mjcoon

Well-Known Member
Licensed User
I just want to know what the data type is please?

I think that the answer is that there is no type attached to Connection Name.

It is more like an "Object", which also cannot be passed as a parameter to a Sub that you have defined. Or like a global (objects are also Global in this sense) and you cannot define a Sub formal parameter to have the same variable name as a global.

So I believe that it is not possible to write a Sub which can perform operations on an arbitrary opened file that is passed to it.

Erel said recently that the introduction of types into version 6.90 has been pervasive and taken a lot of work, so is not purporting to make the leap to a fully typed language.

Mike.
 

RacingDog

Active Member
Licensed User
Ahuh. I see. Dang. Unless anybody has anything to say differently,this will need some reconsideration.

, so is not purporting to make the leap to a fully typed language.

Mike.

That's fine, but until someone goes through the help files and specifies the limits, then knowing where the limits of what can be done are located is going to continue to be hit and miss, leading to more posts, and not just from me. Basically, unless a limitation is stated, it can't be distiguished from a bug by the average user who is not part of the magic circle who have acsess to the full story.

Thanks for the input.
 
Top