Re: [U2] Variable Interpolation
On 17/09/12 23:31, Dawn Wolthuis wrote: Maybe you were accepted after 10 days? --dawn The computer is an idiot, It knows not how or when. In fact, the only thing it knows Is one plus one is ten! Cheers, Wol Typed on a mobile keyboard On Sep 17, 2012, at 9:52 AM, George Gallen ggal...@wyanokegroup.com wrote: I remember when I applied to a college back in the early 80's. Under the question , which language do you Most fluently speak, I put in binary (how geekish could you get!). Funny thing, I was accepted to their Computer science program within 2 days. (guess it wasn't so silly after all). George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 10:49 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation Aa okay. That makes more sense :) If language is a place, then I've multiple citizenship! On Mon, Sep 17, 2012 at 7:15 AM, George Gallen ggal...@wyanokegroup.com wrote: I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
:) -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dawn Wolthuis Sent: Monday, September 17, 2012 6:32 PM To: U2 Users List Subject: Re: [U2] Variable Interpolation Maybe you were accepted after 10 days? --dawn Typed on a mobile keyboard On Sep 17, 2012, at 9:52 AM, George Gallen ggal...@wyanokegroup.com wrote: I remember when I applied to a college back in the early 80's. Under the question , which language do you Most fluently speak, I put in binary (how geekish could you get!). Funny thing, I was accepted to their Computer science program within 2 days. (guess it wasn't so silly after all). George ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
ROTFLMAO! Charlie On 09-18-2012 6:48 AM, Wols Lists wrote: On 17/09/12 23:31, Dawn Wolthuis wrote: Maybe you were accepted after 10 days? --dawn The computer is an idiot, It knows not how or when. In fact, the only thing it knows Is one plus one is ten! Cheers, Wol Typed on a mobile keyboard On Sep 17, 2012, at 9:52 AM, George Gallenggal...@wyanokegroup.com wrote: I remember when I applied to a college back in the early 80's. Under the question , which language do you Most fluently speak, I put in binary (how geekish could you get!). Funny thing, I was accepted to their Computer science program within 2 days. (guess it wasn't so silly after all). George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 10:49 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation Aa okay. That makes more sense :) If language is a place, then I've multiple citizenship! On Mon, Sep 17, 2012 at 7:15 AM, George Gallenggal...@wyanokegroup.com wrote: I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ 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
I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
Aa okay. That makes more sense :) If language is a place, then I've multiple citizenship! On Mon, Sep 17, 2012 at 7:15 AM, George Gallen ggal...@wyanokegroup.com wrote: I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ 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
I remember when I applied to a college back in the early 80's. Under the question , which language do you Most fluently speak, I put in binary (how geekish could you get!). Funny thing, I was accepted to their Computer science program within 2 days. (guess it wasn't so silly after all). George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 10:49 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation Aa okay. That makes more sense :) If language is a place, then I've multiple citizenship! On Mon, Sep 17, 2012 at 7:15 AM, George Gallen ggal...@wyanokegroup.com wrote: I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ 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
Maybe you were accepted after 10 days? --dawn Typed on a mobile keyboard On Sep 17, 2012, at 9:52 AM, George Gallen ggal...@wyanokegroup.com wrote: I remember when I applied to a college back in the early 80's. Under the question , which language do you Most fluently speak, I put in binary (how geekish could you get!). Funny thing, I was accepted to their Computer science program within 2 days. (guess it wasn't so silly after all). George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 10:49 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation Aa okay. That makes more sense :) If language is a place, then I've multiple citizenship! On Mon, Sep 17, 2012 at 7:15 AM, George Gallen ggal...@wyanokegroup.com wrote: I Imagine, that by language, they were referring to the programming kind vs The communicative kind! However, in the Pick world, English, could be taken as either! George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of jjuser ud2 Sent: Monday, September 17, 2012 9:51 AM To: U2 Users List Subject: Re: [U2] Variable Interpolation No -- English is my native language. I can't imagine what was in my question that would have made you think otherwise... I would imagine that the original poster comes from another language like some previous folks have said. ___ 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
Or... 0001 VERB=TRY ;* Or whatever you called this program 0002 SENT=@SENTENCE 0003 PTR=INDEX(SENT,VERB,1) ; LLEN=LEN(SENT)-PTR-LEN(VERB) 0004 SENT=SENT[PTR+LEN(VERB)+1,LLEN] 0005 * 0006 F.FILE=FIELD(SENT, ,1) ; LLEN =LLEN-LEN(F.FILE)-1 0007 SENT=SENT[LEN(F.FILE)+2, LLEN] 0008 * you now have a clean sentence... 0009 CRT DQUOTE(F.FILE) 0010 CRT DQUOTE(SENT) 0011 * 0012END ... david ... David L. Wasylenko President, Pick Professionals, Inc w) 314 558 1482 d...@pickpro.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Friday, August 24, 2012 5:55 PM To: u2-users@listserver.u2ug.org; donr_w...@yahoo.com Subject: Re: [U2] Variable Interpolation 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 wjhon...@aol.com To: donr_work donr_w...@yahoo.com; u2-users u2-users@listserver.u2ug.org 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 donr_w...@yahoo.com To: U2 Users List u2-users@listserver.u2ug.org 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2
Re: [U2] Variable Interpolation
I'm interpolating that the original poster may have not had a chance to respond back at this point... Sorry, I couldn't resist :) I would imagine that the original poster comes from another language like some previous folks have said. On Mon, Aug 27, 2012 at 12:15 PM, David L. Wasylenko d...@pickpro.comwrote: Or... 0001 VERB=TRY ;* Or whatever you called this program 0002 SENT=@SENTENCE 0003 PTR=INDEX(SENT,VERB,1) ; LLEN=LEN(SENT)-PTR-LEN(VERB) 0004 SENT=SENT[PTR+LEN(VERB)+1,LLEN] 0005 * 0006 F.FILE=FIELD(SENT, ,1) ; LLEN =LLEN-LEN(F.FILE)-1 0007 SENT=SENT[LEN(F.FILE)+2, LLEN] 0008 * you now have a clean sentence... 0009 CRT DQUOTE(F.FILE) 0010 CRT DQUOTE(SENT) 0011 * 0012END ... david ... David L. Wasylenko President, Pick Professionals, Inc w) 314 558 1482 d...@pickpro.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto: u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Friday, August 24, 2012 5:55 PM To: u2-users@listserver.u2ug.org; donr_w...@yahoo.com Subject: Re: [U2] Variable Interpolation 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 wjhon...@aol.com To: donr_work donr_w...@yahoo.com; u2-users u2-users@listserver.u2ug.org 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 donr_w...@yahoo.com To: U2 Users List u2-users@listserver.u2ug.org 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
An EVAL statement equivalent would certainly be very useful for rules-based systems or any systems that use interpreters such as screen runners etc. that need to do complex validation based on soft coded rules, e.g. as part of a screen or table definition. Unfortunately it's not already baked into the language. In uv I've only found two good ways to do it: 1. wrote my own expression interpreter/scripting language. Like most such things it has grown over the years but I use it in various products now it's there. But also.. 2. I worked with a system for custom manufacturing that created dynamic calculations for costings, manufacturing specs, cutting lists etc. based on part definitions and pseudo-variables maintained by their technical department. Whenever required, these calculations were converted into a set of temporary I Descriptors, source values placed into @record, @User0 etc. and then simple LISTs and ITYPE() functions used to process these. The nice thing is the way I Descriptors can reference each other, so each expression/variable etc. can be created as a separate I Descriptor, so it's really easy to see what's going on and very flexible. Sounds a bit cludgy as I describe it but in reality remarkably quick, none of the problems with Basic caching and easy to debug. Wish I'd designed it. Brian -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: 24 August 2012 20:19 To: u2-users@listserver.u2ug.org Subject: Re: [U2] Variable Interpolation Are you saying this would run *in* a BASIC program? Or at TCL? -Original Message- From: Rex Gozar rgo...@gmail.com To: U2 Users List u2-users@listserver.u2ug.org 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 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
I wonder if he is trying to add some of the features that C/unix have as far as imbedding commands within commands. Sometimes there is an application for it; it saves typing. Even the old PRIMOS OS had what was called command 'iteration'. A command like this: yourprimoscommandhere verylonglistofcommandlineparametershere(A,B,C,D,E,F,G,H)therestofthecommandhere Would execute a list of commands like this: yourprimoscommandhere verylonglistofcommandlineparametershereAtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereBtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereCtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereCtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereDtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereEtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereF,therestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereGtherestofthecommandhere yourprimoscommandhere verylonglistofcommandlineparametershereHtherestofthecommandhere In some cases there is typing saved when using iteration, especially if doing multiple executions of the primary command, under program control, for every server on the network let's say. Robert Norman ROBERT NORMAN AND ASSOCIATES 23441 Golden Springs Dr., #289, Diamond Bar, CA 91765 (951) 541-1668 i...@keyway.net mailto:i...@keyway.net http://users.keyway.net/~ice/ http://users.keyway.net/%7Eice/ Affordable UNIDATA programming services for PICK/BASIC, DATA/BASIC, UniVerse Basic, UniBasic, R/BASIC, jBC. On 8/24/2012 10:38 AM, Wjhonson wrote: 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
In Universe you can do the following at tcl, LIST MD 'MD' EVAL OCONV(DATE()+20,'D4') FMT 12R COUNT.SUP COL.HDR.SUPP HDR.SUP ID.SUP LIST MD 'MD' EVAL 3 * 4 FMT 12R COUNT.SUP COL.HDR.SUPP HDR.SUP ID.SUP EVAL allows any valid code that you would normal put into an itype dictionary, including variable storage to a degree using @1, @2, etc... LIST MD 'MD' EVAL 2;4;@1 * @2;OCONV(@3 * 1.3,'MD20,') FMT 12R COUNT.SUP COL.HDR.SUPP HDR.SUP ID.SUP Regards, Stewart Mitchell -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David Jordan Sent: Friday, 24 August 2012 1:42 PM To: U2 Users List Subject: Re: [U2] Variable Interpolation I wrote one myself. There is some capability with one of the conv commands but it is limited to 255character. Regards David Jordan -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tony Gravagno Sent: Friday, 24 August 2012 1:56 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Variable Interpolation 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 Effective October 2011 Symbion Pharmacy Services has changed its name to Symbion. My email address has changed from @symbionpharmacy.com to @symbion.com.au. The company's ABN (25 000 875 034) remains the same. This email and any attachments are confidential. They may contain legally privileged information or copyright material. You should not read, copy, use or disclose them without authorisation. If you are not an intended recipient, please contact us at once by return email and then delete the original message and all copies. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
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
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
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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
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
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
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
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
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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
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
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 - 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
Hopefully your sysadmin has not given Universe global admin rights -Original Message- From: Phil Walker p...@gnosys.co.nz To: U2 Users List u2-users@listserver.u2ug.org 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
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 donr_w...@yahoo.com To: U2 Users List u2-users@listserver.u2ug.org 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
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 wjhon...@aol.com To: donr_work donr_w...@yahoo.com; u2-users u2-users@listserver.u2ug.org 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 donr_w...@yahoo.com To: U2 Users List u2-users@listserver.u2ug.org 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 wjhon...@aol.com 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 martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org 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
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 testi=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 jju...@gmail.com 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
[U2] Variable Interpolation
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
Re: [U2] Variable Interpolation
If you give a specific example, maybe there's an answer -Original Message- From: jjuser ud2 jju...@gmail.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Thu, Aug 23, 2012 5:14 pm Subject: [U2] Variable Interpolation 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
A way might be a paragraph and call it from TCL. However, I cannot fathom why you want to do this. PA DISPLAY A,Your Name is a good programmer at U2Logic TEST Your Name=DOUG DOUG is a good programmer at U2Logic Regards, Doug On Thu, Aug 23, 2012 at 5:47 PM, jjuser ud2 jju...@gmail.com 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
I don't know of any way to do that in UV. I'm assuming you want to dynamically create a callable function without having to save/compile? The only thing I'd suggest is set George Gallen Senior Programmer/Analyst Accounting/Data Division ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com From: u2-users-boun...@listserver.u2ug.org [u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson [wjhon...@aol.com] Sent: Thursday, August 23, 2012 8:54 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Variable Interpolation If you give a specific example, maybe there's an answer -Original Message- From: jjuser ud2 jju...@gmail.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Thu, Aug 23, 2012 5:14 pm Subject: [U2] Variable Interpolation 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 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
Sorry, my laptop got a little too excited, and thought I was finished with my email! Anyway, I'd suggest setting up a tmpfs if your in unix, or create a memory drive in windows, then have a subroutine that writes to that location, compiles and catalogs - then uses the call @ method to call the subroutine. Only problem might be I don't know if you can have a variable number of parameters in the call @ . George Gallen Senior Programmer/Analyst Accounting/Data Division ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com From: George Gallen Sent: Thursday, August 23, 2012 9:54 PM To: U2 Users List Subject: RE: [U2] Variable Interpolation I don't know of any way to do that in UV. I'm assuming you want to dynamically create a callable function without having to save/compile? The only thing I'd suggest is set George Gallen Senior Programmer/Analyst Accounting/Data Division ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com From: u2-users-boun...@listserver.u2ug.org [u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson [wjhon...@aol.com] Sent: Thursday, August 23, 2012 8:54 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Variable Interpolation If you give a specific example, maybe there's an answer -Original Message- From: jjuser ud2 jju...@gmail.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Thu, Aug 23, 2012 5:14 pm Subject: [U2] Variable Interpolation 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 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Variable Interpolation
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
Re: [U2] Variable Interpolation
I wrote one myself. There is some capability with one of the conv commands but it is limited to 255character. Regards David Jordan -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tony Gravagno Sent: Friday, 24 August 2012 1:56 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Variable Interpolation 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