
Wide Comm variables: How to use?
Started by Rob Fantini, Jan 09 2001 04:50 PM
13 replies to this topic
#4
Posted 19 April 2004 - 03:48 PM
Hi
I'm familiar with how the @$COM & @#COM SYSTEM VARIABLES are used (mis-used) in developinig PRO-IV application.
I'm now requeted to implement a modification - a Switch/Mode - per operator running the system - as the system already makes extensive usage of @$COM[1-10] & @#COM[1-10] - I'm thinking of using one of the @!COM VARIABLES for this - In Prototype sofar it seems to work OK for string/toggling an Alpha Value -
Anyone out there had any bad experience of using Wide Comm Variables ?
Thanks
George
I'm familiar with how the @$COM & @#COM SYSTEM VARIABLES are used (mis-used) in developinig PRO-IV application.
I'm now requeted to implement a modification - a Switch/Mode - per operator running the system - as the system already makes extensive usage of @$COM[1-10] & @#COM[1-10] - I'm thinking of using one of the @!COM VARIABLES for this - In Prototype sofar it seems to work OK for string/toggling an Alpha Value -
Anyone out there had any bad experience of using Wide Comm Variables ?
Thanks
George
#5
Posted 19 April 2004 - 04:11 PM
George,
I don't know if this is still an issue or if it has been resolved. When we first started using @!COM's, if you had logic like this:
@!COM1 = WIDEVAL('')
$STRING = ALPHAVAL(@!COM1)
The results were completely random.
We got around this by changing our codes as follows:
@!COM1 = WIDEVAL(' ')
$STRING = ALPHAVAL(@!COM1)
Other than that, @!COM's have been a helpful addition. Of course, in a perfect world, nearly everything would be developed with global functions and the COMs would have little to no use...
Regards,
Joseph
I don't know if this is still an issue or if it has been resolved. When we first started using @!COM's, if you had logic like this:
@!COM1 = WIDEVAL('')
$STRING = ALPHAVAL(@!COM1)
The results were completely random.
We got around this by changing our codes as follows:
@!COM1 = WIDEVAL(' ')
$STRING = ALPHAVAL(@!COM1)
Other than that, @!COM's have been a helpful addition. Of course, in a perfect world, nearly everything would be developed with global functions and the COMs would have little to no use...
Regards,
Joseph
#6
Posted 19 April 2004 - 04:26 PM
Thanks Joseph
I had noticed that when/where the @SYSLOOK shows no values in the Wide Variables that when I did UMSG of the ALPHA(@!COM[9-8]) that spurious values were echo'd back.
I therefore am no checking for '' (null)
I'm using the Value as follows:
$user_value = ALPHA(@!COM[n])
IF $user_value # $expected_value1, $expected_value2 THEN
$user_value # $expected_value_default
ENDIF
I then allow toggle of $user_value based on a Button
then set up COMM variable for future usage thru system
@!COM[n] = WIDEVAL($user_value)
seems to be working OK
tnks
George
I had noticed that when/where the @SYSLOOK shows no values in the Wide Variables that when I did UMSG of the ALPHA(@!COM[9-8]) that spurious values were echo'd back.
I therefore am no checking for '' (null)
I'm using the Value as follows:
$user_value = ALPHA(@!COM[n])
IF $user_value # $expected_value1, $expected_value2 THEN
$user_value # $expected_value_default
ENDIF
I then allow toggle of $user_value based on a Button
then set up COMM variable for future usage thru system
@!COM[n] = WIDEVAL($user_value)
seems to be working OK
tnks
George
#8
Posted 19 April 2004 - 04:55 PM
Phil,
That's a good approach as well.
Although COM variables have a purpose, I was always chagrined that they couldn't be given dynamic names and thus by global variables.
Having to read code that references @$COM7 make maintenance more challenging. It would have been great to have been to able dynamically set and use variables like:
@$CLIENT
@#START_DATE
@#END_DATE
etc.
Although a variety of solutions exist for this, they all include a degree overhead for implementing.
My two cents anyway.
Regards,
Joseph
That's a good approach as well.
Although COM variables have a purpose, I was always chagrined that they couldn't be given dynamic names and thus by global variables.
Having to read code that references @$COM7 make maintenance more challenging. It would have been great to have been to able dynamically set and use variables like:
@$CLIENT
@#START_DATE
@#END_DATE
etc.
Although a variety of solutions exist for this, they all include a degree overhead for implementing.
My two cents anyway.
Regards,
Joseph
#9
Guest_Guest_*
Posted 19 April 2004 - 07:19 PM
Many years since I did anything with this (V2.2?!) so this probably doesn't apply..
I hazily recall a problem trying to store odd-length alphas in wide variables in that the final character seemed to get lost (maybe due to some assumption about double-byte charactersets).
I think what we did was write two general-purpose conversion global logics, say A2W() and W2A() or similar that always appended a CHAR(0) just before converting to wide and always stripped a trailing CHAR(0) if there was one after converting back (you can tell we were C programmers).
As I say.. unlikely this still applies but no harm checking.
I hazily recall a problem trying to store odd-length alphas in wide variables in that the final character seemed to get lost (maybe due to some assumption about double-byte charactersets).
I think what we did was write two general-purpose conversion global logics, say A2W() and W2A() or similar that always appended a CHAR(0) just before converting to wide and always stripped a trailing CHAR(0) if there was one after converting back (you can tell we were C programmers).
As I say.. unlikely this still applies but no harm checking.
#10
Posted 20 April 2004 - 08:12 AM
Tnks all
I had a typo in posting above
$user_value = ALPHA(@!COM[n])
IF $user_value # $expected_value1, $expected_value2 THEN
$user_value = $expected_value_default
ENDIF
I then allow toggle of $user_value between $expected_value1, $expected_value2 based on a Button
then set up COMM variable for future usage thru system
@!COM[n] = WIDEVAL($user_value)
=====
I agree with using terminal/operator keyed file and this is
The value I'm using/storing is of even length
I've done further testing and usage and its seems to 100% meet the requirements
tnks
George
I had a typo in posting above
$user_value = ALPHA(@!COM[n])
IF $user_value # $expected_value1, $expected_value2 THEN
$user_value = $expected_value_default
ENDIF
I then allow toggle of $user_value between $expected_value1, $expected_value2 based on a Button
then set up COMM variable for future usage thru system
@!COM[n] = WIDEVAL($user_value)
=====
I agree with using terminal/operator keyed file and this is
The value I'm using/storing is of even length
I've done further testing and usage and its seems to 100% meet the requirements
tnks
George
#11
Posted 20 April 2004 - 08:37 AM
=====
I agree with using terminal/operator keyed file and this is
What for? No need to waste those bytes.
MKY files are unique to the process.
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.
of the poster and do not represent those of any organisation.
#12
Posted 20 April 2004 - 04:35 PM
my mind and keyboard are not always on the same wavelenght
I agree with using terminal/operator keyed file and .... it is HOW I'd normally pass variables - however what
I'm looking todo here is have a simple value present per operator and COMM variables are ideal for this. Sometimes when working remote form the client site making file changes, new fields etc., is not always the easiest solution to implement on an ORACLE DB
MKY is TLA for ?
tnks
George
I agree with using terminal/operator keyed file and .... it is HOW I'd normally pass variables - however what
I'm looking todo here is have a simple value present per operator and COMM variables are ideal for this. Sometimes when working remote form the client site making file changes, new fields etc., is not always the easiest solution to implement on an ORACLE DB
MKY is TLA for ?
tnks
George
#13
Posted 20 April 2004 - 04:54 PM
MKY is an ABBREVIATION for Memory keyed file, the terminfo
and operator are not required.
You can have a global_function/logic
to return indivual fields from your parameter record as required.
e.g. :
#SESSIONID = GETSESSPARM('SESSIONID')
and operator are not required.
You can have a global_function/logic
to return indivual fields from your parameter record as required.
e.g. :
#SESSIONID = GETSESSPARM('SESSIONID')
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.
of the poster and do not represent those of any organisation.
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users