Re: [U2] Variable Interpolation

2012-08-24 Thread Ed Clark
So what exactly do you mean by interpolation?

If you google "variable interpolation" you can find a bunch of examples from 
other languages, such as:

for($i=1;$i<=15;$i++)
{
 ${'test_'.$i} = $i;
}

There's nothing like this in any mv implementation that I know of. In mv you 
would probably use a dynamic or dimensioned array from this particular example:

test=''
for i=1 to 15
  test=i
next i

Another example:
$string="perl";
$num1=20;
$num2=10.75;
print "The string is $string, number 1 is $num1 and number 2 is $num2\n";

which on mv would be trivially:
crt "The string is ":$string:", number 1 is ":$num1 etc
An example like this would be more useful if the string to display was being 
read from a file and used as a template. In mv, if you wanted to do something 
like that, you would store your string in the ERRMSG file, and then use the 
ERRMSG statement in basic to format output.

This second example could also be implemented on universe or unidata running on 
unix by using PCPERFORM or the DOS/SH command to call out to a shell or perl, 
which have scripting to support this sort of thing.

If you were using mv on Intersystems Cache, you could use the $xecute statement 
to do these sorts of things. Cache Object script supports this sort of 
"variable interpolation", but calls it "indirection".

You can use a limited form of indirection on any mv platform, with the EXECUTE 
statement:
  CMD="LIST VOC"
  EXECUTE CMD
I say this is "limited" because the command executes in a separate environment 
with different variables and scope.

On Cache in mvbasic, this is slightly more powerful:
  CMD="CRT @USERNO"
  EXECUTE "; ":CMD
The semicolon command runs any arbitrary line of mvbasic code. You can use this 
from the mv shell as well. But it's not exceptionally more powerful because 
it's reasonably easy on any mv platform to write a program that will do what 
the semicolon command does.

You can also use the EVAL modifier on a query command to run arbitrary mv code, 
though this code is limited by what is allowed in an type expression

On Aug 23, 2012, at 7:47 PM, jjuser ud2  wrote:

> Good afternoon,
> 
> Does UniBasic have a way to do variable interpolation (without writing
> to a file, compiling it as a program, and calling it)?
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Wjhonson

Oops there's a bug.
Right after the line that starts OFFSET += 1 should be yet another OFFSET += 1 
so the corrected version should read

   IF VERB = 'RUN' OR VERB = 'RAID' THEN
  OFFSET += 1 ; N.FILE = FIELD(SENT,' ',OFFSET)
  OFFSET += 1
   END ELSE OFFSET += 2 ; N.FILE = 'BP'


-Original Message-
From: Wjhonson 
To: donr_work ; u2-users 
Sent: Fri, Aug 24, 2012 3:40 pm
Subject: Re: [U2] Variable Interpolation



FFT.BP 'TRY' BASIC 27 lines  Level: 9
 *
 * Run any BASIC code typed at TCL
 * Writen Aug 2012 by Will Johnson based on a comment by Don Robinson
 * Released under CC-BY-2.0 license
 *
   SENT = @SENTENCE
   OFFSET = 1 ; VERB = FIELD(SENT,' ',OFFSET)
   IF VERB = 'RUN' OR VERB = 'RAID' THEN
  OFFSET += 1 ; N.FILE = FIELD(SENT,' ',OFFSET)
   END ELSE OFFSET += 2 ; N.FILE = 'BP'
   OPEN N.FILE TO F.FILE ELSE
  DISPLAY 'Cannot open file "':N.FILE:'"'
   END
   OFFSET += 1 ; WHAT = FIELD(SENT,' ',OFFSET) ; C.WHAT = COL2()+1
   L.SENT = LEN(SENT) ; WHAT = SENT[C.WHAT,L.SENT]
   WRITE WHAT:@AM:"END" ON F.FILE,'TRYCODE'
   EXECUTE 'BASIC ':N.FILE:' TRYCODE'
   EXECUTE 'RUN ':N.FILE:' TRYCODE'
 *
END



-Original Message-
From: Don Robinson 
To: U2 Users List 
Sent: Fri, Aug 24, 2012 12:20 pm
Subject: Re: [U2] Variable Interpolation


Guys,
 
I may be way off base but I have a program that takes basic code from the 
command line, compiles and runs it.
 
For example:
 >01 RUNBASIC CRT SYSTEM(2) ; CRT SYSTEM(3)

79
24
>
 
RUNBASIC is the program and CRT SYSTEM(2) ; CRT SYSTEM(3)
is the code in this example. 79 and 24 are the answers.
 
The string of = signs are just for looks.
 
This could be EXECUTEd from within a program but why?
It is quite handy for testing bits of code at TCL and might be useful in a proc.
 
RUNBASIC will do anything you can do with one line of code using ; to separate 
statements including
FOR ... NEXT and LOOP ... REPEAT.
 
Code is free as long as you don't critisize it.
 
Don Robinson

From: Wjhonson 
To: u2-users@listserver.u2ug.org 
Sent: Friday, August 24, 2012 1:38 PM
Subject: Re: [U2] Variable Interpolation


The impression I get from this thread is something like

Oh I've just read on the HELP pages that System(2) tells me the width of my CRT 
screen.
Let me ask my process what it has as the value for System(2).
Oops I have to write a program just to tell me that that's too much trouble.
Why can't it just have a way to *tell* me ?


Why




-Original Message-
From: Martin Phillips 
To: 'U2 Users List' 
Sent: Fri, Aug 24, 2012 10:11 am
Subject: Re: [U2] Variable Interpolation


Hi,

I am intrigued by this thread, mostly because I have not understood why I would 
want it.

If I can write
  CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
as suggested, why don't I just write the code inline in my program. What have I 
missed?


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Wjhonson

FFT.BP 'TRY' BASIC 27 lines  Level: 9
 *
 * Run any BASIC code typed at TCL
 * Writen Aug 2012 by Will Johnson based on a comment by Don Robinson
 * Released under CC-BY-2.0 license
 *
   SENT = @SENTENCE
   OFFSET = 1 ; VERB = FIELD(SENT,' ',OFFSET)
   IF VERB = 'RUN' OR VERB = 'RAID' THEN
  OFFSET += 1 ; N.FILE = FIELD(SENT,' ',OFFSET)
   END ELSE OFFSET += 2 ; N.FILE = 'BP'
   OPEN N.FILE TO F.FILE ELSE
  DISPLAY 'Cannot open file "':N.FILE:'"'
   END
   OFFSET += 1 ; WHAT = FIELD(SENT,' ',OFFSET) ; C.WHAT = COL2()+1
   L.SENT = LEN(SENT) ; WHAT = SENT[C.WHAT,L.SENT]
   WRITE WHAT:@AM:"END" ON F.FILE,'TRYCODE'
   EXECUTE 'BASIC ':N.FILE:' TRYCODE'
   EXECUTE 'RUN ':N.FILE:' TRYCODE'
 *
END



-Original Message-
From: Don Robinson 
To: U2 Users List 
Sent: Fri, Aug 24, 2012 12:20 pm
Subject: Re: [U2] Variable Interpolation


Guys,
 
I may be way off base but I have a program that takes basic code from the 
command line, compiles and runs it.
 
For example:
 >01 RUNBASIC CRT SYSTEM(2) ; CRT SYSTEM(3)

79
24
>
 
RUNBASIC is the program and CRT SYSTEM(2) ; CRT SYSTEM(3)
is the code in this example. 79 and 24 are the answers.
 
The string of = signs are just for looks.
 
This could be EXECUTEd from within a program but why?
It is quite handy for testing bits of code at TCL and might be useful in a proc.
 
RUNBASIC will do anything you can do with one line of code using ; to separate 
statements including
FOR ... NEXT and LOOP ... REPEAT.
 
Code is free as long as you don't critisize it.
 
Don Robinson

From: Wjhonson 
To: u2-users@listserver.u2ug.org 
Sent: Friday, August 24, 2012 1:38 PM
Subject: Re: [U2] Variable Interpolation


The impression I get from this thread is something like

Oh I've just read on the HELP pages that System(2) tells me the width of my CRT 
screen.
Let me ask my process what it has as the value for System(2).
Oops I have to write a program just to tell me that that's too much trouble.
Why can't it just have a way to *tell* me ?


Why




-Original Message-
From: Martin Phillips 
To: 'U2 Users List' 
Sent: Fri, Aug 24, 2012 10:11 am
Subject: Re: [U2] Variable Interpolation


Hi,

I am intrigued by this thread, mostly because I have not understood why I would 
want it.

If I can write
  CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
as suggested, why don't I just write the code inline in my program. What have I 
missed?


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation - UV INJECTION

2012-08-24 Thread Wjhonson

Hopefully your sysadmin has not given Universe global admin rights



-Original Message-
From: Phil Walker 
To: U2 Users List 
Sent: Fri, Aug 24, 2012 1:49 pm
Subject: Re: [U2] Variable Interpolation - UV INJECTION


01 RUNBASIC "EXECUTE \SH -c 'rm -rf /'\"

;-(

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Don Robinson
> Sent: 25 August 2012 6:54 a.m.
> To: U2 Users List
> Subject: Re: [U2] Variable Interpolation
> 
> Guys,
> 
> I may be way off base but I have a program that takes basic code from the
> command line, compiles and runs it.
> 
> For example:
>  >01 RUNBASIC CRT SYSTEM(2) ; CRT SYSTEM(3)
> 
> 79
> 24
> >
> 
> RUNBASIC is the program and CRT SYSTEM(2) ; CRT SYSTEM(3) is the code in
> this example. 79 and 24 are the answers.
> 
> The string of = signs are just for looks.
> 
> This could be EXECUTEd from within a program but why?
> It is quite handy for testing bits of code at TCL and might be useful in a 
proc.
> 
> RUNBASIC will do anything you can do with one line of code using ; to
> separate statements including FOR ... NEXT and LOOP ... REPEAT.
> 
> Code is free as long as you don't critisize it.
> 
> Don Robinson
> 
> From: Wjhonson 
> To: u2-users@listserver.u2ug.org
> Sent: Friday, August 24, 2012 1:38 PM
> Subject: Re: [U2] Variable Interpolation
> 
> 
> The impression I get from this thread is something like
> 
> Oh I've just read on the HELP pages that System(2) tells me the width of my
> CRT screen.
> Let me ask my process what it has as the value for System(2).
> Oops I have to write a program just to tell me that that's too much
> trouble.
> Why can't it just have a way to *tell* me ?
> 
> 
> Why
> 
> 
> 
> 
> -Original Message-
> From: Martin Phillips 
> To: 'U2 Users List' 
> Sent: Fri, Aug 24, 2012 10:11 am
> Subject: Re: [U2] Variable Interpolation
> 
> 
> Hi,
> 
> I am intrigued by this thread, mostly because I have not understood why I
> would
> want it.
> 
> If I can write
>   CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
> as suggested, why don't I just write the code inline in my program. What
> have I
> missed?
> 
> 
> Martin Phillips
> Ladybridge Systems Ltd
> 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
> +44 (0)1604-709200
> 
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> 
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] CPU Charge Units

2012-08-24 Thread Wjhonson

Not as old as 9.6
We're running 10.2
It's not locking anything up as far as I can see, it's just odd and probably 
shouldn't be there.



-Original Message-
From: Wols Lists 
To: U2 Users List 
Sent: Fri, Aug 24, 2012 12:37 pm
Subject: Re: [U2] CPU Charge Units


On 24/08/12 14:54, Wjhonson wrote:
> 
> 
>  
> For some reason either Universe on Windows does this, or are particular users 
are doing something where a large number of processes are left "running dead" 
on 
the Windows server.  That is, the process *claims* to be a telnet process, but 
it's not actually attached to any live Universe process any longer.
> 
Is this an OLD version of UV? This would regularly lock up our old 9.6
system, so if that's what you're experiencing I could understand why
you're looking at that.

> I suppose it's possible that if a user in Universe is idle for a long period 
of time, that they get killed in Universe, but are still living in Windows.  
I'm 
not sure that's what's happening.
> 
We never worked out what was actually causing it. And it went away after
an upgrade.

> Anyone else ever try to match up the Windows processes to the Universe 
processes  like this?
> 
Nope.

Cheers,
Wol
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation - UV INJECTION

2012-08-24 Thread Phil Walker
01 RUNBASIC "EXECUTE \SH -c 'rm -rf /'\"

;-(

> -Original Message-
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Don Robinson
> Sent: 25 August 2012 6:54 a.m.
> To: U2 Users List
> Subject: Re: [U2] Variable Interpolation
> 
> Guys,
> 
> I may be way off base but I have a program that takes basic code from the
> command line, compiles and runs it.
> 
> For example:
>  >01 RUNBASIC CRT SYSTEM(2) ; CRT SYSTEM(3)
> 
> 79
> 24
> >
> 
> RUNBASIC is the program and CRT SYSTEM(2) ; CRT SYSTEM(3) is the code in
> this example. 79 and 24 are the answers.
> 
> The string of = signs are just for looks.
> 
> This could be EXECUTEd from within a program but why?
> It is quite handy for testing bits of code at TCL and might be useful in a 
> proc.
> 
> RUNBASIC will do anything you can do with one line of code using ; to
> separate statements including FOR ... NEXT and LOOP ... REPEAT.
> 
> Code is free as long as you don't critisize it.
> 
> Don Robinson
> 
> From: Wjhonson 
> To: u2-users@listserver.u2ug.org
> Sent: Friday, August 24, 2012 1:38 PM
> Subject: Re: [U2] Variable Interpolation
> 
> 
> The impression I get from this thread is something like
> 
> Oh I've just read on the HELP pages that System(2) tells me the width of my
> CRT screen.
> Let me ask my process what it has as the value for System(2).
> Oops I have to write a program just to tell me that that's too much
> trouble.
> Why can't it just have a way to *tell* me ?
> 
> 
> Why
> 
> 
> 
> 
> -Original Message-
> From: Martin Phillips 
> To: 'U2 Users List' 
> Sent: Fri, Aug 24, 2012 10:11 am
> Subject: Re: [U2] Variable Interpolation
> 
> 
> Hi,
> 
> I am intrigued by this thread, mostly because I have not understood why I
> would
> want it.
> 
> If I can write
>   CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
> as suggested, why don't I just write the code inline in my program. What
> have I
> missed?
> 
> 
> Martin Phillips
> Ladybridge Systems Ltd
> 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
> +44 (0)1604-709200
> 
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> 
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread George Gallen
AHHH obfuscation, one of my favorite 50 cent words!

-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Allen E. Elwood
Sent: Friday, August 24, 2012 3:33 PM
To: 'U2 Users List'
Subject: Re: [U2] Variable Interpolation


i agree with marc, please define the question more betterer

this kinda falls into the eschew obfuscation category

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Allen E. Elwood

i agree with marc, please define the question more betterer

this kinda falls into the eschew obfuscation category

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Marc Harbeson
Sent: Friday, August 24, 2012 11:16 AM
To: U2 Users List
Subject: Re: [U2] Variable Interpolation

if this is what he wants - I've seen it done with pre compiler type options
that injects the code dynamically.  but I may not understand the
question as well...

On Fri, Aug 24, 2012 at 12:44 PM, Martin Phillips <
martinphill...@ladybridge.com> wrote:

> Hi,
>
> I am intrigued by this thread, mostly because I have not understood 
> why I would want it.
>
> If I can write
>CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL ) as suggested, why don't 
> I just write the code inline in my program. What have I missed?
>
>
> Martin Phillips
> Ladybridge Systems Ltd
> 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
> +44 (0)1604-709200
>
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Wjhonson

Are you saying this would run *in* a BASIC program?
Or at TCL?



-Original Message-
From: Rex Gozar 
To: U2 Users List 
Sent: Fri, Aug 24, 2012 12:16 pm
Subject: Re: [U2] Variable Interpolation


The OP is describing an "evaluate" function that executes code on the
fly based on variable values.  See JavaScript's eval() function for a
similar concept.

For example, maybe I have some variables like WIDGET and EVENT, and I
want to dynamically generate the label to an internal subroutine:

EVALUATE('GOSUB ':WIDGET:'.':EVENT)

rex
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] CPU Charge Units

2012-08-24 Thread Wols Lists
On 24/08/12 14:54, Wjhonson wrote:
> 
> 
>  
> For some reason either Universe on Windows does this, or are particular users 
> are doing something where a large number of processes are left "running dead" 
> on the Windows server.  That is, the process *claims* to be a telnet process, 
> but it's not actually attached to any live Universe process any longer.
> 
Is this an OLD version of UV? This would regularly lock up our old 9.6
system, so if that's what you're experiencing I could understand why
you're looking at that.

> I suppose it's possible that if a user in Universe is idle for a long period 
> of time, that they get killed in Universe, but are still living in Windows.  
> I'm not sure that's what's happening.
> 
We never worked out what was actually causing it. And it went away after
an upgrade.

> Anyone else ever try to match up the Windows processes to the Universe 
> processes  like this?
> 
Nope.

Cheers,
Wol
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Don Robinson
Guys,
 
I may be way off base but I have a program that takes basic code from the 
command line, compiles and runs it.
 
For example:
 >01 RUNBASIC CRT SYSTEM(2) ; CRT SYSTEM(3)

79
24
>
 
RUNBASIC is the program and CRT SYSTEM(2) ; CRT SYSTEM(3)
is the code in this example. 79 and 24 are the answers.
 
The string of = signs are just for looks.
 
This could be EXECUTEd from within a program but why?
It is quite handy for testing bits of code at TCL and might be useful in a proc.
 
RUNBASIC will do anything you can do with one line of code using ; to separate 
statements including
FOR ... NEXT and LOOP ... REPEAT.
 
Code is free as long as you don't critisize it.
 
Don Robinson

From: Wjhonson 
To: u2-users@listserver.u2ug.org 
Sent: Friday, August 24, 2012 1:38 PM
Subject: Re: [U2] Variable Interpolation


The impression I get from this thread is something like

Oh I've just read on the HELP pages that System(2) tells me the width of my CRT 
screen.
Let me ask my process what it has as the value for System(2).
Oops I have to write a program just to tell me that that's too much trouble.
Why can't it just have a way to *tell* me ?


Why




-Original Message-
From: Martin Phillips 
To: 'U2 Users List' 
Sent: Fri, Aug 24, 2012 10:11 am
Subject: Re: [U2] Variable Interpolation


Hi,

I am intrigued by this thread, mostly because I have not understood why I would 
want it.

If I can write
  CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
as suggested, why don't I just write the code inline in my program. What have I 
missed?


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Rex Gozar
The OP is describing an "evaluate" function that executes code on the
fly based on variable values.  See JavaScript's eval() function for a
similar concept.

For example, maybe I have some variables like WIDGET and EVENT, and I
want to dynamically generate the label to an internal subroutine:

EVALUATE('GOSUB ':WIDGET:'.':EVENT)

rex
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Charles_Shaffer
If the goal is to generate several variables by building variable names in 
a loop from text, like you can do in UNIX script, PERL, PHP, etc.  I don't 
think you can do that in UniBasic. There nearest thing I can think of is 
to use a dynamic array.  Maybe I am misunderstanding what you are trying 
to do.
 
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread u2ug
http://www.thefreedictionary.com/interpolation
in·ter·po·late (n-tûrp-lt)
v. in·ter·po·lat·ed, in·ter·po·lat·ing, in·ter·po·lates 
v.tr.
1. To insert or introduce between other elements or parts.
2. 
a. To insert (material) into a text.
b. To insert into a conversation. See Synonyms at introduce.
3. To change or falsify (a text) by introducing new or incorrect material.
4. Mathematics To estimate a value of (a function or series) between two known 
values.
v.intr.
To make insertions or additions.



-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Mecki Foerthmann
Sent: Friday, August 24, 2012 12:10 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Variable Interpolation

Sorry but I always thought iterpolation means describing a mathematical 
function like  Y=2X for instance  by producing a graph from it or 
describing key parameters in a system of coordinates (x,y) like where it 
crosses the y- or x-axis, if it rises or falls and in which degree etc. .



On 24/08/2012 04:56, Tony Gravagno wrote:
>> From: jjuser
>> Does UniBasic have a way to do variable interpolation (without
> writing to
>> a file, compiling it as a program, and calling it)?
>
> Do you mean something like this?
>
> VAL = 0
> CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
> CRT VAL ; *  4
>
> That would be Awesome! I don't believe any of the MV platforms do that
> because I've been looking for it for 15 years. It can be simulated in
> various ways, but you did limit the scope of the challenge.
>
> I think you're trying to avoid this?:
>
> CODE = \ CRT DATE()+20\
> EXECUTE "PGEN ":CODE CAPTURING OUT
> * OUT is 16327
> In this case the PGEN program reads from TCL, writes, compiles, runs,
> and that output gets captured. But at least the mechanism for
> performing that task is abstracted from this client/application code.
>
> Cache' allows you to enter code at TCL and then execute it without
> saving/compiling. That can also be simulated in U2. I don't think I've
> ever seen anyone else ask for it here - certainly no one willing to
> pay for it. ;)
>
> Out of curiosity, what's your application for this? And please correct
> the above if I've misunderstood the question.
>
> T
>
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Marc Harbeson
if this is what he wants - I've seen it done with pre compiler type options
that injects the code dynamically.  but I may not understand the
question as well...

On Fri, Aug 24, 2012 at 12:44 PM, Martin Phillips <
martinphill...@ladybridge.com> wrote:

> Hi,
>
> I am intrigued by this thread, mostly because I have not understood why I
> would want it.
>
> If I can write
>CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
> as suggested, why don't I just write the code inline in my program. What
> have I missed?
>
>
> Martin Phillips
> Ladybridge Systems Ltd
> 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
> +44 (0)1604-709200
>
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Wjhonson

The impression I get from this thread is something like

Oh I've just read on the HELP pages that System(2) tells me the width of my CRT 
screen.
Let me ask my process what it has as the value for System(2).
Oops I have to write a program just to tell me that that's too much trouble.
Why can't it just have a way to *tell* me ?


Why




-Original Message-
From: Martin Phillips 
To: 'U2 Users List' 
Sent: Fri, Aug 24, 2012 10:11 am
Subject: Re: [U2] Variable Interpolation


Hi,

I am intrigued by this thread, mostly because I have not understood why I would 
want it.

If I can write
   CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
as suggested, why don't I just write the code inline in my program. What have I 
missed?


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Martin Phillips
Hi,

I am intrigued by this thread, mostly because I have not understood why I would 
want it.

If I can write
   CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
as suggested, why don't I just write the code inline in my program. What have I 
missed?


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Variable Interpolation

2012-08-24 Thread Mecki Foerthmann
Sorry but I always thought iterpolation means describing a mathematical 
function like  Y=2X for instance  by producing a graph from it or 
describing key parameters in a system of coordinates (x,y) like where it 
crosses the y- or x-axis, if it rises or falls and in which degree etc. .




On 24/08/2012 04:56, Tony Gravagno wrote:

From: jjuser
Does UniBasic have a way to do variable interpolation (without

writing to

a file, compiling it as a program, and calling it)?


Do you mean something like this?

VAL = 0
CALL @"SUB FOO(X,Y);Y=X+1;RETURN"( 3, VAL )
CRT VAL ; *  4

That would be Awesome! I don't believe any of the MV platforms do that
because I've been looking for it for 15 years. It can be simulated in
various ways, but you did limit the scope of the challenge.

I think you're trying to avoid this?:

CODE = \ CRT DATE()+20\
EXECUTE "PGEN ":CODE CAPTURING OUT
* OUT is 16327
In this case the PGEN program reads from TCL, writes, compiles, runs,
and that output gets captured. But at least the mechanism for
performing that task is abstracted from this client/application code.

Cache' allows you to enter code at TCL and then execute it without
saving/compiling. That can also be simulated in U2. I don't think I've
ever seen anyone else ask for it here - certainly no one willing to
pay for it. ;)

Out of curiosity, what's your application for this? And please correct
the above if I've misunderstood the question.

T

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users



___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] CPU Charge Units

2012-08-24 Thread John Thompson
I may be sending you down the wrong road, but, these thoughts came to mind.

I've never done it in Windows, but, I've had a little experience doing it
in Linux.

In Linux, and I may be wrong... but, I think the way it works is that the
telnet or ssh process is the parent process.  So the uvsh process would be
the child process.

If the child process dies, which is uv, then the parent telnet process may
stay open.
If the parent telnet or ssh process dies, then the uv process will
certainly die eventually (unless there is some kind of record lock set or
something like that).

However, the linux kernel or the linux telnet mechanism will usually do
keep alive checks (which is configurable), to see if these parent telnet or
ssh processes have any activity.  After a certain amount of "in-activity"
it will kill them off.

Preliminary Linux info:
http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html
http://klaver.it/linux/sysctl.conf

There must be a utility to show this process relationship in windows.  I
think the previous poster said something about pslist.  That might do it.

On windows I would think there has to be a way to set options for tcp keep
alive, etc.  I.E.  Set how often a connection is checked, set how long it
should be idle for before killing it, etc.  I know you can do it in most
every unix OS out there.

Maybe this will help.  I've never used it to my recollection...
http://www.adminnation.com/2011/06/30/sysinternal-process-explorer/

On Fri, Aug 24, 2012 at 9:54 AM, Wjhonson  wrote:

>
>
>
> For some reason either Universe on Windows does this, or are particular
> users are doing something where a large number of processes are left
> "running dead" on the Windows server.  That is, the process *claims* to be
> a telnet process, but it's not actually attached to any live Universe
> process any longer.
>
> I suppose it's possible that if a user in Universe is idle for a long
> period of time, that they get killed in Universe, but are still living in
> Windows.  I'm not sure that's what's happening.
>
> Anyone else ever try to match up the Windows processes to the Universe
> processes  like this?
>
> ___
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>



-- 
John Thompson
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] CPU Charge Units

2012-08-24 Thread Wjhonson


 
For some reason either Universe on Windows does this, or are particular users 
are doing something where a large number of processes are left "running dead" 
on the Windows server.  That is, the process *claims* to be a telnet process, 
but it's not actually attached to any live Universe process any longer.

I suppose it's possible that if a user in Universe is idle for a long period of 
time, that they get killed in Universe, but are still living in Windows.  I'm 
not sure that's what's happening.

Anyone else ever try to match up the Windows processes to the Universe 
processes  like this?

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users