Commit 8996b7f3065777da8e87088ed3b0c6777faabbe7

Authored by perry.werneck@gmail.com
1 parent 56fde83f

Melhorando exemplo rexx

src/include/pw3270/class.h
@@ -66,6 +66,8 @@ @@ -66,6 +66,8 @@
66 66
67 #ifdef WIN32 67 #ifdef WIN32
68 exception(DWORD error, const char *fmt, ...); 68 exception(DWORD error, const char *fmt, ...);
  69 +#else
  70 + exception(int error, const char *fmt, ...);
69 #endif // WIN32 71 #endif // WIN32
70 72
71 virtual const char * what() const throw(); 73 virtual const char * what() const throw();
src/plugins/rx3270/sample/object.rex
1 1
2 use arg uri 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 do 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 end 22 end
12 23
13 if host~WaitForReady(60) <> 0 then 24 if host~WaitForReady(60) <> 0 then
@@ -24,7 +35,6 @@ do @@ -24,7 +35,6 @@ do
24 say "Timeout waiting for terminal ready" 35 say "Timeout waiting for terminal ready"
25 end 36 end
26 37
27 -  
28 host~disconnect() 38 host~disconnect()
29 39
30 return 0 40 return 0