Continuing from part seven where we looked at "989", I will now do a full summary of the known functionality that we've looked at in this series of posts...
Code | Description | Example | Alternative |
---|---|---|---|
0 | File information |
interrupt(0,"test.txt")
if ( $status < 0 )
;file doesn't exist
else
list = $result
name = $item("Name",list) ;"test"
type = $item("Type",list)
vers = $item("Version",list)
attr = $item("Attrib",list)
endif
| This doesn't seem to return any useful information now. Could use: $fileproperties or $lfileproperties These return lots more file information, but not the same. |
2 | Extract filename | interrupt(2,"C:\temp\test.txt") filename = $result ;"test.txt" | Use string manipulation (although interrupt takes 60% of the time) |
3 | Extract file path | interrupt(3,"C:\temp\test.txt") filename = $result ;"C:\temp\" | Use string manipulation (although interrupt takes 60% of the time) |
5 | Working directory | interrupt(5,"") working = $result ;"C:\temp\" |
Use:
$ldir |
5 | Uniface "usys" directory | interrupt(5,"USYS") uniface = $result ;"C:\uniface\" |
Use:
$fileproperties of "usys:" |
6 | Concatenate file path | $result = "C:\temp" interrupt(6,"test") filepath = $result ;"C:\temp\test\" | Use string manipulation (although interrupt takes 70% of the time) |
7 | Parent directory | interrupt(7,"C:\temp\test\")
parent = $result ;"C:\temp\"
| Use string manipulation (although interrupt takes 33% of the time) |
10 | Directory listing (files) | interrupt(10,"C:\temp")
list = $result ;"test.txt·;test2.txt"
count = $status ;2
| Use: $dirlist or $ldirlist (with "FILE" topic) |
11 | Directory listing (folders) | interrupt(11,"C:\temp")
list = $result ;"test·;test2"
count = $status ;2
| Use: $dirlist or $ldirlist (with "DIR" topic) |
989 | Application focus | interrupt(989,"APPLFOCUS") | No alternative (doesn't seem to work anyway) |
989 | Format string |
$result = "RPL"
interrupt(989,"FORMAT")
string = $result
| Use string manipulation (doesn't seem to work anyway) |
989 | Undo gold characters | $result = "R·;P·!L" interrupt(989,"UNDOGOLD") string = $result ;"R;P!L" | Use: $replace |
It seems that the interrupt command isn't really very useful anymore. The functionality has either been replaced by new Uniface functions, or can be achieved by string manipulation. Given the performance improvements, it may be worth considering using interrupt if you are heavily handling file paths, but given the number of iterations needed to see the difference, I'd be surprised if this was ever worthwhile.
Given the numeric nature of the code, I'm sure that the unknowns (1, 4, 8 and 9) must do something too - I'd love to know what! Probably some of 12-988 do something as well, so I'm sure there are some hidden gems within the interrupt command. If you know of any, please let me know in the comments.
No comments:
Post a Comment