![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
On D3 is there a way to check if a variable is a filevariable ? |
#3
| |||
| |||
|
|
Dear group, On D3 Do you known if there is a way to check if a variable is a filevariable (result of a OPEN stmt) ? I can check if a var is initialised, but with filevar I get errors. Is there some special func like FILEINFO(var,0) on Universe ? Thanks for any help/comment. Manu |
#4
| |||
| |||
|
|
Manu Fernandes wrote: Dear group, On D3 Do you known if there is a way to check if a variable is a filevariable (result of a OPEN stmt) ? I can check if a var is initialised, but with filevar I get errors. Is there some special func like FILEINFO(var,0) on Universe ? Thanks for any help/comment. Manu Google cdp for "WhatHaveIGot". Cheers, Mike. |
#5
| |||
| |||
|
|
Manu Fernandes wrote: On D3 Do you known if there is a way to check if a variable is a filevariable (result of a OPEN stmt) ? I can check if a var is initialised, but with filevar I get errors. Google cdp for "WhatHaveIGot". Cheers, Mike. Oooh! I forgot about that aug 2000 posting; to wit |
#6
| |||
| |||
|
|
"Mike Preece" wrote Manu Fernandes wrote: On D3 Do you known if there is a way to check if a variable is a filevariable (result of a OPEN stmt) ? I can check if a var is initialised, but with filevar I get errors. Google cdp for "WhatHaveIGot". Cheers, Mike. Oooh! I forgot about that aug 2000 posting; to wit Subroutine WhatHaveIGot(FileVariable,WhatIsIt) WhatIsIt='' if not(assigned(FileVariable)) then WhatIsIt = 'Unassigned' return end clearselect CheckIds select FileVariable to CheckIds if CheckIds<2>='' then ;* This seems to be the key that unlocks it all WhatIsIt = 'A variable' return end readnext id from CheckIds else WhatIsIt = 'An empty file' return end read dummy from FileVariable,id else debug clearselect CheckIds fofid=oconv('','u90') open 'fof' to foffv else debug read fofitem from foffv,fofid else debug WhatIsIt = fofitem<1>:',':fofitem<2>:',':fofitem<3 return |
#7
| |||
| |||
|
|
I may be mistaken but that code looks like it would abort as soon as it attempted an operation on an invalid data type. The OP needs to know what the variable type is, not die in the attempt to find out. Without just echoing code has anyone actually tried the code on a current release? T What was that film? |
|
"Frank Winans" wrote: "Mike Preece" wrote Manu Fernandes wrote: On D3 Do you known if there is a way to check if a variable is a filevariable (result of a OPEN stmt) ? I can check if a var is initialised, but with filevar I get errors. Google cdp for "WhatHaveIGot". Cheers, Mike. Oooh! I forgot about that aug 2000 posting; to wit Subroutine WhatHaveIGot(FileVariable,WhatIsIt) WhatIsIt='' if not(assigned(FileVariable)) then WhatIsIt = 'Unassigned' return end clearselect CheckIds select FileVariable to CheckIds if CheckIds<2>='' then ;* This seems to be the key that unlocks it all WhatIsIt = 'A variable' return end readnext id from CheckIds else WhatIsIt = 'An empty file' return end read dummy from FileVariable,id else debug clearselect CheckIds fofid=oconv('','u90') open 'fof' to foffv else debug read fofitem from foffv,fofid else debug WhatIsIt = fofitem<1>:',':fofitem<2>:',':fofitem<3 return |
#8
| |||
| |||
|
|
What was that film? |
#9
| |||
| |||
|
|
"Mike Preece" wrote: What was that film? Huh? |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |