Commit 8996b7f3065777da8e87088ed3b0c6777faabbe7
1 parent
56fde83f
Exists in
master
and in
5 other branches
Melhorando exemplo rexx
Showing
2 changed files
with
18 additions
and
6 deletions
Show diff stats
src/include/pw3270/class.h
src/plugins/rx3270/sample/object.rex
| 1 | 1 | |
| 2 | 2 | use arg uri |
| 3 | 3 | |
| 4 | -host = .rx3270~new("") | |
| 5 | -host~ScreenTrace(1) | |
| 4 | +if arg(1) <> "" then | |
| 5 | +do | |
| 6 | + | |
| 7 | + /* Has a host URI, create a new session and connect to the host */ | |
| 8 | + | |
| 9 | + host = .rx3270~new("") | |
| 6 | 10 | |
| 7 | -if host~connect(uri,1) <> 0 then | |
| 11 | + if host~connect(uri,1) <> 0 then | |
| 12 | + do | |
| 13 | + say "Error connecting to "||uri | |
| 14 | + return -1 | |
| 15 | + end | |
| 16 | +end | |
| 17 | +else | |
| 8 | 18 | do |
| 9 | - say "Error connecting to "||uri | |
| 10 | - return -1 | |
| 19 | + /* No host URI, use the first session */ | |
| 20 | + host = .rx3270~new("pw3270:A") | |
| 21 | + | |
| 11 | 22 | end |
| 12 | 23 | |
| 13 | 24 | if host~WaitForReady(60) <> 0 then |
| ... | ... | @@ -24,7 +35,6 @@ do |
| 24 | 35 | say "Timeout waiting for terminal ready" |
| 25 | 36 | end |
| 26 | 37 | |
| 27 | - | |
| 28 | 38 | host~disconnect() |
| 29 | 39 | |
| 30 | 40 | return 0 | ... | ... |