errr..
that should have been, to use ON ERROR in a READ statement:
READ record FROM filevar, 'junk' SETTING err ON ERROR
CRT filevar : ' is not a file variable'
CRT err
END ELSE
CRT 'Yep, we got a live one!'
END
On Thu, Sep 1, 2016 at 4:14 AM, Daniel Klein <[email protected]>
wrote:
> The IOCTL() function is very useful to find out things about a file but if
> you try to use it on a variable that is not a file variable then the
> program will drop to the debugger.
>
> The jBASE-way to programmatically determine if it is working with a file
> variable is to use the ON ERROR clause in an OPEN statement, e.g.
>
> OPEN filename TO filevar ON ERROR
> CRT filename : ' is not a file variable'
> END
>
> On Wed, Aug 31, 2016 at 11:39 PM, Jim Idle <[email protected]> wrote:
>
>> Google emails is fickle some times:
>>
>> http://www.jbase.com/r5/knowledgebase/manuals/3.0/30manpages
>> /man/sup22_IOCTL.htm
>>
>> Jim
>>
>> On Thu, Sep 1, 2016 at 11:39 AM, Jim Idle <[email protected]> wrote:
>>
>>> I think that that is still a pretty poor way to code it, but if they
>>> have it already, then recoding the logic to do better initialization is
>>> probably too much work.
>>>
>>> However, I seem to remember coming across this in the dim and distant
>>> past. What you need is to use the IOCTL function, that will tell you
>>> details about the variable if it is a file variable. If it is not a file
>>> variable (uninitialized or 0 or "" depending on emulation flavor) then it
>>> either tells you that, or it returns false. Easy to use and the
>>> documentatin is here:
>>>
>>>
>>> On Thu, Sep 1, 2016 at 9:26 AM, 'Ed Clark' via jBASE <
>>> [email protected]> wrote:
>>>
>>>> There is a thread on the mvdbms google group asking about it. I think
>>>> the original requestor was asking because they are doing a migration and
>>>> keep stumbling over
>>>> IF FILEVAR=“” THEN….
>>>> which worked on the old platform but aborts on the new one if the file
>>>> is already open. Probably something related to COMMON which is initialized
>>>> to to an empty string or 0 in some places and unassigned in other. If
>>>> you’re keeping a file in COMMON to avoid repeated OPENs, you need to check.
>>>>
>>>> The universe DESCRINFO distinguishes between database files and
>>>> sequential files as well as between strings, arrays, and unassigned
>>>> variables. I guess you could write a generalized logging procedure that
>>>> could take either a hashed or sequential file as a parameter and write
>>>> appropriately, or a string or empty variable and return the logged message
>>>> in that.
>>>>
>>>> On Aug 31, 2016, at 6:41 PM, Jim Idle <[email protected]> wrote:
>>>>
>>>> I can't think how that would possibly be useful within a reasonably
>>>> designed program - why do you need it, out of curiosity?
>>>>
>>>> The only way I know of is to write a trivial C function to do the same.
>>>>
>>>> Jim
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Sep 1, 2016 at 4:35 AM +0800, "'Ed Clark' via jBASE" <
>>>> [email protected]> wrote:
>>>>
>>>> universe has a basic function DESCRINFO that returns the “type” of a
>>>> variable—it is a simple variable, a file variable, a select list, assigned
>>>> or unassigned, and so forth.
>>>>> Is there an equivalent in jBase?
>>>>>
>>>>> --
>>>>> --
>>>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>>>
>>>>> To post, send email to [email protected]
>>>>> To unsubscribe, send email to [email protected]
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/jBASE?hl=en
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google Groups
>>>>> "jBASE" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>>> email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>>
>>>> --
>>>> --
>>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>>
>>>> To post, send email to [email protected]
>>>> To unsubscribe, send email to [email protected]
>>>> For more options, visit this group at http://groups.google.com/group
>>>> /jBASE?hl=en
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jBASE" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>> --
>>>> --
>>>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>>>
>>>> To post, send email to [email protected]
>>>> To unsubscribe, send email to [email protected]
>>>> For more options, visit this group at http://groups.google.com/group
>>>> /jBASE?hl=en
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jBASE" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>> --
>> --
>> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
>>
>> To post, send email to [email protected]
>> To unsubscribe, send email to [email protected]
>> For more options, visit this group at http://groups.google.com/group
>> /jBASE?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "jBASE" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.