Jump to content


Click the link below to see the new game I'm developing!


Photo
- - - - -

Wide Comm variables: How to use?


13 replies to this topic

#1 Rob Fantini

Rob Fantini

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 291 posts
  • Gender:Male
  • Location:Haverhill, United States

Posted 09 January 2001 - 04:50 PM

Hello,
I've looked thru most of the docs and can't find howto
use Wide Communication Variables. [@!COM1 thru @!COM10] .

Could someone refer me to the documentation and or give
and example of howto use wide comm variables?

Rob F.

#2 Larry Siemer

Larry Siemer

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:Cincinnati, United States

Posted 09 January 2001 - 05:07 PM

Hi Rob,

My experience with Wide Comm Variables is limited but this
has worked for me!

@!COM9 = WIDEVAL($_TMP)
$_TMP = ALPHA(@!COM9)

Larry

#3 Rob Fantini

Rob Fantini

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 291 posts
  • Gender:Male
  • Location:Haverhill, United States

Posted 09 January 2001 - 05:23 PM

Larry,
That works! Thanks!

Once again the value of this forum is proved.


Rob

#4 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

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

#5 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

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

#6 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

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

#7 Phil

Phil

    Expert

  • Members
  • PipPipPipPip
  • 187 posts
  • Gender:Male

Posted 19 April 2004 - 04:27 PM

Of course another way of by-passing comm variables is to have a system wide, terminal driven file that could hold as much or as little as you want.

#8 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

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

#9 Guest_Guest_*

Guest_Guest_*
  • Guests

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.

#10 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

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

#11 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 372 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

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.

#12 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

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

#13 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 372 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

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')
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.

#14 Tony Waszkiewicz

Tony Waszkiewicz

    Expert

  • Members
  • PipPipPipPip
  • 174 posts
  • Gender:Male
  • Location:London, United Kingdom

Posted 21 April 2004 - 07:43 AM

Don't forget that there is an ovehead in calling a global function.
If you are doing this in a heavy batch update the performance may become unacceptable :lol:

regards



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Click the link below to see the new game I'm developing!