![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
For D3 you could google cdp for WhatHaveIGot |
#4
| |||
| |||
|
|
I have a system written by someone and I need to save the COMMON area to disk. Now, most of the area is predefined so I know what is and what isn't a file-variable. Some variables within the COMMON block are user-defined and can be used for anything including file-variables. In jBASE I can use the IOCTL function and get the filename of any variable, which also returns 1 if the var is a filevar but 0 if it is not. This allows me to determine which variables are filevars and assign those to blank but also to store the file name and COMMON variable array number so that if I restore the COMMON block from disk I can reopen the correct files to the correct COMMON arrays. My question is: are there functions in D3 and UniVerse BASIC that will allow me to achieve the same (or similar) functionality. Before someone says that I should check the source code, there are some routines that I do not have the source code to. Thanks for your help. Best regards, Neil. Neil Charrington S C Systems T: +44 1564 777011 F: +44 1564 777454 W: www.sc-sys.com |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Just checked uv10, which has a STATUS var instruction with both an ELSE and an ON ERROR clause. So I'd expect STATUS s FROM [anyvar] ON ERROR {or ELSE} [not a filevar] would work. Guess what? The brain dead system designers at uv give a fatal error and drop directly to TCL (!!!!). Does not correspond to documentation, either, which says only a NULL value causes a fatal error (why!? this would make it useless also) but in any case, Neil, no can do on uv. Chandru Murthi |
#7
| |||
| |||
|
|
Our D3 gave a stack error when I tried copying a file handle to another variable then doing an IF (a = myfile) THEN crt 'same' -- a fine example of a compiler bug too trivial to fix. |
#8
| |||
| |||
|
|
A stack error isn't a compiler error, it's a run time error. The compiler could care less what the various variables will hold even if it could know. Run time sets a flag on every entry of the descriptor table telling what that variable is, the closest thing traditional Pick has to data typing. Most of the time id doesn't care so you can play with list variables to some extent, but with file variables, it's different. They're binary, so you can't treat them like strings; there's nothing at the adress they point at that would be interesting, and realistically, what would you ever want to do And, ultimately, someone somewhere made a decision at some point that there was nothing you would ever WANT to do to a file variable, therefore you CAN'T do anything with it. Mark Brown "Frank Winans" <fwinans (AT) sbcglobal (DOT) net> wrote in message news:Vspff.498$rq3.457 (AT) newssvr19 (DOT) news.prodigy.com... Our D3 gave a stack error when I tried copying a file handle to another variable then doing an IF (a = myfile) THEN crt 'same' -- a fine example of a compiler bug too trivial to fix. |
#9
| |||
| |||
|
|
Hmm, Mark, you just gave me an idea. If we %malloc space and copy a file descriptor to that space, then we should see binary data, maybe leading with x01, whereas a normal var would have its value inserted into the memory space. This is assuming that the %functions won't choke on use of a file descriptor being used, like the BASIC runtime chokes on other instructions - but %functions aren't processed by the BASIC runtime. Do you think this is worth a try? This could all be resolved down to a small subroutine which returned IS.FILE=0 or 1, and might be extended to return other info like Mike P's proggie. |
#10
| |||
| |||
|
|
A stack error isn't a compiler error, it's a run time error. The compiler could care less what the various variables will hold even if it could know. Run time sets a flag on every entry of the descriptor table telling what that variable is, the closest thing traditional Pick has to data typing. Most of the time id doesn't care so you can play with list variables to some extent, but with file variables, it's different. They're binary, so you can't treat them like strings; there's nothing at the adress they point at that would be interesting, and realistically, what would you ever want to do |
|
And, ultimately, someone somewhere made a decision at some point that there was nothing you would ever WANT to do to a file variable, therefore you CAN'T do anything with it. |
|
Mark Brown "Frank Winans" <fwinans (AT) sbcglobal (DOT) net> wrote in message news:Vspff.498$rq3.457 (AT) newssvr19 (DOT) news.prodigy.com... Our D3 gave a stack error when I tried copying a file handle to another variable then doing an IF (a = myfile) THEN crt 'same' -- a fine example of a compiler bug too trivial to fix. |
![]() |
| Thread Tools | |
| Display Modes | |
| |