Tutorials Point, posted on 28th Nov, 2017

Rexx Ask Command

/* Main program */ 
input = ask 
say input

Tutorials Point, posted on 28th Nov, 2017

Rexx Interpret

/* Main program */ 
options arexx_bifs interpret 
say 'Hello'

Tutorials Point, posted on 28th Nov, 2017

Rexx Drop

/* Main program */ 
options arexx_bifs 
a = 5 
say a 
drop a 
say a 

Tutorials Point, posted on 28th Nov, 2017

Rexx Inheritance

/* Main program */ 
st = .student~new 
st~StudentID = 1 
st~StudentName = 'Joe' 
st~Marks1 = 10 
st~Marks2 = 20 
st~Marks3 = 30 
say st~Total(st~Marks1,st~Marks2,st~Marks3)  

exit 0 
::class Person 
::class student subclass Person 
::attribute StudentID 
::attribute StudentName 
::attribute Marks1 
::attribute Marks2 
::attribute Marks3 
::method 'Total' 
use arg a,b,c 
return (ABS(a) + ABS(b) + ABS(c))

Tutorials Point, posted on 28th Nov, 2017

Rexx Creating Multiple Objects

/* Main program */ 
st = .student~new 
st~StudentID = 1 
st~StudentName = 'Joe' 
st~Marks1 = 10 
st~Marks2 = 20 
st~Marks3 = 30 
total = st~Total(st~Marks1,st~Marks2,st~Marks3) 
say total  

st1  =  .student~new 
st1~StudentID = 2 
st1~StudentName = 'John' 
st1~Marks1 = 10 
st1~Marks2 = 20 
st1~Marks3 = 40 
total = st1~Total(st1~Marks1,st1~Marks2,st1~Marks3) 
say total  

st2  =  .student~new 
st2~StudentID = 3 
st2~StudentName = 'Mark' 
st2~Marks1 = 10 
st2~Marks2 = 20 
st2~Marks3 = 30 
total = st2~Total(st2~Marks1,st2~Marks2,st2~Marks3) 
say total  

exit 0 
::class student 
::attribute StudentID 
::attribute StudentName 
::attribute Marks1 
::attribute Marks2 
::attribute Marks3 
::method 'Total' 
use arg a,b,c 
return (ABS(a) + ABS(b) + ABS(c)) 

Tutorials Point, posted on 28th Nov, 2017

Rexx Instance Method

/* Main program */ 
value = .student~new 
value~StudentID = 1 
value~StudentName = 'Joe' 
value~Marks1 = 10 
value~Marks2 = 20 
value~Marks3 = 30 
total = value~Total(value~Marks1,value~Marks2,value~Marks3) 
say total 

exit 0 
::class student 
::attribute StudentID 
::attribute StudentName 
::attribute Marks1 
::attribute Marks2 
::attribute Marks3 
::method 'Total' 
use arg a,b,c 
return (ABS(a) + ABS(b) + ABS(c)) 

Tutorials Point, posted on 28th Nov, 2017

Rexx getter setter method

/* Main program */ 
value = .student~new 
value~StudentID = 1 
value~StudentName = 'Joe' 
say value~StudentID 
say value~StudentName 

exit 0 
::class student 
::attribute StudentID 
::attribute StudentName

Tutorials Point, posted on 28th Nov, 2017

Rexx Interactive Tracing

/* Main program */ 
trace ?A

/* Main program */ 
n = 100.45 if datatype( n, wholenumber ) then 
signal msg 

say 'This is a whole number' 
return 0 
msg : say 'This is an incorrect number'

Tutorials Point, posted on 28th Nov, 2017

Rexx Trace Function

/* Main program */ 
say trace() 

/* Main program */ 
n = 100.45 if datatype( n, wholenumber ) then signal msg 

say 'This is a whole number' 
return 0 
msg : 

say 'This is an incorrect number ' 

Tutorials Point, posted on 28th Nov, 2017

Rexx Trace in Batch Mode

/* Main program */ 
trace A 

/* Main program */ 
n = 100.45 if datatype( n, wholenumber ) then signal msg 

say 'This is a whole number' 
return 0 

msg : 
   say ' This is an incorrect number ' 

1 2 3 4 5 6 7 ... 9 Next
Advertisements
Loading...